Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Win32 / SafeHandles / SafeMemoryMappedFileHandle.cs / 1305376 / SafeMemoryMappedFileHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeMemoryMappedFileHandle ** ** Purpose: Safe handle wrapping a file mapping object handle ** ** Date: Febuary 7, 2007 ** ===========================================================*/ using System; using System.Runtime.Versioning; using System.Security.Permissions; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; namespace Microsoft.Win32.SafeHandles { // Reliability notes: // ReleaseHandle has reliability guarantee of Cer.Success, as defined by SafeHandle. // It gets prepared as a CER at instance construction time. This safe handle doesn't // need to override IsInvalid because the one it inherits from // SafeHandleZeroOrMinusOneIsInvalid is correct. //// #pragma warning disable 618 // Have not migrated to v4 transparency yet [System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)] #pragma warning restore 618 public sealed class SafeMemoryMappedFileHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedFileHandle() : base(true) { } [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedFileHandle(IntPtr handle, bool ownsHandle) : base(ownsHandle) { SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { return UnsafeNativeMethods.CloseHandle(handle); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeMemoryMappedFileHandle ** ** Purpose: Safe handle wrapping a file mapping object handle ** ** Date: Febuary 7, 2007 ** ===========================================================*/ using System; using System.Runtime.Versioning; using System.Security.Permissions; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; namespace Microsoft.Win32.SafeHandles { // Reliability notes: // ReleaseHandle has reliability guarantee of Cer.Success, as defined by SafeHandle. // It gets prepared as a CER at instance construction time. This safe handle doesn't // need to override IsInvalid because the one it inherits from // SafeHandleZeroOrMinusOneIsInvalid is correct. //// // #pragma warning disable 618 // Have not migrated to v4 transparency yet [System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)] #pragma warning restore 618 public sealed class SafeMemoryMappedFileHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedFileHandle() : base(true) { } [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] internal SafeMemoryMappedFileHandle(IntPtr handle, bool ownsHandle) : base(ownsHandle) { SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { return UnsafeNativeMethods.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
- GenericTypeParameterBuilder.cs
- DocumentReference.cs
- Utils.cs
- LogicalExpr.cs
- XmlnsCache.cs
- HelpFileFileNameEditor.cs
- SafeViewOfFileHandle.cs
- Utils.cs
- DbMetaDataColumnNames.cs
- HostVisual.cs
- TypeValidationEventArgs.cs
- RoleManagerModule.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- DataViewManager.cs
- BasicBrowserDialog.cs
- LongAverageAggregationOperator.cs
- DataColumnSelectionConverter.cs
- rsa.cs
- AssertSection.cs
- GlobalizationAssembly.cs
- DataBinding.cs
- DataGridItemEventArgs.cs
- ScriptHandlerFactory.cs
- CoTaskMemSafeHandle.cs
- RunInstallerAttribute.cs
- ServicePointManagerElement.cs
- CursorConverter.cs
- GridItemPattern.cs
- BitmapEffectOutputConnector.cs
- StorageAssociationSetMapping.cs
- XmlSchemaIdentityConstraint.cs
- LoopExpression.cs
- MatrixCamera.cs
- EmbeddedMailObjectsCollection.cs
- GiveFeedbackEvent.cs
- StrongNamePublicKeyBlob.cs
- DesignSurface.cs
- FontClient.cs
- EventArgs.cs
- CaseInsensitiveComparer.cs
- InfoCardUIAgent.cs
- SystemSounds.cs
- HtmlInputCheckBox.cs
- FrameworkElementFactoryMarkupObject.cs
- CompileXomlTask.cs
- IriParsingElement.cs
- WindowsTab.cs
- OleDbDataReader.cs
- DataTableCollection.cs
- BaseAddressElementCollection.cs
- WebPartConnectionsDisconnectVerb.cs
- FixedSOMPageElement.cs
- DataBinding.cs
- IdleTimeoutMonitor.cs
- BindStream.cs
- GridViewCancelEditEventArgs.cs
- FlowDocumentView.cs
- XmlDataSourceView.cs
- WebScriptEnablingElement.cs
- ThemeDirectoryCompiler.cs
- SystemIcons.cs
- Model3D.cs
- ObjectCache.cs
- BulletChrome.cs
- HtmlTernaryTree.cs
- ItemAutomationPeer.cs
- TextRunCacheImp.cs
- UntypedNullExpression.cs
- _NestedSingleAsyncResult.cs
- TypefaceMap.cs
- Win32PrintDialog.cs
- Bits.cs
- DataGridViewLinkColumn.cs
- EditorPartChrome.cs
- ShaderRenderModeValidation.cs
- ToolCreatedEventArgs.cs
- DataTemplateSelector.cs
- Emitter.cs
- WorkflowControlClient.cs
- RuntimeConfigLKG.cs
- TextFormatter.cs
- StrongNameSignatureInformation.cs
- NullReferenceException.cs
- WebPartTransformer.cs
- ActiveDocumentEvent.cs
- TextClipboardData.cs
- AppSettingsExpressionBuilder.cs
- Page.cs
- ResourcePermissionBase.cs
- NeedSkipTokenVisitor.cs
- AssemblyAssociatedContentFileAttribute.cs
- SplitterPanelDesigner.cs
- FilteredAttributeCollection.cs
- MetafileHeader.cs
- httpstaticobjectscollection.cs
- AssociationSetEnd.cs
- LocalBuilder.cs
- CompositeFontInfo.cs
- GraphicsState.cs
- ParserOptions.cs