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
- ReaderContextStackData.cs
- GC.cs
- FullTextBreakpoint.cs
- DataColumnSelectionConverter.cs
- BamlVersionHeader.cs
- DocumentAutomationPeer.cs
- TraceData.cs
- TraceProvider.cs
- TaskResultSetter.cs
- RangeContentEnumerator.cs
- WsatConfiguration.cs
- Vector3D.cs
- WindowsSolidBrush.cs
- SchemaTableColumn.cs
- DesignerVerbCollection.cs
- BaseResourcesBuildProvider.cs
- ClosableStream.cs
- XmlTypeAttribute.cs
- RegexCode.cs
- UpdateManifestForBrowserApplication.cs
- ContextMenuService.cs
- ModelTreeEnumerator.cs
- linebase.cs
- SafeHandles.cs
- ComplexLine.cs
- SafeNativeMethodsCLR.cs
- OletxVolatileEnlistment.cs
- HashHelper.cs
- OracleConnectionFactory.cs
- CommandCollectionEditor.cs
- HighlightVisual.cs
- FunctionDefinition.cs
- XpsFilter.cs
- JournalNavigationScope.cs
- GradientStopCollection.cs
- Cursors.cs
- FileCodeGroup.cs
- NativeMethods.cs
- CodeParameterDeclarationExpressionCollection.cs
- DelegatingHeader.cs
- DataTableReader.cs
- MainMenu.cs
- AppearanceEditorPart.cs
- ProfessionalColors.cs
- DataControlFieldHeaderCell.cs
- CharEntityEncoderFallback.cs
- PriorityChain.cs
- RemoteWebConfigurationHostStream.cs
- StateManagedCollection.cs
- WindowsHyperlink.cs
- ToolStripDropDownClosedEventArgs.cs
- ServerIdentity.cs
- EndpointNotFoundException.cs
- AutomationElementCollection.cs
- TemplateBindingExpression.cs
- CallSiteBinder.cs
- DiscoveryMessageProperty.cs
- COM2ColorConverter.cs
- DataSourceCache.cs
- DataKey.cs
- CodeAccessPermission.cs
- ProfilePropertySettings.cs
- DataFormats.cs
- OleDbError.cs
- XmlParser.cs
- DataExpression.cs
- TreeViewDataItemAutomationPeer.cs
- KeyTime.cs
- mediaclock.cs
- StringAnimationUsingKeyFrames.cs
- Rect.cs
- SoapException.cs
- URLMembershipCondition.cs
- FontStretches.cs
- ILGenerator.cs
- ScriptManager.cs
- EdmSchemaAttribute.cs
- IndexedString.cs
- OdbcParameterCollection.cs
- DataGridHyperlinkColumn.cs
- ErrorTolerantObjectWriter.cs
- SearchForVirtualItemEventArgs.cs
- Int16Animation.cs
- SecurityContextCookieSerializer.cs
- SoapAttributeAttribute.cs
- TabletDevice.cs
- future.cs
- AuthorizationRuleCollection.cs
- EngineSiteSapi.cs
- VectorValueSerializer.cs
- XmlQueryContext.cs
- EntitySqlException.cs
- ping.cs
- SectionInformation.cs
- CommonProperties.cs
- Aggregates.cs
- ContextMarshalException.cs
- BulletChrome.cs
- LinkLabelLinkClickedEvent.cs
- ProcessInfo.cs