Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- DesignTimeVisibleAttribute.cs
- DateTimeStorage.cs
- StorageScalarPropertyMapping.cs
- SafeFindHandle.cs
- TrustManagerPromptUI.cs
- ObjectDisposedException.cs
- SafeMILHandleMemoryPressure.cs
- NameValuePair.cs
- TryExpression.cs
- mediapermission.cs
- SetterBase.cs
- LoginViewDesigner.cs
- ComponentDesigner.cs
- CacheChildrenQuery.cs
- XXXOnTypeBuilderInstantiation.cs
- MethodAccessException.cs
- WebServiceMethodData.cs
- IProvider.cs
- SqlProcedureAttribute.cs
- CharacterHit.cs
- TreeNodeBindingCollection.cs
- ClientSettingsSection.cs
- BufferedGraphics.cs
- ListViewCancelEventArgs.cs
- _UriSyntax.cs
- StructuralType.cs
- SafeEventHandle.cs
- BypassElement.cs
- XmlHelper.cs
- ContextMenu.cs
- TaskFileService.cs
- InheritedPropertyDescriptor.cs
- LinkedResourceCollection.cs
- ProfileSection.cs
- UserMapPath.cs
- ToRequest.cs
- ISAPIRuntime.cs
- KeyMatchBuilder.cs
- precedingsibling.cs
- TextAnchor.cs
- CryptoKeySecurity.cs
- TaskFileService.cs
- DateTimeUtil.cs
- BackoffTimeoutHelper.cs
- Base64Stream.cs
- Style.cs
- TemplateBuilder.cs
- DragAssistanceManager.cs
- ToolboxItemWrapper.cs
- DataGridViewColumnStateChangedEventArgs.cs
- ColorPalette.cs
- SslStream.cs
- TitleStyle.cs
- InheritanceContextHelper.cs
- PageVisual.cs
- HTTPNotFoundHandler.cs
- ElementAction.cs
- SqlXmlStorage.cs
- X509ChainPolicy.cs
- GridView.cs
- BuildProvider.cs
- ServiceProviders.cs
- JsonFormatGeneratorStatics.cs
- XsltConvert.cs
- Transactions.cs
- SqlParameterizer.cs
- DataGridViewColumnHeaderCell.cs
- HideDisabledControlAdapter.cs
- RadioButton.cs
- AnimationClock.cs
- LongTypeConverter.cs
- DataServiceSaveChangesEventArgs.cs
- GeometryCombineModeValidation.cs
- SkinIDTypeConverter.cs
- SystemGatewayIPAddressInformation.cs
- PassportAuthenticationEventArgs.cs
- DockingAttribute.cs
- SelectionRangeConverter.cs
- InkCanvasAutomationPeer.cs
- Control.cs
- OuterGlowBitmapEffect.cs
- HashCodeCombiner.cs
- XpsPartBase.cs
- ElementAction.cs
- TextElement.cs
- ContentPlaceHolderDesigner.cs
- RedistVersionInfo.cs
- GlyphElement.cs
- MetafileEditor.cs
- CoreSwitches.cs
- PropertyKey.cs
- QueryServiceConfigHandle.cs
- WebPartsPersonalizationAuthorization.cs
- EntityDataSourceWrapperCollection.cs
- GroupStyle.cs
- SoapExtensionTypeElementCollection.cs
- ArrayWithOffset.cs
- VariableAction.cs
- SettingsAttributeDictionary.cs
- SequentialUshortCollection.cs