Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeFileMappingHandle.cs / 1305376 / 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; using System.Runtime.Versioning; 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)] [ResourceExposure(ResourceScope.None)] [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] private static extern bool CloseHandle(IntPtr handle); override protected bool ReleaseHandle() { return CloseHandle(handle); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- JoinElimination.cs
- WorkflowInstanceExtensionProvider.cs
- Baml2006SchemaContext.cs
- WmfPlaceableFileHeader.cs
- OdbcConnection.cs
- Crc32.cs
- IDReferencePropertyAttribute.cs
- ContentElement.cs
- ImageIndexConverter.cs
- TextRunTypographyProperties.cs
- CounterCreationData.cs
- ProjectionPruner.cs
- VScrollProperties.cs
- ImageFormatConverter.cs
- UIElementAutomationPeer.cs
- baseaxisquery.cs
- XmlSchemaAppInfo.cs
- ColorTranslator.cs
- LinkArea.cs
- XmlNamespaceManager.cs
- CompilerGlobalScopeAttribute.cs
- SapiRecoInterop.cs
- VerticalConnector.xaml.cs
- UIAgentCrashedException.cs
- WinFormsUtils.cs
- WindowsGraphicsCacheManager.cs
- FormsAuthenticationTicket.cs
- TypographyProperties.cs
- ResXResourceReader.cs
- ElementAtQueryOperator.cs
- Classification.cs
- AutomationEvent.cs
- ServiceSettingsResponseInfo.cs
- TextTreeObjectNode.cs
- SpellerStatusTable.cs
- OracleFactory.cs
- ExpandoObject.cs
- ClientEventManager.cs
- DataGridAddNewRow.cs
- XamlPathDataSerializer.cs
- LineVisual.cs
- diagnosticsswitches.cs
- DiscriminatorMap.cs
- FormsAuthenticationUser.cs
- SqlCacheDependencySection.cs
- Exceptions.cs
- ISAPIApplicationHost.cs
- QilGenerator.cs
- AssemblyAttributesGoHere.cs
- FontStyle.cs
- PartialTrustVisibleAssembliesSection.cs
- unsafenativemethodsother.cs
- ActivityPropertyReference.cs
- PolicyUnit.cs
- DataBoundControlAdapter.cs
- ItemChangedEventArgs.cs
- HtmlTableRow.cs
- AVElementHelper.cs
- Stream.cs
- GridViewColumn.cs
- httpapplicationstate.cs
- SmiContextFactory.cs
- CanonicalFontFamilyReference.cs
- CheckBoxList.cs
- NullRuntimeConfig.cs
- ComplexLine.cs
- XmlAnyElementAttributes.cs
- ActivityTypeCodeDomSerializer.cs
- SystemPens.cs
- PrivilegeNotHeldException.cs
- MdiWindowListStrip.cs
- UITypeEditor.cs
- ExpressionLexer.cs
- PropertyInfo.cs
- DecoratedNameAttribute.cs
- XmlNode.cs
- DataControlCommands.cs
- ListDictionaryInternal.cs
- ICspAsymmetricAlgorithm.cs
- TransferRequestHandler.cs
- RectangleGeometry.cs
- ExpressionVisitorHelpers.cs
- X509UI.cs
- SignatureResourcePool.cs
- IdnMapping.cs
- TimeSpanStorage.cs
- MenuStrip.cs
- QueryAccessibilityHelpEvent.cs
- MarkupCompiler.cs
- IntegerValidatorAttribute.cs
- COM2IDispatchConverter.cs
- RestClientProxyHandler.cs
- DataGridViewComboBoxEditingControl.cs
- Run.cs
- GenerateTemporaryTargetAssembly.cs
- ETagAttribute.cs
- ScrollPatternIdentifiers.cs
- Restrictions.cs
- WinFormsSpinner.cs
- TimeZoneInfo.cs