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
- Stylesheet.cs
- DataMisalignedException.cs
- ISFClipboardData.cs
- Stack.cs
- FtpRequestCacheValidator.cs
- RenderData.cs
- SqlRetyper.cs
- NamespaceCollection.cs
- CompositeDataBoundControl.cs
- CodeTypeParameterCollection.cs
- HttpCapabilitiesBase.cs
- DefaultBindingPropertyAttribute.cs
- InheritanceContextHelper.cs
- PartialCachingAttribute.cs
- InheritanceContextHelper.cs
- EntryIndex.cs
- PointKeyFrameCollection.cs
- QilInvoke.cs
- NumberEdit.cs
- RawStylusInputCustomData.cs
- NumberEdit.cs
- PropertyFilterAttribute.cs
- newinstructionaction.cs
- WebResponse.cs
- Boolean.cs
- PeerContact.cs
- Span.cs
- ObjectDataSourceFilteringEventArgs.cs
- ChineseLunisolarCalendar.cs
- HighContrastHelper.cs
- DispatcherExceptionEventArgs.cs
- WebBrowser.cs
- WindowsFormsHost.cs
- TableLayoutCellPaintEventArgs.cs
- DeflateStream.cs
- OrderByBuilder.cs
- VerificationException.cs
- SortQuery.cs
- SqlCommand.cs
- WsiProfilesElementCollection.cs
- ConsumerConnectionPoint.cs
- ReadOnlyCollectionBase.cs
- VisualTarget.cs
- DataServiceBuildProvider.cs
- TransformProviderWrapper.cs
- QueuePathDialog.cs
- DataGridViewCellStyleConverter.cs
- DataGridPagerStyle.cs
- PropertyChangingEventArgs.cs
- GridViewRow.cs
- WindowsListBox.cs
- WindowsNonControl.cs
- ResourceDictionary.cs
- NotifyCollectionChangedEventArgs.cs
- ClientTargetSection.cs
- Resources.Designer.cs
- InstanceDataCollection.cs
- QueryableDataSource.cs
- _FtpDataStream.cs
- InlineObject.cs
- CallbackValidator.cs
- PrincipalPermission.cs
- XmlNavigatorStack.cs
- StickyNoteAnnotations.cs
- ListControlStringCollectionEditor.cs
- CriticalHandle.cs
- DesignerLoader.cs
- Currency.cs
- TextDpi.cs
- HashFinalRequest.cs
- DispatcherTimer.cs
- WebConfigurationManager.cs
- KnownBoxes.cs
- TextProperties.cs
- XmlTextReaderImpl.cs
- XmlLinkedNode.cs
- XmlElement.cs
- XsdDateTime.cs
- RSAPKCS1SignatureDeformatter.cs
- ParallelEnumerable.cs
- FontCollection.cs
- XmlArrayAttribute.cs
- NonPrimarySelectionGlyph.cs
- MappedMetaModel.cs
- UniqueSet.cs
- QueryOperator.cs
- ApplicationSecurityInfo.cs
- SecureStringHasher.cs
- StrongNameUtility.cs
- ClientTargetSection.cs
- Documentation.cs
- DataGridRowsPresenter.cs
- PartialCachingAttribute.cs
- WebFormDesignerActionService.cs
- UserCancellationException.cs
- DateTimeValueSerializer.cs
- PerfCounterSection.cs
- SqlDataSource.cs
- TemplateXamlParser.cs
- StreamInfo.cs