Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeFileMappingHandle.cs / 1 / SafeFileMappingHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeFileMappingHandle ** **Author: David Gutierrez ([....]) ** ** A wrapper for handle to file mappings, returned by ** CreateFileMapping and OpenFileMapping. Used for shared ** memory. ** ** Date: July 8, 2002 ** ===========================================================*/ using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; using System.Runtime.ConstrainedExecution; namespace Microsoft.Win32.SafeHandles { [HostProtectionAttribute(MayLeakOnAbort = true)] [SuppressUnmanagedCodeSecurityAttribute] internal sealed class SafeFileMappingHandle : SafeHandleZeroOrMinusOneIsInvalid { // Note that CreateFileMapping returns 0 on failure. // Note that you can pass in -1 for the hFile parameter. [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeFileMappingHandle() : base(true) {} [DllImport(ExternDll.Kernel32, ExactSpelling=true, SetLastError=true)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern bool CloseHandle(IntPtr handle); override protected bool ReleaseHandle() { return CloseHandle(handle); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AnimationLayer.cs
- TextTreeInsertElementUndoUnit.cs
- TableRowCollection.cs
- CodeTypeReference.cs
- GeneralTransform3DCollection.cs
- MatrixConverter.cs
- XmlIncludeAttribute.cs
- StylusLogic.cs
- MergePropertyDescriptor.cs
- RemotingSurrogateSelector.cs
- DetailsViewCommandEventArgs.cs
- RawStylusInput.cs
- CodeDomConfigurationHandler.cs
- Int32Collection.cs
- VectorAnimation.cs
- MetadataPropertyCollection.cs
- RawStylusInputReport.cs
- ControlAdapter.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- XmlUrlResolver.cs
- WindowsTooltip.cs
- InfoCardMetadataExchangeClient.cs
- ResourcePermissionBase.cs
- NumericPagerField.cs
- CompareValidator.cs
- ColumnReorderedEventArgs.cs
- InputMethodStateTypeInfo.cs
- IndexedString.cs
- PlaceHolder.cs
- SystemEvents.cs
- ChameleonKey.cs
- TagElement.cs
- ResetableIterator.cs
- GenericParameterDataContract.cs
- TypeConvertions.cs
- CommonRemoteMemoryBlock.cs
- WorkflowPrinting.cs
- HierarchicalDataSourceConverter.cs
- ProxyHelper.cs
- ToolStripDropDown.cs
- CounterCreationDataConverter.cs
- InvalidOleVariantTypeException.cs
- ControlBindingsCollection.cs
- ProfilePropertyNameValidator.cs
- SchemaInfo.cs
- X509Certificate2.cs
- ReflectionPermission.cs
- WebPartMovingEventArgs.cs
- HtmlUtf8RawTextWriter.cs
- XslAst.cs
- DbConnectionPoolIdentity.cs
- ButtonBaseAutomationPeer.cs
- NullableConverter.cs
- ArgumentOutOfRangeException.cs
- FormViewDesigner.cs
- AutomationPatternInfo.cs
- EntityTransaction.cs
- MetadataSerializer.cs
- CodeAttachEventStatement.cs
- _AutoWebProxyScriptEngine.cs
- MenuItemStyleCollection.cs
- TrustSection.cs
- ComPlusInstanceProvider.cs
- wmiprovider.cs
- EventProperty.cs
- DataGridItemEventArgs.cs
- ObjectStateFormatter.cs
- CapacityStreamGeometryContext.cs
- OletxEnlistment.cs
- InputLangChangeEvent.cs
- WebPartsPersonalization.cs
- X509Extension.cs
- ToolStripRenderer.cs
- MultipartContentParser.cs
- ZipIOCentralDirectoryBlock.cs
- Configuration.cs
- ShimAsPublicXamlType.cs
- MouseOverProperty.cs
- ServiceOperation.cs
- MemberHolder.cs
- CodeCommentStatement.cs
- ProfileModule.cs
- OutKeywords.cs
- EmptyQuery.cs
- ParseElement.cs
- CodeCommentStatementCollection.cs
- XomlCompilerResults.cs
- XamlSerializer.cs
- XmlParser.cs
- ClientFormsAuthenticationCredentials.cs
- SizeLimitedCache.cs
- MediaContext.cs
- PackageRelationshipCollection.cs
- OdbcEnvironment.cs
- EndpointConfigContainer.cs
- XmlSchemaExternal.cs
- HybridObjectCache.cs
- XslAstAnalyzer.cs
- GeneralTransformCollection.cs
- MachineKeyConverter.cs