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
- SettingsProviderCollection.cs
- Stylesheet.cs
- OperandQuery.cs
- SqlCacheDependencyDatabaseCollection.cs
- _AutoWebProxyScriptWrapper.cs
- EndpointPerformanceCounters.cs
- ScaleTransform3D.cs
- SqlDependencyListener.cs
- XslNumber.cs
- FilterElement.cs
- UriTemplateClientFormatter.cs
- TypePresenter.xaml.cs
- DataQuery.cs
- HttpCapabilitiesBase.cs
- Base64Decoder.cs
- EventBuilder.cs
- ErasingStroke.cs
- ThreadSafeList.cs
- DynamicMethod.cs
- IImplicitResourceProvider.cs
- TdsEnums.cs
- CreateWorkflowOwnerCommand.cs
- DataGridRowHeaderAutomationPeer.cs
- DataGridViewBindingCompleteEventArgs.cs
- InboundActivityHelper.cs
- GeneratedContractType.cs
- DiscoveryEndpoint.cs
- SqlCacheDependency.cs
- MessageAction.cs
- String.cs
- DragEvent.cs
- DefaultPropertiesToSend.cs
- WebHttpBindingCollectionElement.cs
- FixedTextSelectionProcessor.cs
- KeyGestureValueSerializer.cs
- Transform.cs
- RowsCopiedEventArgs.cs
- OracleParameterCollection.cs
- MetadataImporterQuotas.cs
- CriticalHandle.cs
- OdbcCommand.cs
- CodeRegionDirective.cs
- HttpRequestWrapper.cs
- LockedHandleGlyph.cs
- ThumbAutomationPeer.cs
- FocusManager.cs
- HtmlFormWrapper.cs
- TableRowCollection.cs
- TextEffectResolver.cs
- TypeElement.cs
- SimpleExpression.cs
- BamlRecordWriter.cs
- ToolStripArrowRenderEventArgs.cs
- SmiContextFactory.cs
- RenderData.cs
- ProtocolViolationException.cs
- AmbientProperties.cs
- VSWCFServiceContractGenerator.cs
- ACL.cs
- OrElse.cs
- XmlSerializerVersionAttribute.cs
- VectorCollectionConverter.cs
- TreeNodeCollection.cs
- ColorConvertedBitmapExtension.cs
- querybuilder.cs
- DrawingBrush.cs
- PropertyMapper.cs
- Compress.cs
- TreeViewCancelEvent.cs
- BitmapSourceSafeMILHandle.cs
- ModelUIElement3D.cs
- securestring.cs
- NamespaceList.cs
- FormViewCommandEventArgs.cs
- nulltextcontainer.cs
- DateTimeStorage.cs
- BindingContext.cs
- Size.cs
- DataGridTableCollection.cs
- JoinCqlBlock.cs
- WebPartVerb.cs
- ExpressionReplacer.cs
- HttpProfileBase.cs
- CircleHotSpot.cs
- DataDocumentXPathNavigator.cs
- RealizationContext.cs
- HwndHost.cs
- PopOutPanel.cs
- FlowDocumentFormatter.cs
- CellRelation.cs
- _LazyAsyncResult.cs
- XmlDownloadManager.cs
- X509RecipientCertificateServiceElement.cs
- ErrorFormatter.cs
- ToolStripScrollButton.cs
- NameSpaceExtractor.cs
- ObjectItemConventionAssemblyLoader.cs
- SQLBytesStorage.cs
- AttributeUsageAttribute.cs
- PriorityQueue.cs