Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StorageMappingItemLoader.cs
- FixedSOMLineCollection.cs
- assertwrapper.cs
- TimeSpanConverter.cs
- RecordManager.cs
- RightsManagementInformation.cs
- CodeParameterDeclarationExpressionCollection.cs
- SetterBase.cs
- MissingMethodException.cs
- EventNotify.cs
- AsymmetricKeyExchangeFormatter.cs
- TypeLibConverter.cs
- HttpCookiesSection.cs
- CryptoStream.cs
- DrawToolTipEventArgs.cs
- Point3DAnimationUsingKeyFrames.cs
- XmlTypeAttribute.cs
- WindowsContainer.cs
- GeneralTransformGroup.cs
- DictionarySectionHandler.cs
- DataGridViewBindingCompleteEventArgs.cs
- SqlDeflator.cs
- GraphicsPath.cs
- XmlArrayItemAttributes.cs
- XmlIgnoreAttribute.cs
- SchemaElement.cs
- ScrollChrome.cs
- TriggerAction.cs
- baseshape.cs
- FixedHighlight.cs
- WindowsRichEdit.cs
- WebHttpSecurityElement.cs
- CompareInfo.cs
- PrimaryKeyTypeConverter.cs
- StrongName.cs
- HostedHttpContext.cs
- TableCellAutomationPeer.cs
- QilPatternFactory.cs
- DataGridViewCheckBoxCell.cs
- ExpressionCopier.cs
- Single.cs
- SpecialNameAttribute.cs
- JavaScriptString.cs
- SmtpAuthenticationManager.cs
- ClientProxyGenerator.cs
- PolyBezierSegment.cs
- EventData.cs
- Rect3D.cs
- ReferentialConstraint.cs
- SourceFileInfo.cs
- WorkflowServiceOperationListItem.cs
- DecimalConstantAttribute.cs
- ResizeGrip.cs
- SchemaImporterExtensionElement.cs
- BuildManagerHost.cs
- DiscoveryClientDocuments.cs
- UserControlFileEditor.cs
- HebrewNumber.cs
- UnsafeNativeMethods.cs
- CustomError.cs
- PermissionRequestEvidence.cs
- WebColorConverter.cs
- SecureConversationSecurityTokenParameters.cs
- JobCollate.cs
- GACIdentityPermission.cs
- BinaryMethodMessage.cs
- ExecutionContext.cs
- WorkflowMessageEventHandler.cs
- XhtmlTextWriter.cs
- ToolStripMenuItemDesigner.cs
- ForceCopyBuildProvider.cs
- TitleStyle.cs
- MatrixCamera.cs
- UnhandledExceptionEventArgs.cs
- ProjectionPlan.cs
- RegexWorker.cs
- TableRow.cs
- ToolStripDropDownClosedEventArgs.cs
- ButtonRenderer.cs
- WebPartAuthorizationEventArgs.cs
- ChangeDirector.cs
- SecurityElementBase.cs
- ParameterToken.cs
- OleTxTransaction.cs
- RuleInfoComparer.cs
- DetailsViewRow.cs
- HttpModuleActionCollection.cs
- SqlDataAdapter.cs
- RichTextBoxConstants.cs
- Button.cs
- CompilerHelpers.cs
- XmlSchemaExporter.cs
- BindableTemplateBuilder.cs
- PermissionSetEnumerator.cs
- XmlArrayItemAttribute.cs
- PaperSource.cs
- WSHttpBinding.cs
- hresults.cs
- DeclaredTypeElementCollection.cs
- DrawItemEvent.cs