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
- Parameter.cs
- ConnectivityStatus.cs
- IntegrationExceptionEventArgs.cs
- SR.cs
- Executor.cs
- NativeMethods.cs
- BinaryCommonClasses.cs
- TabletDevice.cs
- XmlEntity.cs
- log.cs
- ThicknessAnimationUsingKeyFrames.cs
- XmlFormatExtensionPrefixAttribute.cs
- Point3DCollection.cs
- loginstatus.cs
- WorkflowFileItem.cs
- MultiPropertyDescriptorGridEntry.cs
- ECDsaCng.cs
- ObjRef.cs
- QEncodedStream.cs
- XmlValidatingReaderImpl.cs
- SelectionEditor.cs
- MsmqInputChannel.cs
- SQLBoolean.cs
- MeshGeometry3D.cs
- CompilerError.cs
- Encoder.cs
- StreamAsIStream.cs
- TimeSpan.cs
- WindowsHyperlink.cs
- QuaternionAnimation.cs
- DataMember.cs
- EventLogPermissionEntryCollection.cs
- BaseProcessProtocolHandler.cs
- XmlSerializableWriter.cs
- ReferenceAssemblyAttribute.cs
- CollectionChange.cs
- OpenFileDialog.cs
- UpdateTracker.cs
- HtmlCommandAdapter.cs
- OlePropertyStructs.cs
- ContentValidator.cs
- BitmapEffectInputConnector.cs
- DataObjectMethodAttribute.cs
- _HeaderInfo.cs
- ButtonColumn.cs
- _OverlappedAsyncResult.cs
- GeometryGroup.cs
- DesignSurfaceServiceContainer.cs
- StyleCollection.cs
- ValidationSummary.cs
- LinqExpressionNormalizer.cs
- AuditLevel.cs
- ProfessionalColors.cs
- RegularExpressionValidator.cs
- FileStream.cs
- TextEditorCharacters.cs
- Types.cs
- X509ScopedServiceCertificateElementCollection.cs
- DependencyObjectValidator.cs
- ToolStripSeparator.cs
- NavigationFailedEventArgs.cs
- AsymmetricAlgorithm.cs
- NullReferenceException.cs
- Shape.cs
- ImpersonationContext.cs
- MeasurementDCInfo.cs
- ScriptingRoleServiceSection.cs
- SoapAttributeAttribute.cs
- ObjectMaterializedEventArgs.cs
- SyndicationItemFormatter.cs
- HttpStreamMessageEncoderFactory.cs
- ErrorCodes.cs
- ValueUtilsSmi.cs
- CodeFieldReferenceExpression.cs
- InputLangChangeEvent.cs
- objectresult_tresulttype.cs
- AccessedThroughPropertyAttribute.cs
- Attributes.cs
- ThumbAutomationPeer.cs
- Int16AnimationBase.cs
- PreviewPageInfo.cs
- UnitySerializationHolder.cs
- Debug.cs
- DESCryptoServiceProvider.cs
- ServiceModelPerformanceCounters.cs
- DynamicEndpointElement.cs
- ArcSegment.cs
- ThemeConfigurationDialog.cs
- RuntimeConfigLKG.cs
- HMACSHA384.cs
- CheckPair.cs
- ConfigXmlText.cs
- WebDescriptionAttribute.cs
- XmlImplementation.cs
- TypeLoadException.cs
- Model3DGroup.cs
- ServerIdentity.cs
- IOException.cs
- XmlDocumentSerializer.cs
- EntityDesignerBuildProvider.cs