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
- _SecureChannel.cs
- SqlDataAdapter.cs
- GeometryDrawing.cs
- Sql8ConformanceChecker.cs
- TextSchema.cs
- WebPartUtil.cs
- SqlDataSource.cs
- AdPostCacheSubstitution.cs
- CodeAccessSecurityEngine.cs
- ListViewDeleteEventArgs.cs
- PrimaryKeyTypeConverter.cs
- StickyNoteContentControl.cs
- SqlProfileProvider.cs
- SoapAttributes.cs
- Subset.cs
- PagerSettings.cs
- EntityDataSourceDesigner.cs
- XmlSchemaDatatype.cs
- SimpleWorkerRequest.cs
- DataReaderContainer.cs
- TimeoutException.cs
- GetLedgerEntryForRecipientRequest.cs
- MasterPageParser.cs
- ExpressionEditorAttribute.cs
- IndicFontClient.cs
- SqlOuterApplyReducer.cs
- Transform3D.cs
- Ticks.cs
- ConstraintConverter.cs
- MatrixTransform3D.cs
- StreamResourceInfo.cs
- NumericExpr.cs
- ComPlusServiceHost.cs
- WindowsScrollBar.cs
- DataGridViewRowsRemovedEventArgs.cs
- RegionInfo.cs
- DataControlFieldCollection.cs
- LoginName.cs
- SimpleHandlerBuildProvider.cs
- WebPartActionVerb.cs
- NativeActivityContext.cs
- ImmutableObjectAttribute.cs
- streamingZipPartStream.cs
- RouteItem.cs
- WebPartCloseVerb.cs
- InvokeMethodActivity.cs
- ToolBarPanel.cs
- RoleManagerSection.cs
- NativeMethods.cs
- TemplatedMailWebEventProvider.cs
- InfoCardService.cs
- NativeMethods.cs
- PTUtility.cs
- CommandBinding.cs
- CallSiteOps.cs
- StyleSheetDesigner.cs
- X509UI.cs
- VariableQuery.cs
- MetafileHeader.cs
- ProcessHostFactoryHelper.cs
- Rect.cs
- XmlSchemaSearchPattern.cs
- SubpageParagraph.cs
- DataGridCellInfo.cs
- ConnectionsZone.cs
- StylusPointCollection.cs
- FontDriver.cs
- RIPEMD160.cs
- CommonRemoteMemoryBlock.cs
- ContactManager.cs
- StylusButtonEventArgs.cs
- ProfileProvider.cs
- AnyReturnReader.cs
- DateTimeUtil.cs
- SoapInteropTypes.cs
- BaseDataBoundControl.cs
- TextDpi.cs
- CultureInfoConverter.cs
- EnumConverter.cs
- Point3DCollectionConverter.cs
- WinFormsComponentEditor.cs
- TemplatePropertyEntry.cs
- ReadOnlyCollectionBase.cs
- BaseComponentEditor.cs
- DrawingServices.cs
- IgnoreFileBuildProvider.cs
- RangeValidator.cs
- AnnotationMap.cs
- XsltArgumentList.cs
- TransactionFlowBindingElementImporter.cs
- SmtpDigestAuthenticationModule.cs
- ForwardPositionQuery.cs
- HandlerBase.cs
- AuthenticationModuleElement.cs
- GiveFeedbackEventArgs.cs
- Identifier.cs
- GridViewDeleteEventArgs.cs
- ChangeNode.cs
- WebSysDisplayNameAttribute.cs
- SqlLiftIndependentRowExpressions.cs