Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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
- Lazy.cs
- XmlSerializationReader.cs
- SoapIncludeAttribute.cs
- AccessText.cs
- ThreadExceptionEvent.cs
- ListDictionaryInternal.cs
- TraceFilter.cs
- RawTextInputReport.cs
- TextFormattingConverter.cs
- PathFigureCollectionValueSerializer.cs
- BitmapEncoder.cs
- CharAnimationUsingKeyFrames.cs
- ListView.cs
- Duration.cs
- ReadOnlyDataSource.cs
- MenuCommand.cs
- TraceXPathNavigator.cs
- RootBuilder.cs
- WebPartCancelEventArgs.cs
- GroupStyle.cs
- XhtmlBasicValidationSummaryAdapter.cs
- XmlDocumentFragment.cs
- FunctionQuery.cs
- GlobalAllocSafeHandle.cs
- IPEndPointCollection.cs
- MDIControlStrip.cs
- DbConnectionStringBuilder.cs
- UniqueEventHelper.cs
- DeclarationUpdate.cs
- ToolStripSeparatorRenderEventArgs.cs
- AccessKeyManager.cs
- ApplicationGesture.cs
- ExpressionConverter.cs
- ConfigsHelper.cs
- TextEditorParagraphs.cs
- Inline.cs
- unsafenativemethodstextservices.cs
- Vector3DConverter.cs
- AutoCompleteStringCollection.cs
- SendingRequestEventArgs.cs
- IsolatedStorageFile.cs
- SqlFunctionAttribute.cs
- SQLMembershipProvider.cs
- UnionCodeGroup.cs
- XmlUtf8RawTextWriter.cs
- HwndSubclass.cs
- ToolStripStatusLabel.cs
- XmlNamespaceMappingCollection.cs
- FullTextBreakpoint.cs
- TextBoxAutomationPeer.cs
- CookieProtection.cs
- ListDataHelper.cs
- PointAnimationUsingKeyFrames.cs
- WebPartCancelEventArgs.cs
- DateTimeOffsetAdapter.cs
- CounterSetInstanceCounterDataSet.cs
- WebContentFormatHelper.cs
- ToolStripTextBox.cs
- VectorAnimationUsingKeyFrames.cs
- GroupPartitionExpr.cs
- DisplayInformation.cs
- _SslSessionsCache.cs
- NegationPusher.cs
- PointCollectionConverter.cs
- CompositeControl.cs
- xsdvalidator.cs
- StandardOleMarshalObject.cs
- InstanceView.cs
- XmlNode.cs
- RevocationPoint.cs
- Int64KeyFrameCollection.cs
- COM2ExtendedUITypeEditor.cs
- InvalidMessageContractException.cs
- FormClosedEvent.cs
- CommandConverter.cs
- HttpRuntime.cs
- AccessViolationException.cs
- Geometry3D.cs
- SerializationObjectManager.cs
- DriveInfo.cs
- XmlHierarchicalDataSourceView.cs
- DataView.cs
- PropertyInformationCollection.cs
- TdsParserHelperClasses.cs
- EventData.cs
- ContextMenuAutomationPeer.cs
- OuterGlowBitmapEffect.cs
- OrderByBuilder.cs
- SyndicationDeserializer.cs
- RenderCapability.cs
- BrushValueSerializer.cs
- ItemCollection.cs
- ExpressionConverter.cs
- _LocalDataStoreMgr.cs
- ManagementOperationWatcher.cs
- ClientScriptManagerWrapper.cs
- CompatibleComparer.cs
- CommandField.cs
- ColumnWidthChangingEvent.cs
- Vector3DValueSerializer.cs