Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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);
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Item.cs
- HMAC.cs
- AdapterUtil.cs
- CombinedGeometry.cs
- SchemaMerger.cs
- safelinkcollection.cs
- BrushMappingModeValidation.cs
- RenderingBiasValidation.cs
- ToolStripScrollButton.cs
- DataServiceRequestOfT.cs
- ColorConvertedBitmapExtension.cs
- InputMethodStateTypeInfo.cs
- AnyReturnReader.cs
- VirtualDirectoryMappingCollection.cs
- ArithmeticException.cs
- PageBreakRecord.cs
- XmlQueryOutput.cs
- SharedStatics.cs
- UInt64.cs
- CodeStatement.cs
- PathGradientBrush.cs
- ReadOnlyNameValueCollection.cs
- EdmRelationshipRoleAttribute.cs
- VarInfo.cs
- LogicalTreeHelper.cs
- Menu.cs
- PerspectiveCamera.cs
- TypeElementCollection.cs
- DataServiceQuery.cs
- ErrorWebPart.cs
- DataListCommandEventArgs.cs
- CqlQuery.cs
- UITypeEditor.cs
- ToolbarAUtomationPeer.cs
- ContentPresenter.cs
- TextWriter.cs
- InvokeMethodActivityDesigner.cs
- ToolBar.cs
- KernelTypeValidation.cs
- RequestNavigateEventArgs.cs
- TraceLevelHelper.cs
- FocusChangedEventArgs.cs
- DebugHandleTracker.cs
- Object.cs
- NeutralResourcesLanguageAttribute.cs
- ColorConverter.cs
- DataGridGeneralPage.cs
- ProxyHelper.cs
- WindowsRegion.cs
- TextPointer.cs
- WebPartVerbsEventArgs.cs
- XNodeSchemaApplier.cs
- AsyncResult.cs
- DataGridViewColumn.cs
- IntegerValidatorAttribute.cs
- AppDomainManager.cs
- NamespaceEmitter.cs
- SystemColors.cs
- VersionedStream.cs
- EnumCodeDomSerializer.cs
- ManagedFilter.cs
- input.cs
- VBCodeProvider.cs
- AutomationPatternInfo.cs
- Timeline.cs
- RowSpanVector.cs
- RefreshPropertiesAttribute.cs
- ElementNotEnabledException.cs
- HyperLink.cs
- ModifiableIteratorCollection.cs
- NameTable.cs
- StorageInfo.cs
- ObfuscationAttribute.cs
- TrackingSection.cs
- Viewport3DVisual.cs
- TextView.cs
- ToolStripDropDownClosedEventArgs.cs
- ModelPropertyDescriptor.cs
- CompoundFileDeflateTransform.cs
- DataGridParentRows.cs
- unsafenativemethodstextservices.cs
- ConfigurationException.cs
- ProcessInputEventArgs.cs
- BitmapFrame.cs
- Vars.cs
- ListViewSortEventArgs.cs
- TypeDependencyAttribute.cs
- ComboBox.cs
- CommandHelpers.cs
- ExpressionBuilder.cs
- ListParaClient.cs
- FloaterParaClient.cs
- ProfileSection.cs
- HeaderElement.cs
- EDesignUtil.cs
- TreeNodeBindingCollection.cs
- StandardToolWindows.cs
- HttpResponseBase.cs
- SpellerHighlightLayer.cs
- X509ClientCertificateAuthenticationElement.cs