Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- DeleteHelper.cs
- HandlerBase.cs
- DataSvcMapFile.cs
- AnimationClock.cs
- StandardCommandToolStripMenuItem.cs
- XmlIncludeAttribute.cs
- ContainerUIElement3D.cs
- ImageKeyConverter.cs
- AutomationElementCollection.cs
- IndexedDataBuffer.cs
- DPTypeDescriptorContext.cs
- ServiceObjectContainer.cs
- X509IssuerSerialKeyIdentifierClause.cs
- Schedule.cs
- DBNull.cs
- XmlSubtreeReader.cs
- DrawItemEvent.cs
- RelationshipFixer.cs
- PopupEventArgs.cs
- HttpCookieCollection.cs
- AttachedPropertyBrowsableAttribute.cs
- Predicate.cs
- DropDownList.cs
- EllipseGeometry.cs
- SystemKeyConverter.cs
- OdbcConnectionString.cs
- BatchParser.cs
- SmiEventSink_DeferedProcessing.cs
- BoundsDrawingContextWalker.cs
- RequestBringIntoViewEventArgs.cs
- IPHostEntry.cs
- ExpressionPrinter.cs
- CodeNamespace.cs
- SevenBitStream.cs
- SequenceFullException.cs
- DataGridViewComboBoxColumn.cs
- AccessorTable.cs
- MemoryStream.cs
- MatchAttribute.cs
- ListViewGroupConverter.cs
- MetabaseSettings.cs
- RNGCryptoServiceProvider.cs
- HttpCacheVaryByContentEncodings.cs
- InputManager.cs
- ContentIterators.cs
- DbConnectionOptions.cs
- TabControlCancelEvent.cs
- IItemContainerGenerator.cs
- MultipartIdentifier.cs
- FixedSOMTextRun.cs
- ItemChangedEventArgs.cs
- HtmlLiteralTextAdapter.cs
- Form.cs
- XamlStream.cs
- ProfileInfo.cs
- SessionPageStatePersister.cs
- CreateUserErrorEventArgs.cs
- EventHandlersStore.cs
- LockedAssemblyCache.cs
- loginstatus.cs
- OleCmdHelper.cs
- WorkflowOperationBehavior.cs
- XmlAtomicValue.cs
- TextElement.cs
- TextViewElement.cs
- NetworkInformationException.cs
- CodeNamespaceImport.cs
- DependencyPropertyAttribute.cs
- TabItemWrapperAutomationPeer.cs
- Error.cs
- PopupRootAutomationPeer.cs
- ExpressionSelection.cs
- HandleCollector.cs
- SHA384Managed.cs
- CreateUserWizard.cs
- MarkupProperty.cs
- ServiceModelExtensionCollectionElement.cs
- ChtmlTextWriter.cs
- OrderedDictionary.cs
- ComponentResourceKey.cs
- QueryRewriter.cs
- DecoderBestFitFallback.cs
- WebPartVerb.cs
- Scripts.cs
- HTTPRemotingHandler.cs
- InvokeGenerator.cs
- RestClientProxyHandler.cs
- NativeCppClassAttribute.cs
- DatePickerDateValidationErrorEventArgs.cs
- StringStorage.cs
- Evidence.cs
- SweepDirectionValidation.cs
- DrawingImage.cs
- SafeRightsManagementHandle.cs
- SafeFileMappingHandle.cs
- validationstate.cs
- DataObjectFieldAttribute.cs
- ClientTargetCollection.cs
- TextParagraphProperties.cs
- CmsUtils.cs