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
- dbdatarecord.cs
- NavigationCommands.cs
- PeerEndPoint.cs
- _ShellExpression.cs
- ContentHostHelper.cs
- _ListenerAsyncResult.cs
- SecurityKeyIdentifier.cs
- MatrixCamera.cs
- CorrelationManager.cs
- RequiredAttributeAttribute.cs
- PropertyEntry.cs
- SmiRecordBuffer.cs
- EventMappingSettings.cs
- Constants.cs
- QueryOperationResponseOfT.cs
- Mapping.cs
- TextProperties.cs
- DoubleAnimationUsingKeyFrames.cs
- DLinqColumnProvider.cs
- WebInvokeAttribute.cs
- VisualState.cs
- XmlDataSourceNodeDescriptor.cs
- CharConverter.cs
- DataGridViewColumnCollectionDialog.cs
- CategoryAttribute.cs
- CombinedTcpChannel.cs
- WebPartMenu.cs
- WCFServiceClientProxyGenerator.cs
- Stopwatch.cs
- RemoteWebConfigurationHostStream.cs
- XmlArrayItemAttributes.cs
- BooleanExpr.cs
- PolyLineSegmentFigureLogic.cs
- DragAssistanceManager.cs
- TakeQueryOptionExpression.cs
- SystemInformation.cs
- Stackframe.cs
- CallbackException.cs
- FormViewPageEventArgs.cs
- securitycriticaldataformultiplegetandset.cs
- ObsoleteAttribute.cs
- EncoderReplacementFallback.cs
- StandardCommands.cs
- WebControl.cs
- SqlDependency.cs
- CodeConditionStatement.cs
- ComponentEvent.cs
- FixedPageProcessor.cs
- ConnectionPointCookie.cs
- ZipIOModeEnforcingStream.cs
- Dump.cs
- DecoderExceptionFallback.cs
- base64Transforms.cs
- ViewDesigner.cs
- DiscardableAttribute.cs
- CodeAccessPermission.cs
- LinqExpressionNormalizer.cs
- InfoCardCryptoHelper.cs
- TypeToStringValueConverter.cs
- LocalizeDesigner.cs
- RectIndependentAnimationStorage.cs
- DecimalSumAggregationOperator.cs
- ComEventsSink.cs
- XPathPatternParser.cs
- StrictModeSecurityHeaderElementInferenceEngine.cs
- TemplateManager.cs
- QueueProcessor.cs
- Vector3DAnimationUsingKeyFrames.cs
- input.cs
- WorkflowServiceBuildProvider.cs
- TextUtf8RawTextWriter.cs
- Menu.cs
- Peer.cs
- HMACSHA384.cs
- EncoderParameters.cs
- XsltConvert.cs
- BinaryReader.cs
- NotCondition.cs
- PassportAuthenticationEventArgs.cs
- XmlExpressionDumper.cs
- CompiledRegexRunner.cs
- StorageEndPropertyMapping.cs
- GeneralTransform.cs
- ListBase.cs
- TextEffectCollection.cs
- TextBoxBaseDesigner.cs
- FrameworkContentElement.cs
- TypeToken.cs
- StructuralObject.cs
- InstanceView.cs
- TreeNode.cs
- ImplicitInputBrush.cs
- DemultiplexingClientMessageFormatter.cs
- PbrsForward.cs
- TextBoxLine.cs
- XmlRawWriter.cs
- PolygonHotSpot.cs
- ClientTargetSection.cs
- log.cs
- DropShadowBitmapEffect.cs