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
- Rect3DConverter.cs
- XPathDocumentBuilder.cs
- XmlUtil.cs
- UniqueTransportManagerRegistration.cs
- SessionStateSection.cs
- Adorner.cs
- GCHandleCookieTable.cs
- UnsafeNativeMethods.cs
- CollectionViewGroup.cs
- EdmComplexTypeAttribute.cs
- LostFocusEventManager.cs
- DataGridRow.cs
- PerformanceCounterPermissionAttribute.cs
- HttpFileCollection.cs
- ImageAnimator.cs
- XmlChoiceIdentifierAttribute.cs
- Types.cs
- TextEditorSelection.cs
- GlobalProxySelection.cs
- ResourceDescriptionAttribute.cs
- MaskPropertyEditor.cs
- GenericIdentity.cs
- MiniParameterInfo.cs
- ButtonBaseAdapter.cs
- DataServiceQueryProvider.cs
- TextServicesManager.cs
- AssertUtility.cs
- SchemaEntity.cs
- BitmapEffectState.cs
- PolyBezierSegment.cs
- ObjectCloneHelper.cs
- CounterSet.cs
- TypeSource.cs
- ProcessModelInfo.cs
- SimpleModelProvider.cs
- OracleBFile.cs
- SemanticResultValue.cs
- DataGridViewDataConnection.cs
- Soap12ProtocolReflector.cs
- BuildProvider.cs
- ListSortDescription.cs
- ScrollBar.cs
- LicenseContext.cs
- Condition.cs
- RegexRunnerFactory.cs
- Point3DAnimation.cs
- SudsParser.cs
- WsatTransactionInfo.cs
- XPathNodeList.cs
- TimerElapsedEvenArgs.cs
- KeysConverter.cs
- XmlAttributeOverrides.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- ToolStripSplitStackLayout.cs
- RequestCacheManager.cs
- ArgumentNullException.cs
- StrongNameIdentityPermission.cs
- SqlErrorCollection.cs
- translator.cs
- Span.cs
- MetadataHelper.cs
- Evaluator.cs
- XPathMultyIterator.cs
- XComponentModel.cs
- BaseCodePageEncoding.cs
- TableMethodGenerator.cs
- DiagnosticSection.cs
- DynamicILGenerator.cs
- FixedSOMPageElement.cs
- ContextMarshalException.cs
- JsonWriter.cs
- Function.cs
- CodeParameterDeclarationExpression.cs
- TypeBuilderInstantiation.cs
- ThreadExceptionDialog.cs
- CompositeActivityValidator.cs
- _AuthenticationState.cs
- RelationshipEndMember.cs
- ServiceOperationHelpers.cs
- XmlSchema.cs
- DataServices.cs
- PeerHelpers.cs
- ExternalDataExchangeClient.cs
- UnaryNode.cs
- XmlnsDictionary.cs
- CodeGotoStatement.cs
- CompilerInfo.cs
- coordinatorfactory.cs
- XPathMultyIterator.cs
- Brush.cs
- InvokeProviderWrapper.cs
- AssemblyFilter.cs
- DataControlImageButton.cs
- MaskedTextBoxTextEditor.cs
- TimelineGroup.cs
- HMACSHA384.cs
- DataViewListener.cs
- CreateUserWizard.cs
- WindowsIdentity.cs
- VisualBrush.cs