Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / Microsoft / Win32 / SafeHandles / SafeViewOfFileHandle.cs / 1 / 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 { internal sealed class SafeViewOfFileHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeViewOfFileHandle() : base(true) {} // 0 is an Invalid Handle [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeViewOfFileHandle(IntPtr handle, bool ownsHandle) : base (ownsHandle) { SetHandle(handle); } [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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HitTestParameters3D.cs
- Statements.cs
- DataServiceClientException.cs
- IdentitySection.cs
- X509Certificate2Collection.cs
- XPathExpr.cs
- UnmanagedMarshal.cs
- FullTextState.cs
- WmpBitmapEncoder.cs
- CoreSwitches.cs
- ShapingEngine.cs
- RegistryKey.cs
- BufferModesCollection.cs
- HtmlElement.cs
- FormViewCommandEventArgs.cs
- UnitySerializationHolder.cs
- TextBoxBase.cs
- MemoryStream.cs
- RelationshipNavigation.cs
- ValidationHelper.cs
- TextPointerBase.cs
- XsltCompileContext.cs
- DataSourceCacheDurationConverter.cs
- XmlSerializableServices.cs
- basemetadatamappingvisitor.cs
- SoapInteropTypes.cs
- DirectoryRootQuery.cs
- ResourceDictionary.cs
- PerformanceCountersElement.cs
- RotationValidation.cs
- SortedList.cs
- MethodExecutor.cs
- CompiledQuery.cs
- SspiNegotiationTokenAuthenticator.cs
- VirtualPathProvider.cs
- ItemsControlAutomationPeer.cs
- WaitHandleCannotBeOpenedException.cs
- DockAndAnchorLayout.cs
- RowSpanVector.cs
- NavigationProgressEventArgs.cs
- RepeatBehavior.cs
- HtmlTernaryTree.cs
- WebSysDescriptionAttribute.cs
- StyleSheetDesigner.cs
- ChtmlTextBoxAdapter.cs
- TableLayoutPanel.cs
- TrackingServices.cs
- SettingsBase.cs
- LineBreakRecord.cs
- StrokeFIndices.cs
- XmlDeclaration.cs
- SettingsBindableAttribute.cs
- LocalServiceSecuritySettingsElement.cs
- WebFaultClientMessageInspector.cs
- SqlMethodAttribute.cs
- SecurityHelper.cs
- IArgumentProvider.cs
- InternalException.cs
- XmlnsCache.cs
- DBNull.cs
- SHA384Managed.cs
- ContentElementAutomationPeer.cs
- CompensateDesigner.cs
- StyleXamlParser.cs
- NonceCache.cs
- StreamInfo.cs
- InputScopeConverter.cs
- DataGridViewRowsAddedEventArgs.cs
- HtmlMeta.cs
- WindowsScrollBarBits.cs
- ContentFilePart.cs
- PtsContext.cs
- TrackingDataItem.cs
- ProxyHwnd.cs
- Solver.cs
- IsolatedStoragePermission.cs
- CacheEntry.cs
- ByteArrayHelperWithString.cs
- COMException.cs
- CompressionTracing.cs
- ResXResourceWriter.cs
- wgx_render.cs
- DirectionalAction.cs
- ExpressionNode.cs
- CollectionChangedEventManager.cs
- StylusPlugInCollection.cs
- TextChange.cs
- IndentedTextWriter.cs
- TimeStampChecker.cs
- AtomServiceDocumentSerializer.cs
- ShapingWorkspace.cs
- ByteAnimationUsingKeyFrames.cs
- AudioException.cs
- NotifyParentPropertyAttribute.cs
- DropDownButton.cs
- DPAPIProtectedConfigurationProvider.cs
- InternalPermissions.cs
- ApplicationServiceHelper.cs
- QueryResults.cs
- WrappedKeySecurityToken.cs