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
- Constant.cs
- IntersectQueryOperator.cs
- NetworkInformationPermission.cs
- SingleConverter.cs
- IdentitySection.cs
- RegularExpressionValidator.cs
- SerializationInfo.cs
- NestPullup.cs
- EventRoute.cs
- X509SubjectKeyIdentifierClause.cs
- WizardStepBase.cs
- DetailsView.cs
- FormsAuthenticationTicket.cs
- WhileDesigner.cs
- BrowserDefinition.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- LoginName.cs
- UIElement.cs
- SqlUtils.cs
- DiscoveryRequestHandler.cs
- FaultImportOptions.cs
- FormsIdentity.cs
- CallbackValidatorAttribute.cs
- AccessText.cs
- IncrementalCompileAnalyzer.cs
- RSAOAEPKeyExchangeFormatter.cs
- XPathAncestorIterator.cs
- KeyPressEvent.cs
- MachineSettingsSection.cs
- ListSourceHelper.cs
- Serializer.cs
- BevelBitmapEffect.cs
- AttachedPropertyBrowsableWhenAttributePresentAttribute.cs
- PersonalizationAdministration.cs
- BuildProvider.cs
- COSERVERINFO.cs
- CommandEventArgs.cs
- ResourceProperty.cs
- Utils.cs
- Enlistment.cs
- PropertyCondition.cs
- ListCollectionView.cs
- OperationAbortedException.cs
- ErrorHandler.cs
- GenericIdentity.cs
- ServiceProviders.cs
- TranslateTransform3D.cs
- LinkTarget.cs
- TabControl.cs
- UIElement3D.cs
- ExtensionQuery.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- Item.cs
- SoapAttributes.cs
- PropertyPath.cs
- SerializationInfo.cs
- ToolStripRenderer.cs
- FrameworkElement.cs
- BinHexEncoder.cs
- DropDownButton.cs
- StringSorter.cs
- NativeMethods.cs
- XmlUnspecifiedAttribute.cs
- RegexFCD.cs
- ConnectionStringsExpressionBuilder.cs
- HMAC.cs
- XPathArrayIterator.cs
- URI.cs
- XamlSerializerUtil.cs
- QueryContinueDragEventArgs.cs
- MetadataItemCollectionFactory.cs
- TextView.cs
- SignedPkcs7.cs
- StringExpressionSet.cs
- OuterGlowBitmapEffect.cs
- Span.cs
- FormViewRow.cs
- RIPEMD160.cs
- Padding.cs
- WebHttpSecurityElement.cs
- XmlComment.cs
- EncoderNLS.cs
- HttpGetProtocolReflector.cs
- ShapingEngine.cs
- SoapAttributeAttribute.cs
- TextEditorParagraphs.cs
- ReflectPropertyDescriptor.cs
- PasswordTextNavigator.cs
- unitconverter.cs
- Misc.cs
- ProxyBuilder.cs
- Bitmap.cs
- WebColorConverter.cs
- BinaryParser.cs
- NgenServicingAttributes.cs
- xmlfixedPageInfo.cs
- RegistryPermission.cs
- IDReferencePropertyAttribute.cs
- SecurityDescriptor.cs
- WebChannelFactory.cs