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
- LinearGradientBrush.cs
- BitmapDecoder.cs
- ViewBox.cs
- Binding.cs
- HighlightComponent.cs
- DockingAttribute.cs
- ImageIndexEditor.cs
- XmlSecureResolver.cs
- AddInIpcChannel.cs
- WebPartCollection.cs
- TextDecoration.cs
- DataServiceHostFactory.cs
- DesignerCategoryAttribute.cs
- CollectionsUtil.cs
- HttpBrowserCapabilitiesBase.cs
- ZeroOpNode.cs
- WeakEventManager.cs
- SingleObjectCollection.cs
- FlowDocumentReader.cs
- LinkClickEvent.cs
- PlainXmlWriter.cs
- ErrorFormatterPage.cs
- WebSysDefaultValueAttribute.cs
- ReadWriteSpinLock.cs
- XamlPoint3DCollectionSerializer.cs
- TableCell.cs
- SessionState.cs
- ImportFileRequest.cs
- RegistryConfigurationProvider.cs
- OleDbErrorCollection.cs
- TextShapeableCharacters.cs
- Transform.cs
- SoapCodeExporter.cs
- StrongNamePublicKeyBlob.cs
- GiveFeedbackEvent.cs
- ParentUndoUnit.cs
- FileDialogPermission.cs
- StyleSheet.cs
- NavigationCommands.cs
- EventData.cs
- XsltArgumentList.cs
- ConstraintEnumerator.cs
- SqlTrackingQuery.cs
- EntityDataSourceContextDisposingEventArgs.cs
- NativeRecognizer.cs
- Array.cs
- DataGridColumnCollectionEditor.cs
- NetTcpBindingCollectionElement.cs
- ContextBase.cs
- PathStreamGeometryContext.cs
- SecurityChannelListener.cs
- RepeaterItem.cs
- TimeSpanSecondsConverter.cs
- HttpCapabilitiesEvaluator.cs
- LayoutManager.cs
- printdlgexmarshaler.cs
- Pair.cs
- PriorityBinding.cs
- EditorBrowsableAttribute.cs
- MILUtilities.cs
- MapPathBasedVirtualPathProvider.cs
- DataSetViewSchema.cs
- FunctionImportElement.cs
- ModuleElement.cs
- HttpCachePolicy.cs
- COM2Properties.cs
- LogEntryHeaderSerializer.cs
- DecoderExceptionFallback.cs
- Events.cs
- OracleEncoding.cs
- VectorAnimationUsingKeyFrames.cs
- ContractsBCL.cs
- InvocationExpression.cs
- WebPartMenuStyle.cs
- IgnoreFileBuildProvider.cs
- Errors.cs
- InvalidProgramException.cs
- EventWaitHandleSecurity.cs
- Fonts.cs
- CacheOutputQuery.cs
- PropertyDescriptorCollection.cs
- XmlNodeReader.cs
- ComContractElement.cs
- XmlHierarchyData.cs
- SecurityElement.cs
- MsmqInputChannelListenerBase.cs
- ApplicationFileParser.cs
- TemplateControlParser.cs
- RedistVersionInfo.cs
- Debugger.cs
- BatchServiceHost.cs
- SharedStatics.cs
- StyleCollection.cs
- MultiPageTextView.cs
- DynamicDocumentPaginator.cs
- MD5CryptoServiceProvider.cs
- ConfigurationElementCollection.cs
- DataGridViewCellValidatingEventArgs.cs
- StrokeDescriptor.cs
- NGCSerializationManager.cs