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
- ButtonFieldBase.cs
- SqlMethodCallConverter.cs
- UnmanagedMarshal.cs
- DataGridViewRowsAddedEventArgs.cs
- ErrorHandler.cs
- WindowsSlider.cs
- CryptoProvider.cs
- XamlFrame.cs
- RecipientInfo.cs
- WebHeaderCollection.cs
- X509PeerCertificateElement.cs
- ServiceHttpHandlerFactory.cs
- TemplateLookupAction.cs
- DataGridViewUtilities.cs
- AttributeParameterInfo.cs
- Win32MouseDevice.cs
- ScheduleChanges.cs
- DSASignatureFormatter.cs
- RenderDataDrawingContext.cs
- InheritablePropertyChangeInfo.cs
- AssociationEndMember.cs
- EmbossBitmapEffect.cs
- SystemWebSectionGroup.cs
- StreamWriter.cs
- ConfigXmlAttribute.cs
- HttpModuleActionCollection.cs
- AttachmentCollection.cs
- InputBindingCollection.cs
- CustomBindingElement.cs
- InvokePattern.cs
- OdbcException.cs
- SymbolDocumentGenerator.cs
- SourceCollection.cs
- ListViewDataItem.cs
- hwndwrapper.cs
- TableCellCollection.cs
- BitmapData.cs
- ModuleElement.cs
- TextBoxLine.cs
- DocumentPageViewAutomationPeer.cs
- SettingsBindableAttribute.cs
- ImpersonateTokenRef.cs
- XmlUnspecifiedAttribute.cs
- GeneralTransform.cs
- GridViewCancelEditEventArgs.cs
- DiscoveryReferences.cs
- PropertyValueChangedEvent.cs
- HostProtectionPermission.cs
- _NegoStream.cs
- GroupDescription.cs
- BitVector32.cs
- HttpClientCertificate.cs
- ImageMapEventArgs.cs
- ObjectListField.cs
- ModulesEntry.cs
- TempEnvironment.cs
- StagingAreaInputItem.cs
- WindowsStatusBar.cs
- ActivityStatusChangeEventArgs.cs
- StringAnimationBase.cs
- TableHeaderCell.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- AnnotationObservableCollection.cs
- SortableBindingList.cs
- PageCatalogPart.cs
- InvalidComObjectException.cs
- DynamicAttribute.cs
- JpegBitmapDecoder.cs
- RepeaterItemEventArgs.cs
- JapaneseLunisolarCalendar.cs
- ListCollectionView.cs
- DbExpressionRules.cs
- TypeLibConverter.cs
- UnmanagedMemoryStreamWrapper.cs
- LineBreakRecord.cs
- odbcmetadatafactory.cs
- InputBinder.cs
- ParallelEnumerableWrapper.cs
- XmlSortKeyAccumulator.cs
- PropertyInfoSet.cs
- WaitForChangedResult.cs
- DeferredReference.cs
- DbDeleteCommandTree.cs
- XmlSchemaAttributeGroupRef.cs
- TextSegment.cs
- Module.cs
- TableColumn.cs
- Grid.cs
- DeploymentSection.cs
- TypeCollectionDesigner.xaml.cs
- WebProxyScriptElement.cs
- QilChoice.cs
- AnnotationAdorner.cs
- DefaultShape.cs
- DataGridViewSelectedRowCollection.cs
- AuthenticationModuleElementCollection.cs
- PathData.cs
- FontFamilyIdentifier.cs
- FieldTemplateUserControl.cs
- COSERVERINFO.cs