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
- DataPagerFieldCollection.cs
- httpapplicationstate.cs
- Calendar.cs
- FlowDocumentScrollViewer.cs
- SqlHelper.cs
- UInt32Converter.cs
- Size.cs
- UnsafeNativeMethods.cs
- BinHexEncoder.cs
- DateTimeFormatInfo.cs
- SQLInt64Storage.cs
- EntityDesignerDataSourceView.cs
- WebBrowserNavigatingEventHandler.cs
- TextEncodedRawTextWriter.cs
- GroupBoxRenderer.cs
- Win32PrintDialog.cs
- BrushConverter.cs
- HTMLTextWriter.cs
- COM2ICategorizePropertiesHandler.cs
- SortQuery.cs
- WindowsScrollBarBits.cs
- SiteMapNode.cs
- WindowsGraphicsWrapper.cs
- PersonalizationStateQuery.cs
- Expr.cs
- Timeline.cs
- ImageMapEventArgs.cs
- ServiceEndpointAssociationProvider.cs
- AxisAngleRotation3D.cs
- BaseTemplateParser.cs
- DateTime.cs
- DropShadowBitmapEffect.cs
- TdsParserSafeHandles.cs
- GenericIdentity.cs
- RectAnimationUsingKeyFrames.cs
- ClonableStack.cs
- RouteValueDictionary.cs
- X509ChainElement.cs
- Enum.cs
- NotImplementedException.cs
- SqlDataSourceSelectingEventArgs.cs
- XmlSignificantWhitespace.cs
- AxDesigner.cs
- WorkflowViewService.cs
- MetaColumn.cs
- User.cs
- SelectionHighlightInfo.cs
- HtmlInputText.cs
- PersonalizationStateInfoCollection.cs
- AuthenticationConfig.cs
- WebPartHeaderCloseVerb.cs
- CompressEmulationStream.cs
- CodePrimitiveExpression.cs
- WebPartManager.cs
- RawStylusInputCustomData.cs
- ByteKeyFrameCollection.cs
- LexicalChunk.cs
- ReferenceService.cs
- DataControlFieldTypeEditor.cs
- AppliedDeviceFiltersEditor.cs
- IISUnsafeMethods.cs
- ImageField.cs
- ConvertTextFrag.cs
- WsdlHelpGeneratorElement.cs
- WindowsButton.cs
- ToolStrip.cs
- FrugalMap.cs
- _UriTypeConverter.cs
- QueryCacheManager.cs
- UserPreferenceChangingEventArgs.cs
- SoapFault.cs
- sqlstateclientmanager.cs
- PasswordDeriveBytes.cs
- Thread.cs
- MessageQueueTransaction.cs
- DecimalStorage.cs
- TriggerActionCollection.cs
- FileDialogPermission.cs
- OperandQuery.cs
- XmlSchemaIdentityConstraint.cs
- InheritanceContextChangedEventManager.cs
- EntitySqlQueryBuilder.cs
- KeyValuePair.cs
- FormClosedEvent.cs
- TokenDescriptor.cs
- _DigestClient.cs
- EntityDataSourceValidationException.cs
- TreeViewHitTestInfo.cs
- Attribute.cs
- Tokenizer.cs
- PageClientProxyGenerator.cs
- TabItemAutomationPeer.cs
- TemplateBindingExtension.cs
- MetafileHeader.cs
- FirewallWrapper.cs
- ResourceDescriptionAttribute.cs
- JpegBitmapDecoder.cs
- SystemSounds.cs
- ConfigurationSectionHelper.cs
- HuffmanTree.cs