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
- NullableBoolConverter.cs
- ConfigurationElement.cs
- ScriptControlDescriptor.cs
- XMLSyntaxException.cs
- NamespaceDecl.cs
- ParserStreamGeometryContext.cs
- DigitShape.cs
- UndoUnit.cs
- SelectionProcessor.cs
- RegexReplacement.cs
- ActivatedMessageQueue.cs
- DeflateEmulationStream.cs
- ReservationCollection.cs
- WindowsGraphicsWrapper.cs
- RadioButtonList.cs
- MethodAccessException.cs
- PlatformCulture.cs
- CircleEase.cs
- RawKeyboardInputReport.cs
- FixedStringLookup.cs
- PagerStyle.cs
- SystemWebExtensionsSectionGroup.cs
- NotSupportedException.cs
- MinMaxParagraphWidth.cs
- WebDisplayNameAttribute.cs
- EnumBuilder.cs
- DrawingVisual.cs
- PostBackOptions.cs
- BrowserCapabilitiesCodeGenerator.cs
- XD.cs
- SqlLiftIndependentRowExpressions.cs
- SynchronizationLockException.cs
- PrivilegedConfigurationManager.cs
- KeyPressEvent.cs
- TextCompositionEventArgs.cs
- DataViewListener.cs
- XmlHierarchicalEnumerable.cs
- FixedHyperLink.cs
- SharedPersonalizationStateInfo.cs
- DataGridViewEditingControlShowingEventArgs.cs
- EDesignUtil.cs
- HtmlEncodedRawTextWriter.cs
- ClientSession.cs
- _NtlmClient.cs
- RtfToXamlReader.cs
- SendActivityDesignerTheme.cs
- TreeNodeCollection.cs
- HttpPostedFile.cs
- ToolboxBitmapAttribute.cs
- TemplateField.cs
- XPathSelfQuery.cs
- CodeMemberMethod.cs
- PopupEventArgs.cs
- WorkflowDesigner.cs
- baseaxisquery.cs
- Journal.cs
- WmlPhoneCallAdapter.cs
- EntityDataSourceDesigner.cs
- HtmlFormParameterReader.cs
- DecimalSumAggregationOperator.cs
- DefaultAssemblyResolver.cs
- DataGridViewCellCancelEventArgs.cs
- DoubleStorage.cs
- LineGeometry.cs
- XmlBinaryReader.cs
- LoginStatusDesigner.cs
- ResizeGrip.cs
- XPathScanner.cs
- HashRepartitionEnumerator.cs
- ColumnResult.cs
- PreviewKeyDownEventArgs.cs
- ImageIndexConverter.cs
- ExecutedRoutedEventArgs.cs
- BulletChrome.cs
- PngBitmapEncoder.cs
- AnnotationService.cs
- CommonDialog.cs
- PrimitiveXmlSerializers.cs
- DataControlLinkButton.cs
- CheckBoxList.cs
- DetailsViewActionList.cs
- DuplicateWaitObjectException.cs
- MarkupObject.cs
- FontNamesConverter.cs
- IntPtr.cs
- LogEntryDeserializer.cs
- CopyEncoder.cs
- arclist.cs
- HtmlInputHidden.cs
- COM2ExtendedTypeConverter.cs
- dsa.cs
- TableSectionStyle.cs
- Automation.cs
- EventEntry.cs
- RightNameExpirationInfoPair.cs
- Baml6ConstructorInfo.cs
- ListenerAdapter.cs
- TreeBuilderBamlTranslator.cs
- DataServices.cs
- MetadataUtilsSmi.cs