Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeThreadHandle.cs / 1 / SafeThreadHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeThreadHandle ** ** ** A wrapper for a thread handle ** ** ===========================================================*/ using System; using System.Security; using System.Diagnostics; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; using System.Runtime.ConstrainedExecution; namespace Microsoft.Win32.SafeHandles { [SuppressUnmanagedCodeSecurityAttribute] internal sealed class SafeThreadHandle : SafeHandleZeroOrMinusOneIsInvalid { internal SafeThreadHandle() : base(true) { } internal void InitialSetHandle(IntPtr h){ Debug.Assert(base.IsInvalid, "Safe handle should only be set once"); base.SetHandle(h); } override protected bool ReleaseHandle() { return SafeNativeMethods.CloseHandle(handle); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeThreadHandle ** ** ** A wrapper for a thread handle ** ** ===========================================================*/ using System; using System.Security; using System.Diagnostics; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; using System.Runtime.ConstrainedExecution; namespace Microsoft.Win32.SafeHandles { [SuppressUnmanagedCodeSecurityAttribute] internal sealed class SafeThreadHandle : SafeHandleZeroOrMinusOneIsInvalid { internal SafeThreadHandle() : base(true) { } internal void InitialSetHandle(IntPtr h){ Debug.Assert(base.IsInvalid, "Safe handle should only be set once"); base.SetHandle(h); } override protected bool ReleaseHandle() { return SafeNativeMethods.CloseHandle(handle); } } } // 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
- ObjectPropertyMapping.cs
- PositiveTimeSpanValidator.cs
- XmlLoader.cs
- SqlDataSourceFilteringEventArgs.cs
- PersonalizationState.cs
- HelpExampleGenerator.cs
- TemplateContent.cs
- _NegotiateClient.cs
- Sql8ConformanceChecker.cs
- ImageSourceConverter.cs
- SuppressIldasmAttribute.cs
- ReturnEventArgs.cs
- BlockCollection.cs
- ProtocolState.cs
- PointLight.cs
- MatcherBuilder.cs
- ControlIdConverter.cs
- CngAlgorithm.cs
- XhtmlBasicPhoneCallAdapter.cs
- Guid.cs
- IfAction.cs
- FilterQuery.cs
- DataTableReader.cs
- DocumentEventArgs.cs
- EnumDataContract.cs
- HandleValueEditor.cs
- UpdateManifestForBrowserApplication.cs
- PersonalizationDictionary.cs
- SqlComparer.cs
- EncryptedHeader.cs
- CodeChecksumPragma.cs
- CultureTableRecord.cs
- PlaceHolder.cs
- SimpleBitVector32.cs
- AnyAllSearchOperator.cs
- FacetValues.cs
- BitmapMetadata.cs
- ControlType.cs
- WeakReadOnlyCollection.cs
- SamlSubject.cs
- CodeDOMProvider.cs
- InfoCardCryptoHelper.cs
- MembershipValidatePasswordEventArgs.cs
- ContextProperty.cs
- JsonWriter.cs
- ResourceExpression.cs
- ListenerConstants.cs
- ApplicationSecurityManager.cs
- VectorConverter.cs
- ColumnHeader.cs
- Parameter.cs
- JsonWriterDelegator.cs
- ConvertEvent.cs
- TokenBasedSet.cs
- ExclusiveHandleList.cs
- UnsafeNativeMethodsPenimc.cs
- DataBoundControl.cs
- DataObjectEventArgs.cs
- PerformanceCounterPermissionEntryCollection.cs
- dbenumerator.cs
- TreeBuilder.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- ReaderContextStackData.cs
- Queue.cs
- EmptyTextWriter.cs
- StrokeCollectionDefaultValueFactory.cs
- Pair.cs
- HtmlHead.cs
- RootDesignerSerializerAttribute.cs
- WSDualHttpSecurityMode.cs
- ExtendedPropertyDescriptor.cs
- RuntimeWrappedException.cs
- DefaultBinder.cs
- EntityDataSourceQueryBuilder.cs
- SubqueryRules.cs
- GAC.cs
- Vector.cs
- MsmqAuthenticationMode.cs
- ProgressBarAutomationPeer.cs
- SerializationEventsCache.cs
- HybridCollection.cs
- ResizeGrip.cs
- DataRowChangeEvent.cs
- TickBar.cs
- GridViewColumnHeader.cs
- RelAssertionDirectKeyIdentifierClause.cs
- EventHandlerService.cs
- XmlDocument.cs
- ComplexType.cs
- AvtEvent.cs
- EntityDataSourceColumn.cs
- InkCanvasAutomationPeer.cs
- Crypto.cs
- QueueAccessMode.cs
- HttpContextWrapper.cs
- COAUTHINFO.cs
- ApplicationProxyInternal.cs
- Page.cs
- SmiEventSink_Default.cs
- DesignerVerbCollection.cs