Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- RtfControlWordInfo.cs
- TransactionContextValidator.cs
- MergablePropertyAttribute.cs
- QueryOutputWriter.cs
- HtmlAnchor.cs
- DataGridView.cs
- SystemIPInterfaceProperties.cs
- Trace.cs
- TypedReference.cs
- ConfigXmlText.cs
- Trace.cs
- RotateTransform.cs
- DataKey.cs
- ButtonBaseAutomationPeer.cs
- DataError.cs
- SubclassTypeValidatorAttribute.cs
- PreservationFileReader.cs
- TextBoxDesigner.cs
- ListBoxDesigner.cs
- WrapperSecurityCommunicationObject.cs
- SizeAnimationUsingKeyFrames.cs
- Part.cs
- DataGridViewRowHeaderCell.cs
- XmlQueryStaticData.cs
- Region.cs
- ProfileProvider.cs
- VisualStateChangedEventArgs.cs
- ExpressionVisitor.cs
- CollectionViewGroupInternal.cs
- InkCollectionBehavior.cs
- DES.cs
- InstalledFontCollection.cs
- SocketManager.cs
- ActivityCodeGenerator.cs
- BaseComponentEditor.cs
- ListenerHandler.cs
- TraceSource.cs
- WindowProviderWrapper.cs
- cookiecollection.cs
- RectangleConverter.cs
- RuntimeArgumentHandle.cs
- Point3DAnimationUsingKeyFrames.cs
- TimeoutValidationAttribute.cs
- HealthMonitoringSectionHelper.cs
- DataGridItemEventArgs.cs
- RenderTargetBitmap.cs
- PropertyIDSet.cs
- ComboBoxItem.cs
- DataServiceEntityAttribute.cs
- QueryableDataSourceHelper.cs
- EnumerableRowCollection.cs
- XmlObjectSerializerReadContext.cs
- EventLogEntry.cs
- EventWaitHandle.cs
- DataGridViewComboBoxColumn.cs
- newitemfactory.cs
- SymbolDocumentGenerator.cs
- ParallelSeparator.xaml.cs
- RenderOptions.cs
- TextBoxView.cs
- InternalRelationshipCollection.cs
- BaseContextMenu.cs
- FixedTextBuilder.cs
- ErrorHandler.cs
- basenumberconverter.cs
- GlyphRun.cs
- BitStream.cs
- BitmapVisualManager.cs
- _NetRes.cs
- CreatingCookieEventArgs.cs
- CqlErrorHelper.cs
- SqlCharStream.cs
- StateItem.cs
- X509ScopedServiceCertificateElement.cs
- OleDbConnectionFactory.cs
- DeploymentExceptionMapper.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- ScriptManagerProxy.cs
- PageAsyncTaskManager.cs
- VersionedStreamOwner.cs
- XmlSchemaSimpleTypeList.cs
- BlockUIContainer.cs
- TextTabProperties.cs
- NumberFunctions.cs
- DiscreteKeyFrames.cs
- PageClientProxyGenerator.cs
- XmlSecureResolver.cs
- DataGridTableCollection.cs
- DataGridViewRowEventArgs.cs
- XmlSchemaType.cs
- SignedXml.cs
- EndEvent.cs
- DataSourceListEditor.cs
- SafePEFileHandle.cs
- NotFiniteNumberException.cs
- TreeViewImageKeyConverter.cs
- DataGridView.cs
- CheckBoxBaseAdapter.cs
- CryptoApi.cs
- OverloadGroupAttribute.cs