Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / Microsoft / Win32 / SafeHandles / SafePEFileHandle.cs / 1 / SafePEFileHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafePEFileHandle ** ** ** A wrapper for pefile pointers ** ** ===========================================================*/ using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using Microsoft.Win32; namespace Microsoft.Win32.SafeHandles { internal sealed class SafePEFileHandle: SafeHandleZeroOrMinusOneIsInvalid { // 0 is an Invalid Handle private SafePEFileHandle(IntPtr handle) : base (true) { SetHandle(handle); } internal static SafePEFileHandle InvalidHandle { get { return new SafePEFileHandle(IntPtr.Zero); } } override protected bool ReleaseHandle() { #if !FEATURE_PAL System.Security.Policy.Hash._ReleasePEFile(handle); #endif return true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafePEFileHandle ** ** ** A wrapper for pefile pointers ** ** ===========================================================*/ using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using Microsoft.Win32; namespace Microsoft.Win32.SafeHandles { internal sealed class SafePEFileHandle: SafeHandleZeroOrMinusOneIsInvalid { // 0 is an Invalid Handle private SafePEFileHandle(IntPtr handle) : base (true) { SetHandle(handle); } internal static SafePEFileHandle InvalidHandle { get { return new SafePEFileHandle(IntPtr.Zero); } } override protected bool ReleaseHandle() { #if !FEATURE_PAL System.Security.Policy.Hash._ReleasePEFile(handle); #endif return true; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CurrentTimeZone.cs
- ForceCopyBuildProvider.cs
- RepeaterCommandEventArgs.cs
- MailWebEventProvider.cs
- ConditionBrowserDialog.cs
- VisemeEventArgs.cs
- DBCommand.cs
- WindowsGraphics2.cs
- RuleProcessor.cs
- DataSourceCollectionBase.cs
- TcpHostedTransportConfiguration.cs
- Light.cs
- WebSysDisplayNameAttribute.cs
- NavigateEvent.cs
- UpdateProgress.cs
- AdRotatorDesigner.cs
- EFColumnProvider.cs
- TrackingProfileCache.cs
- NetworkInterface.cs
- Label.cs
- FrameworkElementAutomationPeer.cs
- DeflateStream.cs
- PreloadedPackages.cs
- FontDriver.cs
- SafeNativeMethods.cs
- PropertyToken.cs
- ProtectedConfigurationSection.cs
- IdentifierCreationService.cs
- XPathScanner.cs
- DataGridToolTip.cs
- ProcessHostFactoryHelper.cs
- Control.cs
- TextEndOfSegment.cs
- _ListenerAsyncResult.cs
- UIElementAutomationPeer.cs
- KnownTypes.cs
- RuleCache.cs
- StaticSiteMapProvider.cs
- LinkGrep.cs
- GenerateScriptTypeAttribute.cs
- FlowSwitch.cs
- SignedXml.cs
- MsmqDiagnostics.cs
- NullRuntimeConfig.cs
- CompatibleComparer.cs
- SqlDataSourceCommandEventArgs.cs
- UniqueIdentifierService.cs
- PreProcessInputEventArgs.cs
- EventToken.cs
- ButtonColumn.cs
- TextBoxRenderer.cs
- HttpListenerContext.cs
- MediaPlayerState.cs
- DetailsViewPagerRow.cs
- Size3DConverter.cs
- XmlSchemaValidationException.cs
- IImplicitResourceProvider.cs
- MetadataUtilsSmi.cs
- TemplateNameScope.cs
- SoapIgnoreAttribute.cs
- TripleDESCryptoServiceProvider.cs
- HScrollProperties.cs
- IsolatedStorageFile.cs
- ToolStripDropDownItem.cs
- SmiContextFactory.cs
- Vector3DConverter.cs
- WebChannelFactory.cs
- ColorConvertedBitmap.cs
- SafeEventLogReadHandle.cs
- RootNamespaceAttribute.cs
- SelectionItemProviderWrapper.cs
- ProxyWebPartConnectionCollection.cs
- KoreanCalendar.cs
- ResourcePool.cs
- NamespaceInfo.cs
- FacetDescriptionElement.cs
- TemplateGroupCollection.cs
- ToolStripLabel.cs
- BitmapEffectDrawing.cs
- BadImageFormatException.cs
- SQLDecimal.cs
- LineInfo.cs
- _CookieModule.cs
- ControlBuilder.cs
- DefaultTraceListener.cs
- ProfessionalColors.cs
- log.cs
- initElementDictionary.cs
- EmptyEnumerator.cs
- RowTypeElement.cs
- Triplet.cs
- XmlAttribute.cs
- Errors.cs
- ToolStripComboBox.cs
- ZipIOCentralDirectoryBlock.cs
- TableParaClient.cs
- Baml2006ReaderFrame.cs
- ThreadNeutralSemaphore.cs
- Int32CollectionConverter.cs
- SynchronizingStream.cs