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
- hresults.cs
- PlanCompiler.cs
- ReadOnlyHierarchicalDataSourceView.cs
- PageThemeBuildProvider.cs
- XmlTextReader.cs
- Button.cs
- AQNBuilder.cs
- SerializationStore.cs
- PrintPreviewControl.cs
- MsmqMessageProperty.cs
- KeyMatchBuilder.cs
- WindowCollection.cs
- MetadataArtifactLoaderCompositeFile.cs
- RevocationPoint.cs
- SafeNativeMethodsMilCoreApi.cs
- UnaryOperationBinder.cs
- InstanceNameConverter.cs
- RectAnimationBase.cs
- ConfigXmlElement.cs
- MDIWindowDialog.cs
- AttachmentCollection.cs
- XdrBuilder.cs
- UIPermission.cs
- Operand.cs
- CaseInsensitiveOrdinalStringComparer.cs
- SystemResourceHost.cs
- IgnoreDataMemberAttribute.cs
- ContainerSelectorBehavior.cs
- MenuAutomationPeer.cs
- Literal.cs
- BindableTemplateBuilder.cs
- Debugger.cs
- EntityType.cs
- NoneExcludedImageIndexConverter.cs
- SerializationInfo.cs
- ResXResourceReader.cs
- AppearanceEditorPart.cs
- MobileControl.cs
- Soap.cs
- ConnectionStringSettingsCollection.cs
- RMEnrollmentPage1.cs
- DataGrid.cs
- ObfuscationAttribute.cs
- Condition.cs
- TextTreeInsertUndoUnit.cs
- ClientSideQueueItem.cs
- TreeViewImageKeyConverter.cs
- InternalConfigHost.cs
- XPathChildIterator.cs
- RegisteredHiddenField.cs
- DeferrableContent.cs
- Double.cs
- ApplicationContext.cs
- VectorConverter.cs
- nulltextcontainer.cs
- EditingMode.cs
- ConfigurationManagerInternalFactory.cs
- DoneReceivingAsyncResult.cs
- SqlDataReader.cs
- PropertyRef.cs
- ConstructorExpr.cs
- Identifier.cs
- TreeNodeEventArgs.cs
- TemplateBindingExpression.cs
- ImmutableDispatchRuntime.cs
- SHA1Cng.cs
- EntityDataSourceEntityTypeFilterItem.cs
- DataSourceConverter.cs
- DataGridView.cs
- PinnedBufferMemoryStream.cs
- GroupJoinQueryOperator.cs
- EntityTransaction.cs
- WriteStateInfoBase.cs
- FullTextBreakpoint.cs
- Base64Decoder.cs
- ContextDataSource.cs
- TrackingMemoryStreamFactory.cs
- Stream.cs
- SchemaMerger.cs
- SafeNativeMethods.cs
- PersonalizationProviderCollection.cs
- DependentList.cs
- XmlParserContext.cs
- XmlAttributeHolder.cs
- TextElementEnumerator.cs
- srgsitem.cs
- ChannelBinding.cs
- OneOf.cs
- X509Extension.cs
- ExpandableObjectConverter.cs
- FrameworkElement.cs
- CodeDOMUtility.cs
- PrincipalPermissionMode.cs
- PathStreamGeometryContext.cs
- ScriptResourceMapping.cs
- Themes.cs
- AuthorizationRuleCollection.cs
- Compiler.cs
- UidPropertyAttribute.cs
- Transactions.cs