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
- KeyValuePairs.cs
- ErrorHandler.cs
- SamlNameIdentifierClaimResource.cs
- Int64Storage.cs
- AlternateView.cs
- PropertyGridCommands.cs
- HeaderedItemsControl.cs
- OpCodes.cs
- SessionIDManager.cs
- ZipIOBlockManager.cs
- VectorAnimation.cs
- ReadOnlyPropertyMetadata.cs
- WebSysDescriptionAttribute.cs
- MaskedTextBox.cs
- ServiceOperationListItemList.cs
- DynamicUpdateCommand.cs
- ManualWorkflowSchedulerService.cs
- MailWebEventProvider.cs
- CompoundFileStorageReference.cs
- ListBase.cs
- IsolatedStorageFile.cs
- TraceHandler.cs
- StringUtil.cs
- NotSupportedException.cs
- GAC.cs
- DotExpr.cs
- COMException.cs
- PngBitmapEncoder.cs
- BitmapPalettes.cs
- Compilation.cs
- ServiceOperationListItemList.cs
- StreamReader.cs
- FormViewInsertedEventArgs.cs
- PasswordRecovery.cs
- NavigationWindowAutomationPeer.cs
- AttachedAnnotationChangedEventArgs.cs
- SqlDataSourceFilteringEventArgs.cs
- SemanticResultValue.cs
- PreviewPageInfo.cs
- ClosureBinding.cs
- SqlDataSource.cs
- Sql8ExpressionRewriter.cs
- EventLogEntry.cs
- Formatter.cs
- SharedPersonalizationStateInfo.cs
- Type.cs
- UnmanagedMemoryStream.cs
- StorageEndPropertyMapping.cs
- HelloMessageCD1.cs
- TableProviderWrapper.cs
- DataGridViewCheckBoxCell.cs
- Button.cs
- LineSegment.cs
- WebPartDisplayMode.cs
- ToolStripManager.cs
- ScaleTransform.cs
- SerializationAttributes.cs
- SqlCrossApplyToCrossJoin.cs
- DatePickerAutomationPeer.cs
- OdbcConnectionStringbuilder.cs
- OracleConnectionFactory.cs
- XmlSchemaInclude.cs
- BookmarkOptionsHelper.cs
- SoapIncludeAttribute.cs
- OleDbConnection.cs
- EventLogTraceListener.cs
- CodeDirectoryCompiler.cs
- TableItemStyle.cs
- BlobPersonalizationState.cs
- ListenerBinder.cs
- DataFormat.cs
- TextElement.cs
- CookieHandler.cs
- WindowsRebar.cs
- ProcessThread.cs
- TraceUtility.cs
- ActiveXSite.cs
- FontCacheLogic.cs
- OrthographicCamera.cs
- DayRenderEvent.cs
- HttpRuntime.cs
- ResolveCriteriaApril2005.cs
- BaseCodeDomTreeGenerator.cs
- HtmlInputRadioButton.cs
- OdbcException.cs
- PrimitiveCodeDomSerializer.cs
- CodeConstructor.cs
- TypeConverterAttribute.cs
- MemberCollection.cs
- XmlSchemaGroup.cs
- ImageCollectionCodeDomSerializer.cs
- Lock.cs
- NameTable.cs
- serverconfig.cs
- FixedTextPointer.cs
- SiteOfOriginPart.cs
- DataGridViewImageColumn.cs
- BlobPersonalizationState.cs
- XsltQilFactory.cs
- TransformerConfigurationWizardBase.cs