Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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; } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SevenBitStream.cs
- AtomContentProperty.cs
- WebDisplayNameAttribute.cs
- DeploymentExceptionMapper.cs
- HtmlLabelAdapter.cs
- PolyLineSegment.cs
- DbUpdateCommandTree.cs
- BaseAsyncResult.cs
- ApplicationSettingsBase.cs
- RankException.cs
- FixedNode.cs
- DiscreteKeyFrames.cs
- TextParagraphCache.cs
- DataObjectPastingEventArgs.cs
- TextRangeEditLists.cs
- ToolStripDropDownButton.cs
- Package.cs
- PassportAuthenticationModule.cs
- SystemWebSectionGroup.cs
- XmlSchemaAny.cs
- TcpStreams.cs
- ToolStripDropDownClosingEventArgs.cs
- WrappedOptions.cs
- XpsS0ValidatingLoader.cs
- TCPClient.cs
- HandlerFactoryCache.cs
- ToolStripDesignerUtils.cs
- WinFormsSecurity.cs
- SymbolEqualComparer.cs
- AlphaSortedEnumConverter.cs
- Helper.cs
- SQLInt64Storage.cs
- Bold.cs
- BuildManager.cs
- SiteMapPathDesigner.cs
- exports.cs
- PartialArray.cs
- PathFigureCollection.cs
- StylusPointPropertyInfo.cs
- Visitor.cs
- HtmlTextArea.cs
- OSFeature.cs
- ReaderWriterLock.cs
- WindowsSlider.cs
- WebContext.cs
- DetailsViewPagerRow.cs
- Token.cs
- DefaultBindingPropertyAttribute.cs
- BitmapCodecInfoInternal.cs
- TypedLocationWrapper.cs
- MenuItemBindingCollection.cs
- ReadOnlyDictionary.cs
- RemoteEndpointMessageProperty.cs
- ReachDocumentReferenceSerializerAsync.cs
- TTSEvent.cs
- MouseCaptureWithinProperty.cs
- DbParameterCollection.cs
- GroupedContextMenuStrip.cs
- _NativeSSPI.cs
- StyleModeStack.cs
- DynamicDiscoSearcher.cs
- HTMLTagNameToTypeMapper.cs
- MaterializeFromAtom.cs
- Part.cs
- PointConverter.cs
- FieldNameLookup.cs
- Matrix.cs
- GroupBox.cs
- GenericAuthenticationEventArgs.cs
- TemplateColumn.cs
- RegisteredHiddenField.cs
- SqlCacheDependencyDatabaseCollection.cs
- SqlFunctionAttribute.cs
- Margins.cs
- SqlServices.cs
- AQNBuilder.cs
- WSFederationHttpBinding.cs
- Msec.cs
- TemplateControlCodeDomTreeGenerator.cs
- ArrayConverter.cs
- FilteredXmlReader.cs
- SqlConnectionFactory.cs
- CompModSwitches.cs
- DelegatedStream.cs
- LayoutEngine.cs
- InstrumentationTracker.cs
- RequiredAttributeAttribute.cs
- SystemNetworkInterface.cs
- SR.cs
- IntranetCredentialPolicy.cs
- KoreanCalendar.cs
- BufferedWebEventProvider.cs
- EnumerableRowCollection.cs
- ZipFileInfo.cs
- FilterQueryOptionExpression.cs
- PersonalizableTypeEntry.cs
- Section.cs
- Graphics.cs
- GeneralTransform3D.cs
- SchemaNotation.cs