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
- ElapsedEventArgs.cs
- OleDbDataAdapter.cs
- SelectionRangeConverter.cs
- GenericWebPart.cs
- InstrumentationTracker.cs
- HttpException.cs
- CursorConverter.cs
- DetailsViewRow.cs
- ETagAttribute.cs
- HwndHostAutomationPeer.cs
- EmbeddedMailObjectsCollection.cs
- SqlReferenceCollection.cs
- RequiredArgumentAttribute.cs
- BCryptSafeHandles.cs
- MatrixCamera.cs
- NoResizeSelectionBorderGlyph.cs
- DisplayInformation.cs
- XmlUTF8TextReader.cs
- ResolvePPIDRequest.cs
- DesignerSerializationOptionsAttribute.cs
- storepermission.cs
- GroupBoxAutomationPeer.cs
- HttpRequest.cs
- ProcessModuleCollection.cs
- CommandPlan.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- StringWriter.cs
- RadioButtonBaseAdapter.cs
- LabelAutomationPeer.cs
- ModulesEntry.cs
- uribuilder.cs
- PeerPresenceInfo.cs
- StateManagedCollection.cs
- QilReplaceVisitor.cs
- UIElementParaClient.cs
- Vector3DCollectionConverter.cs
- UserPreferenceChangedEventArgs.cs
- MarkupExtensionReturnTypeAttribute.cs
- XamlSerializationHelper.cs
- SoundPlayerAction.cs
- CodeTypeMember.cs
- Icon.cs
- AttachedProperty.cs
- RoutingConfiguration.cs
- ProfessionalColorTable.cs
- HttpModuleAction.cs
- CriticalHandle.cs
- PresentationSource.cs
- _NegoState.cs
- DocumentGrid.cs
- OraclePermission.cs
- PersonalizableAttribute.cs
- LocalizableAttribute.cs
- ThousandthOfEmRealPoints.cs
- COM2ICategorizePropertiesHandler.cs
- _UriSyntax.cs
- ServiceBusyException.cs
- IPAddressCollection.cs
- RemotingAttributes.cs
- XmlAttributeCollection.cs
- NotSupportedException.cs
- IntranetCredentialPolicy.cs
- StatusBarAutomationPeer.cs
- ValueExpressions.cs
- DBPropSet.cs
- CalendarDay.cs
- SplitterPanel.cs
- CodeTypeReference.cs
- SafeCryptContextHandle.cs
- CellParagraph.cs
- EventLogEntry.cs
- XmlSchemaSimpleContentRestriction.cs
- UnitySerializationHolder.cs
- ExtenderControl.cs
- Item.cs
- Code.cs
- ObjectQueryState.cs
- DateTimeValueSerializerContext.cs
- FrameworkName.cs
- StrokeNode.cs
- RuleSettingsCollection.cs
- OdbcReferenceCollection.cs
- ProviderConnectionPoint.cs
- ToolStripButton.cs
- SqlDataSourceCommandEventArgs.cs
- OpenFileDialog.cs
- ClientBuildManager.cs
- PresentationAppDomainManager.cs
- PeerCustomResolverBindingElement.cs
- DataSvcMapFileSerializer.cs
- OleDbRowUpdatingEvent.cs
- RequestCacheValidator.cs
- MultilineStringConverter.cs
- DeleteHelper.cs
- XmlSchemaChoice.cs
- mediaclock.cs
- BoundPropertyEntry.cs
- DecoderBestFitFallback.cs
- infer.cs
- MenuCommandService.cs