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
- ISFTagAndGuidCache.cs
- ActivitiesCollection.cs
- WebBrowser.cs
- UpDownEvent.cs
- XmlCharType.cs
- XsltSettings.cs
- PEFileEvidenceFactory.cs
- LambdaExpression.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- PropertyStore.cs
- DataListItemCollection.cs
- storepermission.cs
- Psha1DerivedKeyGenerator.cs
- ConfigXmlSignificantWhitespace.cs
- CreateUserWizardStep.cs
- ThumbAutomationPeer.cs
- IIS7WorkerRequest.cs
- OrderedDictionary.cs
- WindowsRichEditRange.cs
- NameValueFileSectionHandler.cs
- SqlBuffer.cs
- XmlTextReader.cs
- WebMethodAttribute.cs
- IntSecurity.cs
- StoryFragments.cs
- MultipleViewProviderWrapper.cs
- SystemResourceHost.cs
- UnsafeNativeMethods.cs
- ObjectAnimationUsingKeyFrames.cs
- CommandEventArgs.cs
- KeyTimeConverter.cs
- FormsAuthenticationTicket.cs
- TypedDataSetSchemaImporterExtension.cs
- PkcsMisc.cs
- ProcessHostConfigUtils.cs
- EastAsianLunisolarCalendar.cs
- StateBag.cs
- FacetChecker.cs
- RightsManagementPermission.cs
- XmlIncludeAttribute.cs
- SpecularMaterial.cs
- SizeIndependentAnimationStorage.cs
- log.cs
- KeyToListMap.cs
- OutputCacheSettingsSection.cs
- ValueUtilsSmi.cs
- Identifier.cs
- ProxyManager.cs
- xdrvalidator.cs
- JsonReaderWriterFactory.cs
- WebPartDisplayModeCollection.cs
- StdValidatorsAndConverters.cs
- UnsafeNativeMethodsCLR.cs
- PassportAuthentication.cs
- DataServiceQuery.cs
- FixedFlowMap.cs
- ObjectDataSourceView.cs
- FormsAuthenticationUser.cs
- ObjectView.cs
- CompModSwitches.cs
- EastAsianLunisolarCalendar.cs
- ToolStripSettings.cs
- ShaderEffect.cs
- GeometryValueSerializer.cs
- ImageField.cs
- BCLDebug.cs
- HTMLTextWriter.cs
- NumericUpDownAccelerationCollection.cs
- ErrorProvider.cs
- SqlProviderUtilities.cs
- PartialCachingAttribute.cs
- DeflateInput.cs
- TileModeValidation.cs
- DataGridClipboardCellContent.cs
- SequentialWorkflowRootDesigner.cs
- Assembly.cs
- counter.cs
- StrictModeSecurityHeaderElementInferenceEngine.cs
- SqlStream.cs
- StorageEntitySetMapping.cs
- ServiceContractGenerationContext.cs
- ValidationError.cs
- XslAstAnalyzer.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- BitmapEffect.cs
- ParserExtension.cs
- PropertyDescriptorCollection.cs
- LinkButton.cs
- AutoCompleteStringCollection.cs
- ScriptReferenceBase.cs
- Stack.cs
- DataGridTextBox.cs
- FrameworkElementFactory.cs
- UpdateEventArgs.cs
- WindowsComboBox.cs
- ValidationHelpers.cs
- ObjectIDGenerator.cs
- XmlSchemaComplexContent.cs
- TraceContextRecord.cs
- HuffmanTree.cs