Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PagedDataSource.cs
- DBCommand.cs
- ScriptHandlerFactory.cs
- DataSetMappper.cs
- BamlWriter.cs
- AddDataControlFieldDialog.cs
- TextRunCacheImp.cs
- MissingMemberException.cs
- EtwTrace.cs
- ObjRef.cs
- PagedDataSource.cs
- StringArrayConverter.cs
- ContainerVisual.cs
- TempFiles.cs
- BindingMemberInfo.cs
- _FtpControlStream.cs
- Span.cs
- SamlSubject.cs
- AssemblyInfo.cs
- ButtonFlatAdapter.cs
- TimeoutStream.cs
- UpdatePanelTrigger.cs
- MessageSecurityOverTcp.cs
- DataComponentNameHandler.cs
- QueryInterceptorAttribute.cs
- PrintPreviewControl.cs
- DocumentGridPage.cs
- WindowsStatusBar.cs
- ConsumerConnectionPoint.cs
- CharKeyFrameCollection.cs
- _NativeSSPI.cs
- PeerObject.cs
- DataGridRowEventArgs.cs
- MatchAllMessageFilter.cs
- FilterableAttribute.cs
- XmlNode.cs
- ToolStripDropDownMenu.cs
- FormsAuthentication.cs
- StrongNameUtility.cs
- DataGridViewMethods.cs
- RegexNode.cs
- ServiceObjectContainer.cs
- StoryFragments.cs
- OleDbErrorCollection.cs
- TabOrder.cs
- FastEncoderStatics.cs
- CustomAttributeFormatException.cs
- OracleFactory.cs
- _NestedMultipleAsyncResult.cs
- CodeAttributeArgument.cs
- Subtree.cs
- SynchronizationValidator.cs
- SafeNativeMethods.cs
- ItemsChangedEventArgs.cs
- serverconfig.cs
- GridViewHeaderRowPresenter.cs
- ProgressBarBrushConverter.cs
- TextFormatter.cs
- DLinqTableProvider.cs
- XamlSerializationHelper.cs
- CompositeActivityTypeDescriptorProvider.cs
- ColumnWidthChangedEvent.cs
- StylusTip.cs
- ObjectQuery.cs
- ThreadExceptionDialog.cs
- UnmanagedBitmapWrapper.cs
- AutomationAttributeInfo.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- OleDbError.cs
- DataBindingExpressionBuilder.cs
- VersionPair.cs
- TcpChannelListener.cs
- ClientSponsor.cs
- ComponentDispatcherThread.cs
- Select.cs
- autovalidator.cs
- HtmlInputPassword.cs
- SoapInteropTypes.cs
- EditorZone.cs
- TreeNodeStyleCollection.cs
- Content.cs
- StrokeNodeOperations.cs
- WebPartZoneBase.cs
- ThreadAttributes.cs
- SiteMapNode.cs
- Condition.cs
- RootNamespaceAttribute.cs
- WebPartManager.cs
- GetChildSubtree.cs
- XPathPatternParser.cs
- Exceptions.cs
- WorkflowViewElement.cs
- FixedDocument.cs
- RequestCachePolicyConverter.cs
- AVElementHelper.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- DoubleIndependentAnimationStorage.cs
- BooleanExpr.cs
- SmtpClient.cs
- SortedSet.cs