Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / Microsoft / Win32 / SafeHandles / SafeViewOfFileHandle.cs / 1305376 / SafeViewOfFileHandle.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; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; namespace Microsoft.Win32.SafeHandles { [System.Security.SecurityCritical] // auto-generated internal sealed class SafeViewOfFileHandle : SafeHandleZeroOrMinusOneIsInvalid { [System.Security.SecurityCritical] // auto-generated_required internal SafeViewOfFileHandle() : base(true) {} // 0 is an Invalid Handle [System.Security.SecurityCritical] // auto-generated_required internal SafeViewOfFileHandle(IntPtr handle, bool ownsHandle) : base (ownsHandle) { SetHandle(handle); } [System.Security.SecurityCritical] [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { if (Win32Native.UnmapViewOfFile(handle)) { handle = IntPtr.Zero; return true; } return false; } } } // 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; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; namespace Microsoft.Win32.SafeHandles { [System.Security.SecurityCritical] // auto-generated internal sealed class SafeViewOfFileHandle : SafeHandleZeroOrMinusOneIsInvalid { [System.Security.SecurityCritical] // auto-generated_required internal SafeViewOfFileHandle() : base(true) {} // 0 is an Invalid Handle [System.Security.SecurityCritical] // auto-generated_required internal SafeViewOfFileHandle(IntPtr handle, bool ownsHandle) : base (ownsHandle) { SetHandle(handle); } [System.Security.SecurityCritical] [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { if (Win32Native.UnmapViewOfFile(handle)) { handle = IntPtr.Zero; return true; } return false; } } } // 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
- SmiContext.cs
- SeparatorAutomationPeer.cs
- GestureRecognitionResult.cs
- UIAgentMonitor.cs
- Merger.cs
- BrowserCapabilitiesFactory.cs
- FileDialog.cs
- DependencyProperty.cs
- PropertyDescriptorCollection.cs
- DataGridColumnCollection.cs
- HtmlImage.cs
- MobileControlsSection.cs
- RequiredAttributeAttribute.cs
- SafeHandles.cs
- RowUpdatedEventArgs.cs
- GeometryHitTestParameters.cs
- TextServicesDisplayAttributePropertyRanges.cs
- BufferModesCollection.cs
- QueryExpression.cs
- ExpressionVisitor.cs
- SqlMetaData.cs
- UnionCqlBlock.cs
- StylusPlugin.cs
- HttpModule.cs
- TableLayoutPanelResizeGlyph.cs
- BufferedResponseStream.cs
- WebBrowserProgressChangedEventHandler.cs
- RowUpdatingEventArgs.cs
- FileFormatException.cs
- Utils.cs
- SQLString.cs
- Odbc32.cs
- Matrix3D.cs
- UnsafeNativeMethodsTablet.cs
- LinkArea.cs
- SmiEventSink_Default.cs
- SwitchLevelAttribute.cs
- HandlerBase.cs
- FormViewInsertEventArgs.cs
- SecurityBindingElement.cs
- TagNameToTypeMapper.cs
- SetIterators.cs
- EraserBehavior.cs
- BoundPropertyEntry.cs
- HeaderUtility.cs
- ConvertEvent.cs
- DynamicDataResources.Designer.cs
- BaseResourcesBuildProvider.cs
- DesignTimeVisibleAttribute.cs
- RunInstallerAttribute.cs
- ScriptModule.cs
- XmlEnumAttribute.cs
- RegistryConfigurationProvider.cs
- InheritanceContextChangedEventManager.cs
- InputBuffer.cs
- AuthenticationServiceManager.cs
- Group.cs
- XmlSchemaCompilationSettings.cs
- RijndaelCryptoServiceProvider.cs
- SemaphoreSecurity.cs
- MailAddressCollection.cs
- StyleCollection.cs
- CaseExpr.cs
- BufferedOutputAsyncStream.cs
- MetadataArtifactLoaderCompositeResource.cs
- ImageMetadata.cs
- HttpListenerResponse.cs
- JsonFormatWriterGenerator.cs
- controlskin.cs
- DetailsViewRow.cs
- NameValuePair.cs
- ConsumerConnectionPointCollection.cs
- DataBindingCollection.cs
- SendKeys.cs
- _OSSOCK.cs
- CodeParameterDeclarationExpression.cs
- NegotiateStream.cs
- MonitoringDescriptionAttribute.cs
- DrawingContext.cs
- IndexedString.cs
- ZoneLinkButton.cs
- ContextStack.cs
- TempFiles.cs
- __Filters.cs
- DataTrigger.cs
- DependencyObject.cs
- XmlNamedNodeMap.cs
- BezierSegment.cs
- BasicBrowserDialog.designer.cs
- CacheMemory.cs
- EnumerableRowCollection.cs
- TypeHelpers.cs
- ClientProxyGenerator.cs
- FormViewPagerRow.cs
- ServerProtocol.cs
- BufferedOutputStream.cs
- PreservationFileReader.cs
- Int32AnimationBase.cs
- WebConfigurationFileMap.cs
- PageSetupDialog.cs