Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / Microsoft / Win32 / SafeHandles / SafeFileMappingHandle.cs / 1 / SafeFileMappingHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeViewOfFileHandle ** ** ** A wrapper for file handles ** ** ===========================================================*/ using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; namespace Microsoft.Win32.SafeHandles { internal sealed class SafeFileMappingHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeFileMappingHandle() : base(true) {} // 0 is an Invalid Handle [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeFileMappingHandle(IntPtr handle, bool ownsHandle) : base (ownsHandle) { SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { return Win32Native.CloseHandle(handle); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- UnsafeNativeMethods.cs
- SQLInt64.cs
- EntityTemplateUserControl.cs
- XmlArrayItemAttribute.cs
- WebPartConnectionsConfigureVerb.cs
- CompilerScope.cs
- ServiceModelConfigurationSectionGroup.cs
- LinkButton.cs
- X500Name.cs
- XPathMultyIterator.cs
- MsmqHostedTransportConfiguration.cs
- ConnectionOrientedTransportChannelFactory.cs
- BitmapEditor.cs
- XmlWriterTraceListener.cs
- Array.cs
- StateMachine.cs
- NativeMethods.cs
- DynamicRendererThreadManager.cs
- HeaderUtility.cs
- DBNull.cs
- ELinqQueryState.cs
- DeclarativeCatalogPart.cs
- DataBoundControl.cs
- BaseConfigurationRecord.cs
- EntityContainerEmitter.cs
- IsolatedStorageFile.cs
- BamlTreeMap.cs
- EncodedStreamFactory.cs
- SelectorAutomationPeer.cs
- PageAction.cs
- FileCodeGroup.cs
- SqlDataSourceEnumerator.cs
- CompilerParameters.cs
- SqlProcedureAttribute.cs
- ModuleBuilderData.cs
- QuaternionValueSerializer.cs
- TimelineGroup.cs
- DockingAttribute.cs
- CommunicationException.cs
- DispatcherProcessingDisabled.cs
- CollectionViewGroup.cs
- PagerSettings.cs
- ConfigXmlElement.cs
- UrlMapping.cs
- PropertyPathConverter.cs
- GetPageCompletedEventArgs.cs
- CellParagraph.cs
- LocationInfo.cs
- Int32Converter.cs
- RegexCapture.cs
- TextEditorContextMenu.cs
- CompositionDesigner.cs
- KeyGestureConverter.cs
- DateTimeValueSerializerContext.cs
- StatementContext.cs
- LinkDesigner.cs
- ParameterCollectionEditor.cs
- SplitContainer.cs
- SendKeys.cs
- ReflectPropertyDescriptor.cs
- ImageListUtils.cs
- BufferModeSettings.cs
- ToggleProviderWrapper.cs
- BitmapEffectDrawingContextWalker.cs
- TreeBuilder.cs
- WorkBatch.cs
- SHA1Managed.cs
- ExpressionEditorAttribute.cs
- FontNamesConverter.cs
- MessageTraceRecord.cs
- DebugInfoGenerator.cs
- StagingAreaInputItem.cs
- AutomationPatternInfo.cs
- SoapFaultCodes.cs
- ShapeTypeface.cs
- HashAlgorithm.cs
- LockedBorderGlyph.cs
- XmlLinkedNode.cs
- ObjectComplexPropertyMapping.cs
- InputProviderSite.cs
- UnmanagedMarshal.cs
- XmlHierarchicalDataSourceView.cs
- ValidationEventArgs.cs
- LeaseManager.cs
- ArrayConverter.cs
- XmlWrappingWriter.cs
- DataFormats.cs
- FtpWebRequest.cs
- WinFormsUtils.cs
- NullRuntimeConfig.cs
- UnauthorizedAccessException.cs
- LogArchiveSnapshot.cs
- DbModificationCommandTree.cs
- AssemblyHash.cs
- QueryRewriter.cs
- ImageField.cs
- CellPartitioner.cs
- ConfigPathUtility.cs
- StatusBarPanel.cs
- CompilationLock.cs