Code:
/ FX-1434 / FX-1434 / 1.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
- OleDbParameterCollection.cs
- AssemblyResourceLoader.cs
- ProxyWebPartConnectionCollection.cs
- ReturnEventArgs.cs
- EditableRegion.cs
- ContextStaticAttribute.cs
- PreviewKeyDownEventArgs.cs
- SessionState.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- CoTaskMemHandle.cs
- IApplicationTrustManager.cs
- SyndicationContent.cs
- SqlRewriteScalarSubqueries.cs
- SchemaLookupTable.cs
- VisualBrush.cs
- ProfileBuildProvider.cs
- CqlGenerator.cs
- GenericIdentity.cs
- Double.cs
- DataColumnPropertyDescriptor.cs
- FormattedText.cs
- mactripleDES.cs
- CompilationUtil.cs
- ProtocolsConfigurationEntry.cs
- FontFamilyConverter.cs
- SourceFileBuildProvider.cs
- TextParentUndoUnit.cs
- ObjectAnimationBase.cs
- ContentTypeSettingClientMessageFormatter.cs
- SortKey.cs
- ItemCollection.cs
- SequenceDesigner.cs
- Application.cs
- SchemaAttDef.cs
- TransformCollection.cs
- SpeechDetectedEventArgs.cs
- ImageSource.cs
- SafeHandles.cs
- LinkGrep.cs
- _LazyAsyncResult.cs
- RequestQueryParser.cs
- ExtensibleSyndicationObject.cs
- IISMapPath.cs
- InvalidFilterCriteriaException.cs
- ListBox.cs
- RequiredAttributeAttribute.cs
- DataServiceOperationContext.cs
- VectorAnimationUsingKeyFrames.cs
- PerspectiveCamera.cs
- HtmlInputSubmit.cs
- BoolExpressionVisitors.cs
- documentsequencetextpointer.cs
- XmlSerializableReader.cs
- MailSettingsSection.cs
- SafeEventLogWriteHandle.cs
- PixelShader.cs
- StatusStrip.cs
- NamedPipeHostedTransportConfiguration.cs
- filewebrequest.cs
- RadioButtonFlatAdapter.cs
- DataFormat.cs
- PartitionedStream.cs
- OutputCacheModule.cs
- EntityContainer.cs
- AppSecurityManager.cs
- AdPostCacheSubstitution.cs
- PaperSize.cs
- AccessDataSourceView.cs
- FlowLayoutPanel.cs
- LineInfo.cs
- MediaContext.cs
- SchemaTypeEmitter.cs
- EventMap.cs
- SmtpNtlmAuthenticationModule.cs
- ImageAnimator.cs
- ColorConverter.cs
- SupportsPreviewControlAttribute.cs
- UnSafeCharBuffer.cs
- RequestCachePolicyConverter.cs
- HttpHandlerActionCollection.cs
- DesignerSerializerAttribute.cs
- HttpStreamXmlDictionaryReader.cs
- EventLogQuery.cs
- MultiPageTextView.cs
- PathNode.cs
- GroupedContextMenuStrip.cs
- CardSpaceShim.cs
- OrderedEnumerableRowCollection.cs
- TextDecorationUnitValidation.cs
- Italic.cs
- WebPartChrome.cs
- DispatcherProcessingDisabled.cs
- DataGridCellEditEndingEventArgs.cs
- ObjectDataSourceEventArgs.cs
- OLEDB_Util.cs
- XamlPoint3DCollectionSerializer.cs
- NavigationProgressEventArgs.cs
- CancelEventArgs.cs
- MatchingStyle.cs
- NameValueFileSectionHandler.cs