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
- ProviderSettings.cs
- RayMeshGeometry3DHitTestResult.cs
- UnhandledExceptionEventArgs.cs
- QuaternionAnimationBase.cs
- VariantWrapper.cs
- NullRuntimeConfig.cs
- ToolStrip.cs
- ClientSettings.cs
- HttpBrowserCapabilitiesWrapper.cs
- SqlError.cs
- MessageBox.cs
- PostBackTrigger.cs
- Wizard.cs
- Variant.cs
- ConfigurationManager.cs
- PointHitTestParameters.cs
- LocalizabilityAttribute.cs
- TrackBar.cs
- WindowsSlider.cs
- LineBreakRecord.cs
- smtppermission.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ValueSerializer.cs
- HtmlElementEventArgs.cs
- SecurityUniqueId.cs
- OdbcError.cs
- TogglePattern.cs
- ToolStripItemBehavior.cs
- SignatureDescription.cs
- SQLMembershipProvider.cs
- GridViewRowCollection.cs
- UTF32Encoding.cs
- WebEventCodes.cs
- Size3D.cs
- TraceSection.cs
- StreamHelper.cs
- AddInPipelineAttributes.cs
- CellNormalizer.cs
- StorageAssociationSetMapping.cs
- DBPropSet.cs
- MappingException.cs
- ComponentSerializationService.cs
- UserControlDesigner.cs
- BuiltInExpr.cs
- WebBaseEventKeyComparer.cs
- TreeView.cs
- OutOfProcStateClientManager.cs
- BindingOperations.cs
- BuildManager.cs
- Trigger.cs
- ResponseBodyWriter.cs
- TemplateLookupAction.cs
- ExpandCollapseProviderWrapper.cs
- UInt64Storage.cs
- ScriptResourceAttribute.cs
- ProgressiveCrcCalculatingStream.cs
- TableCell.cs
- UniqueIdentifierService.cs
- HtmlInputButton.cs
- WeakReadOnlyCollection.cs
- WebBrowserNavigatingEventHandler.cs
- SqlProvider.cs
- VectorAnimationBase.cs
- PaginationProgressEventArgs.cs
- FromReply.cs
- WebPartCatalogAddVerb.cs
- BuildProviderCollection.cs
- DataGridViewRowConverter.cs
- HttpRequest.cs
- ImageClickEventArgs.cs
- HtmlPhoneCallAdapter.cs
- FamilyTypeface.cs
- ClickablePoint.cs
- HijriCalendar.cs
- ZipFileInfoCollection.cs
- safex509handles.cs
- TextMessageEncoder.cs
- ZipPackagePart.cs
- PostBackOptions.cs
- DataContractSet.cs
- WindowsFormsEditorServiceHelper.cs
- Crypto.cs
- XmlSchemaValidator.cs
- RepeatBehaviorConverter.cs
- BoundPropertyEntry.cs
- FrameSecurityDescriptor.cs
- ArraySortHelper.cs
- sqlstateclientmanager.cs
- ThreadStaticAttribute.cs
- Validator.cs
- DirectionalLight.cs
- AnonymousIdentificationSection.cs
- BCryptSafeHandles.cs
- _AuthenticationState.cs
- XPathPatternBuilder.cs
- CheckBoxList.cs
- PropertyItemInternal.cs
- SortableBindingList.cs
- ConnectionsZoneDesigner.cs
- PermissionToken.cs