Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // 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); } } } // 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
- DataGridViewTextBoxEditingControl.cs
- SoapExtensionImporter.cs
- Int16Animation.cs
- EllipseGeometry.cs
- XmlCharType.cs
- VerificationAttribute.cs
- StateMachineHistory.cs
- TrackingProfile.cs
- StringValueConverter.cs
- LoginViewDesigner.cs
- NativeMethods.cs
- ToolboxComponentsCreatedEventArgs.cs
- TileModeValidation.cs
- SpAudioStreamWrapper.cs
- WSHttpBindingElement.cs
- EditorPartCollection.cs
- Rect.cs
- TreeNode.cs
- GridItem.cs
- ComponentDispatcher.cs
- EasingKeyFrames.cs
- TransformBlockRequest.cs
- SpeechSeg.cs
- TextDpi.cs
- JournalEntryListConverter.cs
- GridItemCollection.cs
- AcceleratedTokenProviderState.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- Menu.cs
- ContentPosition.cs
- AutomationElement.cs
- RefreshPropertiesAttribute.cs
- WebPageTraceListener.cs
- BamlRecordReader.cs
- CryptoStream.cs
- DCSafeHandle.cs
- NullReferenceException.cs
- FormClosedEvent.cs
- SqlCacheDependencyDatabaseCollection.cs
- LayoutTable.cs
- BaseTemplateParser.cs
- ResourceExpressionEditorSheet.cs
- CursorConverter.cs
- SemaphoreSecurity.cs
- TimelineClockCollection.cs
- Vector.cs
- RuntimeConfigurationRecord.cs
- GenericWebPart.cs
- BrowsableAttribute.cs
- LayoutTable.cs
- CqlErrorHelper.cs
- XamlPoint3DCollectionSerializer.cs
- XmlWellformedWriter.cs
- TemplateInstanceAttribute.cs
- MetadataImporter.cs
- MailWriter.cs
- BindingValueChangedEventArgs.cs
- PathSegmentCollection.cs
- TcpSocketManager.cs
- TextChangedEventArgs.cs
- XmlAttributeAttribute.cs
- ReflectionPermission.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- RootNamespaceAttribute.cs
- Walker.cs
- Utils.cs
- TextRangeProviderWrapper.cs
- SystemPens.cs
- CrossAppDomainChannel.cs
- SQLChars.cs
- SlipBehavior.cs
- TransportationConfigurationTypeInstallComponent.cs
- GenericTypeParameterBuilder.cs
- BuildResult.cs
- WrappedDispatcherException.cs
- ControlParser.cs
- ResourcePropertyMemberCodeDomSerializer.cs
- OleDbCommand.cs
- ConnectionOrientedTransportChannelListener.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- RelatedCurrencyManager.cs
- BigInt.cs
- RSACryptoServiceProvider.cs
- X509ChainPolicy.cs
- DbProviderServices.cs
- Point3DConverter.cs
- SignedInfo.cs
- SaveLedgerEntryRequest.cs
- SingleAnimationUsingKeyFrames.cs
- GridProviderWrapper.cs
- ApplicationSecurityManager.cs
- ScrollBarRenderer.cs
- XpsFilter.cs
- TimeSpanStorage.cs
- IOThreadScheduler.cs
- GridEntryCollection.cs
- TextEndOfSegment.cs
- CodeCommentStatement.cs
- TokenBasedSet.cs
- InputElement.cs