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
- DependencyProperty.cs
- SchemaTableOptionalColumn.cs
- BufferBuilder.cs
- StyleSheetRefUrlEditor.cs
- Context.cs
- GridItemPattern.cs
- _WinHttpWebProxyDataBuilder.cs
- _StreamFramer.cs
- DoubleCollectionConverter.cs
- PageAdapter.cs
- HatchBrush.cs
- HwndProxyElementProvider.cs
- TextAdaptor.cs
- SubqueryRules.cs
- ProjectionRewriter.cs
- Quad.cs
- CodeDOMProvider.cs
- PropertyManager.cs
- SubpageParagraph.cs
- SystemNetHelpers.cs
- DbSetClause.cs
- Rotation3DAnimationUsingKeyFrames.cs
- NavigationProperty.cs
- DetailsViewDeleteEventArgs.cs
- MetabaseReader.cs
- DataGridColumnDropSeparator.cs
- SqlVisitor.cs
- ExecutedRoutedEventArgs.cs
- DbProviderSpecificTypePropertyAttribute.cs
- Stream.cs
- ToolboxItemCollection.cs
- SqlBooleanizer.cs
- PingReply.cs
- SiteMapProvider.cs
- XsdDuration.cs
- Activator.cs
- IncrementalReadDecoders.cs
- XmlSchemaException.cs
- NotifyParentPropertyAttribute.cs
- ThreadBehavior.cs
- RemotingConfiguration.cs
- UnsafeNativeMethods.cs
- XmlSchemaAnnotation.cs
- DrawingContext.cs
- IntSecurity.cs
- DocumentViewerBaseAutomationPeer.cs
- BaseTreeIterator.cs
- TextOnlyOutput.cs
- SystemInformation.cs
- WsatServiceCertificate.cs
- XmlAutoDetectWriter.cs
- Config.cs
- DesignerProperties.cs
- HyperLinkColumn.cs
- ClientScriptManager.cs
- CssClassPropertyAttribute.cs
- CheckBox.cs
- ActivityXRefPropertyEditor.cs
- RuleProcessor.cs
- RuntimeResourceSet.cs
- AliasGenerator.cs
- BuildProviderAppliesToAttribute.cs
- TypedTableBase.cs
- CultureInfo.cs
- RtfControlWordInfo.cs
- PropertyItemInternal.cs
- DictionarySectionHandler.cs
- SignedXml.cs
- OverrideMode.cs
- TextMetrics.cs
- ResolveRequestResponseAsyncResult.cs
- CustomCategoryAttribute.cs
- PerformanceCounterCategory.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- WebPartHelpVerb.cs
- RotateTransform3D.cs
- CatalogZoneBase.cs
- LoginCancelEventArgs.cs
- LoginDesignerUtil.cs
- ExtendedProperty.cs
- SqlReferenceCollection.cs
- CloudCollection.cs
- CommonDialog.cs
- FixedTextPointer.cs
- InputLangChangeRequestEvent.cs
- PersonalizationProvider.cs
- ListViewGroupItemCollection.cs
- ViewCellSlot.cs
- PageParser.cs
- ControlPropertyNameConverter.cs
- UserMapPath.cs
- BindingContext.cs
- ConstantSlot.cs
- HttpAsyncResult.cs
- SpeechAudioFormatInfo.cs
- ControlPropertyNameConverter.cs
- EastAsianLunisolarCalendar.cs
- CalendarAutomationPeer.cs
- SpellerStatusTable.cs
- CoTaskMemSafeHandle.cs