Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- hresults.cs
- QilFactory.cs
- ECDiffieHellmanCng.cs
- MobileCategoryAttribute.cs
- BCLDebug.cs
- DSACryptoServiceProvider.cs
- AssemblySettingAttributes.cs
- _NetRes.cs
- SamlEvidence.cs
- Part.cs
- DBConcurrencyException.cs
- CellTreeNode.cs
- CollectionView.cs
- MULTI_QI.cs
- MetadataCache.cs
- CommandArguments.cs
- XmlException.cs
- DataIdProcessor.cs
- WorkflowStateRollbackService.cs
- PathStreamGeometryContext.cs
- DataTableMappingCollection.cs
- ValueTable.cs
- ListSortDescription.cs
- CodeExpressionStatement.cs
- RegionIterator.cs
- Metafile.cs
- MsmqHostedTransportManager.cs
- WeakKeyDictionary.cs
- InteropAutomationProvider.cs
- RichTextBox.cs
- UdpRetransmissionSettings.cs
- FormsAuthenticationConfiguration.cs
- WebPartVerb.cs
- ListViewDataItem.cs
- FunctionImportElement.cs
- TypeSystemHelpers.cs
- UnsafeNativeMethods.cs
- FtpRequestCacheValidator.cs
- LayoutExceptionEventArgs.cs
- RemotingConfigParser.cs
- MetaType.cs
- DoubleLinkListEnumerator.cs
- SafeEventLogWriteHandle.cs
- WebBrowserUriTypeConverter.cs
- DataPagerField.cs
- CategoryGridEntry.cs
- XmlWrappingReader.cs
- sortedlist.cs
- RegistryDataKey.cs
- BidOverLoads.cs
- QuaternionConverter.cs
- SpnegoTokenAuthenticator.cs
- System.Data_BID.cs
- _SingleItemRequestCache.cs
- CatalogZoneBase.cs
- SoapClientMessage.cs
- XmlStreamStore.cs
- Accessible.cs
- PartitionResolver.cs
- TrackBarRenderer.cs
- GetPageCompletedEventArgs.cs
- BitmapEffect.cs
- SystemWebCachingSectionGroup.cs
- NTAccount.cs
- SqlDataSourceQuery.cs
- AnonymousIdentificationModule.cs
- StorageScalarPropertyMapping.cs
- FormParameter.cs
- EmptyEnumerable.cs
- FacetValues.cs
- ContextMenuService.cs
- NetTcpSecurityElement.cs
- Operator.cs
- StrokeCollectionDefaultValueFactory.cs
- XMLSyntaxException.cs
- Track.cs
- MobileControlBuilder.cs
- UnsafeNativeMethodsTablet.cs
- Baml6ConstructorInfo.cs
- controlskin.cs
- WebFormDesignerActionService.cs
- WebPartManagerInternals.cs
- LinearGradientBrush.cs
- LostFocusEventManager.cs
- CodeTypeConstructor.cs
- BaseParagraph.cs
- TextEndOfParagraph.cs
- ExtendedPropertyDescriptor.cs
- PackagePartCollection.cs
- VisualBasicImportReference.cs
- HiddenFieldPageStatePersister.cs
- XmlSchemaInfo.cs
- EntityContainerEntitySetDefiningQuery.cs
- DataGridViewCellFormattingEventArgs.cs
- GraphicsPath.cs
- TileBrush.cs
- SqlWebEventProvider.cs
- unsafenativemethodstextservices.cs
- sqlstateclientmanager.cs
- PersistenceTypeAttribute.cs