Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // 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
- XmlDataCollection.cs
- SafeCryptContextHandle.cs
- FtpRequestCacheValidator.cs
- Gdiplus.cs
- JsonObjectDataContract.cs
- OptionalColumn.cs
- DependencyPropertyDescriptor.cs
- HierarchicalDataSourceControl.cs
- SHA384.cs
- GridViewCommandEventArgs.cs
- TargetInvocationException.cs
- XmlEnumAttribute.cs
- DotAtomReader.cs
- EmptyEnumerable.cs
- Vector3DCollectionConverter.cs
- wgx_render.cs
- ServiceProviders.cs
- RuntimeHandles.cs
- MarkupCompilePass1.cs
- DecimalKeyFrameCollection.cs
- ChangeConflicts.cs
- Socket.cs
- PathFigure.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- ComponentRenameEvent.cs
- IndentedTextWriter.cs
- Missing.cs
- DoubleLinkList.cs
- XmlValidatingReader.cs
- TextBlockAutomationPeer.cs
- Events.cs
- XpsDocumentEvent.cs
- ZipFileInfo.cs
- ComboBox.cs
- XmlILOptimizerVisitor.cs
- Visual3D.cs
- BaseDataListActionList.cs
- StateItem.cs
- HttpModulesSection.cs
- LingerOption.cs
- XmlSchemaExternal.cs
- TreeViewImageIndexConverter.cs
- Maps.cs
- CodeIterationStatement.cs
- RestHandlerFactory.cs
- OleServicesContext.cs
- HuffModule.cs
- DataRecordInfo.cs
- webclient.cs
- DatatypeImplementation.cs
- SecurityKeyUsage.cs
- Location.cs
- XmlnsCompatibleWithAttribute.cs
- Comparer.cs
- SafeLibraryHandle.cs
- BindingMemberInfo.cs
- MarginCollapsingState.cs
- ProcessHostFactoryHelper.cs
- CroppedBitmap.cs
- Rijndael.cs
- SmtpReplyReader.cs
- DefinitionUpdate.cs
- NullableDoubleMinMaxAggregationOperator.cs
- TdsParameterSetter.cs
- EntitySetBase.cs
- wmiprovider.cs
- OpCopier.cs
- DataListItemCollection.cs
- SessionStateModule.cs
- CfgArc.cs
- DataGridViewColumn.cs
- WeakRefEnumerator.cs
- _RequestCacheProtocol.cs
- RoleManagerModule.cs
- LogicalTreeHelper.cs
- WebPartUtil.cs
- WebConfigurationHostFileChange.cs
- IntranetCredentialPolicy.cs
- CssStyleCollection.cs
- XmlSiteMapProvider.cs
- DataControlLinkButton.cs
- HttpModuleCollection.cs
- PackagePart.cs
- DataGridComponentEditor.cs
- SchemaComplexType.cs
- AsymmetricKeyExchangeFormatter.cs
- ReadContentAsBinaryHelper.cs
- Int64Animation.cs
- Error.cs
- DataGridViewImageColumn.cs
- RadioButton.cs
- ProfileParameter.cs
- StringFunctions.cs
- DataGridViewCellCollection.cs
- PrintDialog.cs
- ReturnType.cs
- FontCacheLogic.cs
- CompensatableTransactionScopeActivityDesigner.cs
- Thread.cs
- StylusLogic.cs