Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / Microsoft / Win32 / SafeHandles / SafeFileMappingHandle.cs / 1 / SafeFileMappingHandle.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; namespace Microsoft.Win32.SafeHandles { internal sealed class SafeFileMappingHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeFileMappingHandle() : base(true) {} // 0 is an Invalid Handle [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeFileMappingHandle(IntPtr handle, bool ownsHandle) : base (ownsHandle) { SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { return Win32Native.CloseHandle(handle); } } } // 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; namespace Microsoft.Win32.SafeHandles { internal sealed class SafeFileMappingHandle : SafeHandleZeroOrMinusOneIsInvalid { [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeFileMappingHandle() : base(true) {} // 0 is an Invalid Handle [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode=true)] internal SafeFileMappingHandle(IntPtr handle, bool ownsHandle) : base (ownsHandle) { SetHandle(handle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { return Win32Native.CloseHandle(handle); } } } // 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
- DrawingVisualDrawingContext.cs
- DesignerOptionService.cs
- SpecularMaterial.cs
- SID.cs
- DocumentOrderComparer.cs
- PasswordPropertyTextAttribute.cs
- CodeDomSerializerBase.cs
- ActivityBuilderHelper.cs
- RenderOptions.cs
- XMLSyntaxException.cs
- DataGridViewCell.cs
- EnvelopedPkcs7.cs
- IMembershipProvider.cs
- DataServiceConfiguration.cs
- ConfigurationProperty.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- SQlBooleanStorage.cs
- DataGridTextBox.cs
- HttpException.cs
- InkSerializer.cs
- FullTextBreakpoint.cs
- BamlLocalizer.cs
- ValidatorCompatibilityHelper.cs
- PrivateFontCollection.cs
- HorizontalAlignConverter.cs
- RootAction.cs
- ErrorsHelper.cs
- KeyboardEventArgs.cs
- documentsequencetextpointer.cs
- Terminate.cs
- Perspective.cs
- EnumValAlphaComparer.cs
- SpellerHighlightLayer.cs
- AuthenticateEventArgs.cs
- MethodCallConverter.cs
- RectIndependentAnimationStorage.cs
- DataGridAddNewRow.cs
- Compilation.cs
- AtomParser.cs
- NetNamedPipeSecurity.cs
- PageThemeParser.cs
- PenLineCapValidation.cs
- MatrixKeyFrameCollection.cs
- NumericUpDown.cs
- StylusPointPropertyInfo.cs
- SettingsContext.cs
- MenuItemBinding.cs
- CollectionDataContractAttribute.cs
- coordinatorscratchpad.cs
- ThumbAutomationPeer.cs
- Cursor.cs
- SecurityTokenProvider.cs
- Empty.cs
- PersianCalendar.cs
- Encoder.cs
- BindingGroup.cs
- arclist.cs
- TemplatedControlDesigner.cs
- DropSourceBehavior.cs
- ControlCollection.cs
- SeekStoryboard.cs
- GroupBox.cs
- HtmlTernaryTree.cs
- DataGridCaption.cs
- ProgressiveCrcCalculatingStream.cs
- PropertyMetadata.cs
- ZoneLinkButton.cs
- DocumentPageView.cs
- PersonalizableAttribute.cs
- NamedElement.cs
- PropertyFilterAttribute.cs
- OleDbErrorCollection.cs
- ChannelTokenTypeConverter.cs
- SystemIPInterfaceStatistics.cs
- CallbackValidatorAttribute.cs
- SnapshotChangeTrackingStrategy.cs
- PasswordDeriveBytes.cs
- TypeSystem.cs
- InheritedPropertyDescriptor.cs
- ReadOnlyState.cs
- XmlSequenceWriter.cs
- DropShadowEffect.cs
- ByteViewer.cs
- SamlAdvice.cs
- StrongNameIdentityPermission.cs
- WmlValidatorAdapter.cs
- XmlFormatReaderGenerator.cs
- UndirectedGraph.cs
- DataGridLength.cs
- Part.cs
- BindableTemplateBuilder.cs
- StreamSecurityUpgradeAcceptor.cs
- Stroke2.cs
- EpmSyndicationContentDeSerializer.cs
- Int16KeyFrameCollection.cs
- HttpStaticObjectsCollectionWrapper.cs
- IResourceProvider.cs
- PropertyEmitterBase.cs
- CompiledRegexRunnerFactory.cs
- GridItem.cs