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
- PresentationSource.cs
- XmlSchemaSimpleTypeRestriction.cs
- CSharpCodeProvider.cs
- EditorPart.cs
- X509ChainPolicy.cs
- LoginUtil.cs
- ExtendedPropertyDescriptor.cs
- ExpressionPrefixAttribute.cs
- SQLRoleProvider.cs
- ReaderWriterLock.cs
- PathStreamGeometryContext.cs
- GroupItem.cs
- WebPartCollection.cs
- DependencyObjectValidator.cs
- XmlConvert.cs
- ColorConverter.cs
- CodeNamespaceImportCollection.cs
- ReadOnlyDictionary.cs
- QueryAsyncResult.cs
- WindowsMenu.cs
- ButtonChrome.cs
- MetaDataInfo.cs
- SizeAnimationBase.cs
- OdbcInfoMessageEvent.cs
- AddingNewEventArgs.cs
- NativeMethods.cs
- Int32EqualityComparer.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- XmlBinaryReaderSession.cs
- contentDescriptor.cs
- DbProviderSpecificTypePropertyAttribute.cs
- ChannelManagerService.cs
- OdbcConnection.cs
- EventManager.cs
- DesignBindingConverter.cs
- TCEAdapterGenerator.cs
- SafeLocalMemHandle.cs
- XmlNamespaceMapping.cs
- EditBehavior.cs
- SimpleRecyclingCache.cs
- ActivitySurrogateSelector.cs
- ClockGroup.cs
- RequestCacheManager.cs
- RefreshEventArgs.cs
- CachedCompositeFamily.cs
- ComplexTypeEmitter.cs
- Trace.cs
- StyleCollection.cs
- ChineseLunisolarCalendar.cs
- Brush.cs
- AutoScrollHelper.cs
- XmlTextAttribute.cs
- Polygon.cs
- TransformPatternIdentifiers.cs
- IEnumerable.cs
- SqlParameter.cs
- PageThemeBuildProvider.cs
- WebException.cs
- MarginsConverter.cs
- EncodingNLS.cs
- DBSqlParserTableCollection.cs
- StreamMarshaler.cs
- LinkConverter.cs
- ProcessModelInfo.cs
- TextParagraphProperties.cs
- CorrelationManager.cs
- OracleDateTime.cs
- ReadOnlyAttribute.cs
- Converter.cs
- XdrBuilder.cs
- WindowsImpersonationContext.cs
- TrackingQuery.cs
- indexingfiltermarshaler.cs
- EntityDataSourceContextCreatedEventArgs.cs
- CacheSection.cs
- EntityModelBuildProvider.cs
- UseManagedPresentationElement.cs
- Int32Rect.cs
- RuntimeEnvironment.cs
- EntityDataSourceSelectingEventArgs.cs
- util.cs
- mil_commands.cs
- ExpressionPrinter.cs
- HwndSource.cs
- BoolLiteral.cs
- Stack.cs
- FontDriver.cs
- RuleRefElement.cs
- Solver.cs
- XmlObjectSerializer.cs
- XPathMessageFilterElementComparer.cs
- PenContext.cs
- ColumnHeaderConverter.cs
- ServiceNameElement.cs
- FamilyCollection.cs
- SoapIncludeAttribute.cs
- Expander.cs
- RenderCapability.cs
- RegexMatchCollection.cs
- TableColumnCollection.cs