Code:
/ FX-1434 / FX-1434 / 1.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
- StylusPointProperty.cs
- IdnMapping.cs
- Point3DAnimation.cs
- DisplayMemberTemplateSelector.cs
- RegexGroupCollection.cs
- GridViewUpdateEventArgs.cs
- HttpClientCredentialType.cs
- EntityDataSourceWrapper.cs
- CapiHashAlgorithm.cs
- EventMap.cs
- DefaultProxySection.cs
- FixedSOMTableRow.cs
- ControlIdConverter.cs
- DbModificationCommandTree.cs
- CodeIndexerExpression.cs
- ToolStripSystemRenderer.cs
- COM2Enum.cs
- CodeCatchClause.cs
- Bold.cs
- EventSetter.cs
- MimeMapping.cs
- ProvidersHelper.cs
- Label.cs
- ObjectMemberMapping.cs
- Win32SafeHandles.cs
- TextSimpleMarkerProperties.cs
- RectangleGeometry.cs
- SoapHttpTransportImporter.cs
- SByte.cs
- _HTTPDateParse.cs
- DateTimeConverter.cs
- DesignerRegion.cs
- XXXInfos.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- TagMapInfo.cs
- COM2ColorConverter.cs
- XPathChildIterator.cs
- XmlDomTextWriter.cs
- AccessibilityApplicationManager.cs
- xmlfixedPageInfo.cs
- PathBox.cs
- XmlSchemaElement.cs
- HtmlFormParameterReader.cs
- DropSource.cs
- Converter.cs
- AsyncDataRequest.cs
- AdornerHitTestResult.cs
- XmlAutoDetectWriter.cs
- CompositeControl.cs
- FormViewDeleteEventArgs.cs
- InstalledFontCollection.cs
- DataKeyArray.cs
- StrongNamePublicKeyBlob.cs
- LocalizableAttribute.cs
- WizardForm.cs
- InvariantComparer.cs
- IntAverageAggregationOperator.cs
- MatrixTransform3D.cs
- TempFiles.cs
- XmlChoiceIdentifierAttribute.cs
- linebase.cs
- TextEffect.cs
- ParenthesizePropertyNameAttribute.cs
- PenThreadWorker.cs
- SafeSecurityHandles.cs
- UTF7Encoding.cs
- WindowHideOrCloseTracker.cs
- Mouse.cs
- MetadataCache.cs
- HelpInfo.cs
- BinaryConverter.cs
- HtmlControlPersistable.cs
- TypeUnloadedException.cs
- DataObject.cs
- ToRequest.cs
- SplitterPanel.cs
- XmlAttributes.cs
- TextBox.cs
- SpotLight.cs
- PasswordDeriveBytes.cs
- ChildChangedEventArgs.cs
- ExpressionNormalizer.cs
- ReachVisualSerializerAsync.cs
- MimeTypePropertyAttribute.cs
- PtsHelper.cs
- CompilerScope.cs
- MethodBuilder.cs
- MobileControlDesigner.cs
- HttpWebRequestElement.cs
- JumpPath.cs
- SimpleBitVector32.cs
- Typography.cs
- DataTrigger.cs
- PrintEvent.cs
- HtmlControl.cs
- FixedTextBuilder.cs
- MouseActionValueSerializer.cs
- SessionPageStateSection.cs
- ReadOnlyTernaryTree.cs
- Container.cs