Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeThreadHandle.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AspCompat.cs
- HttpHandlerActionCollection.cs
- GridViewAutoFormat.cs
- EnumerableRowCollection.cs
- FixedBufferAttribute.cs
- WindowsFormsHostAutomationPeer.cs
- SubMenuStyle.cs
- FormsAuthenticationUser.cs
- WrappedIUnknown.cs
- ResourceDescriptionAttribute.cs
- Accessible.cs
- MemberAccessException.cs
- FontClient.cs
- PolygonHotSpot.cs
- Section.cs
- Debug.cs
- AuthorizationRuleCollection.cs
- XpsS0ValidatingLoader.cs
- XmlWrappingReader.cs
- Debug.cs
- DeadCharTextComposition.cs
- FormattedText.cs
- DocumentViewer.cs
- RoutedCommand.cs
- CannotUnloadAppDomainException.cs
- ResourceProviderFactory.cs
- ValueUtilsSmi.cs
- JsonObjectDataContract.cs
- XmlParserContext.cs
- HTMLTagNameToTypeMapper.cs
- PropertyPathWorker.cs
- GroupQuery.cs
- HostProtectionPermission.cs
- FileDialog_Vista_Interop.cs
- Pkcs9Attribute.cs
- InvokeGenerator.cs
- CodePropertyReferenceExpression.cs
- RenderOptions.cs
- NameTable.cs
- SettingsPropertyValueCollection.cs
- Int16Animation.cs
- XmlDomTextWriter.cs
- HyperLinkField.cs
- HtmlTitle.cs
- NullableLongSumAggregationOperator.cs
- ContentType.cs
- TypeExtension.cs
- CodeCastExpression.cs
- HttpProcessUtility.cs
- FontFamilyValueSerializer.cs
- DatagramAdapter.cs
- XmlSiteMapProvider.cs
- EncryptedPackage.cs
- securitycriticaldataformultiplegetandset.cs
- GeometryHitTestResult.cs
- XmlSchemaChoice.cs
- MetadataSerializer.cs
- ManagementOptions.cs
- BaseAppDomainProtocolHandler.cs
- DSGeneratorProblem.cs
- MetadataItemSerializer.cs
- ListBox.cs
- RequestSecurityTokenSerializer.cs
- ReferenceTypeElement.cs
- OLEDB_Enum.cs
- SpinLock.cs
- UnknownBitmapDecoder.cs
- ActiveXHelper.cs
- SchemaContext.cs
- IdnMapping.cs
- RankException.cs
- DragEventArgs.cs
- TargetFrameworkAttribute.cs
- WinInet.cs
- Brushes.cs
- RemotingException.cs
- NavigationEventArgs.cs
- PkcsMisc.cs
- RequiredAttributeAttribute.cs
- EventSourceCreationData.cs
- CaseCqlBlock.cs
- TopClause.cs
- ContextMenu.cs
- UIElementPropertyUndoUnit.cs
- XmlTextReaderImplHelpers.cs
- ScriptingScriptResourceHandlerSection.cs
- JournalEntryStack.cs
- StrokeRenderer.cs
- ContainerUtilities.cs
- SetIterators.cs
- TreeBuilderBamlTranslator.cs
- DataService.cs
- XmlSchemaInferenceException.cs
- Binding.cs
- SoapCodeExporter.cs
- VoiceInfo.cs
- DataGridViewCheckBoxCell.cs
- sitestring.cs
- CustomTrackingRecord.cs
- SharedDp.cs