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
- XPathMessageFilterElementCollection.cs
- RectValueSerializer.cs
- FtpWebResponse.cs
- FtpWebResponse.cs
- DeferredSelectedIndexReference.cs
- FrameworkObject.cs
- RoutingEndpointTrait.cs
- BufferBuilder.cs
- CorePropertiesFilter.cs
- QueryableDataSourceEditData.cs
- KeyValuePair.cs
- NameSpaceExtractor.cs
- LocatorGroup.cs
- XPathDocument.cs
- CodeIdentifier.cs
- TempFiles.cs
- MinimizableAttributeTypeConverter.cs
- DesignerActionMethodItem.cs
- ExtractedStateEntry.cs
- AssociationSetMetadata.cs
- MatrixTransform.cs
- KeyValueConfigurationCollection.cs
- CollectionDataContractAttribute.cs
- ApplicationContext.cs
- Highlights.cs
- XmlDigitalSignatureProcessor.cs
- CalendarDateRange.cs
- WebConfigurationHost.cs
- FileDialog_Vista_Interop.cs
- InputScopeManager.cs
- Hyperlink.cs
- CheckBoxField.cs
- ScrollProviderWrapper.cs
- Authorization.cs
- Line.cs
- ManagementEventWatcher.cs
- LinearGradientBrush.cs
- PrintPreviewControl.cs
- RawStylusActions.cs
- PolicyLevel.cs
- EntryPointNotFoundException.cs
- CharacterMetrics.cs
- StylusPoint.cs
- Speller.cs
- ProcessHostServerConfig.cs
- autovalidator.cs
- RemotingConfiguration.cs
- SafeNativeMethods.cs
- CodeMemberProperty.cs
- SettingsAttributeDictionary.cs
- ChannelSinkStacks.cs
- DeviceContext2.cs
- EventSourceCreationData.cs
- DocumentSequenceHighlightLayer.cs
- PrintingPermission.cs
- XmlSecureResolver.cs
- MdImport.cs
- FrameworkContentElementAutomationPeer.cs
- CodeTypeParameter.cs
- Confirm.cs
- uribuilder.cs
- ExpressionLexer.cs
- AnnotationComponentChooser.cs
- SQLRoleProvider.cs
- SQLCharsStorage.cs
- FixedPageAutomationPeer.cs
- HitTestWithGeometryDrawingContextWalker.cs
- OdbcReferenceCollection.cs
- XamlRtfConverter.cs
- XpsStructure.cs
- SqlTypeConverter.cs
- ScrollContentPresenter.cs
- TableLayoutSettingsTypeConverter.cs
- MatrixConverter.cs
- InheritanceRules.cs
- UriTemplatePathPartiallyEquivalentSet.cs
- FrameworkTemplate.cs
- StatusBarItem.cs
- FacetChecker.cs
- MemberHolder.cs
- TypeReference.cs
- Thickness.cs
- SafeBitVector32.cs
- CaseStatementSlot.cs
- SpeechSynthesizer.cs
- ToolStripContentPanel.cs
- ValidateNames.cs
- DesignTimeParseData.cs
- DataKey.cs
- localization.cs
- NameObjectCollectionBase.cs
- TCPListener.cs
- ProtocolElementCollection.cs
- MergeExecutor.cs
- Substitution.cs
- MouseWheelEventArgs.cs
- TimelineCollection.cs
- AutoFocusStyle.xaml.cs
- OdbcFactory.cs
- TextAdaptor.cs