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
- Matrix3D.cs
- SemanticValue.cs
- WorkflowServiceAttributesTypeConverter.cs
- StatusStrip.cs
- Literal.cs
- MsmqIntegrationSecurity.cs
- dbenumerator.cs
- SystemColors.cs
- RectIndependentAnimationStorage.cs
- DynamicPropertyHolder.cs
- AddressAccessDeniedException.cs
- EditorBrowsableAttribute.cs
- CheckBoxBaseAdapter.cs
- mediapermission.cs
- CheckBoxStandardAdapter.cs
- AdapterDictionary.cs
- ActivityExecutionFilter.cs
- XmlSchemaAppInfo.cs
- SortedList.cs
- SHA1Managed.cs
- Matrix3D.cs
- TableParagraph.cs
- GradientStop.cs
- ServiceNameElementCollection.cs
- FlowDocumentReader.cs
- WebPartTransformerAttribute.cs
- BitHelper.cs
- InvalidEnumArgumentException.cs
- DataGridViewLinkCell.cs
- ExceptionUtil.cs
- ParameterCollectionEditorForm.cs
- DynamicRenderer.cs
- AbandonedMutexException.cs
- ObjectNotFoundException.cs
- TextModifier.cs
- NonNullItemCollection.cs
- SrgsSubset.cs
- ResourcePermissionBase.cs
- PKCS1MaskGenerationMethod.cs
- LookupBindingPropertiesAttribute.cs
- PackageDigitalSignatureManager.cs
- GridToolTip.cs
- COM2PropertyBuilderUITypeEditor.cs
- CriticalExceptions.cs
- AuthorizationSection.cs
- BatchWriter.cs
- PeerInvitationResponse.cs
- HtmlContainerControl.cs
- DbQueryCommandTree.cs
- CodeGenerator.cs
- KeyGestureValueSerializer.cs
- OutputCacheSettingsSection.cs
- DataSourceXmlTextReader.cs
- PerformanceCounter.cs
- TemplateControlParser.cs
- OutputCacheSection.cs
- recordstatefactory.cs
- QueryCacheEntry.cs
- IList.cs
- DataGridViewBand.cs
- PrintingPermission.cs
- DefaultClaimSet.cs
- RepeaterItemEventArgs.cs
- FramingFormat.cs
- WebPartConnectionsEventArgs.cs
- ActiveXSite.cs
- WindowsRichEditRange.cs
- QilFactory.cs
- CacheMemory.cs
- SwitchDesigner.xaml.cs
- _Rfc2616CacheValidators.cs
- EdmTypeAttribute.cs
- ToolStripContainer.cs
- SqlUDTStorage.cs
- SetStateDesigner.cs
- ValidationSummaryDesigner.cs
- ProfileGroupSettings.cs
- FormParameter.cs
- EntityRecordInfo.cs
- ASCIIEncoding.cs
- OrthographicCamera.cs
- ProbeRequestResponseAsyncResult.cs
- DataColumnPropertyDescriptor.cs
- TargetConverter.cs
- BStrWrapper.cs
- DataDocumentXPathNavigator.cs
- PanelStyle.cs
- XmlChildNodes.cs
- TdsParserStaticMethods.cs
- TableItemProviderWrapper.cs
- SID.cs
- TextTrailingCharacterEllipsis.cs
- EventLogEntry.cs
- DesignerFrame.cs
- DynamicUpdateCommand.cs
- PagePropertiesChangingEventArgs.cs
- ValidateNames.cs
- RequestCacheManager.cs
- SystemException.cs
- WindowsFormsSynchronizationContext.cs