Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- SchemaName.cs
- LineServicesRun.cs
- FontFamilyValueSerializer.cs
- BufferedGraphics.cs
- TextCompositionEventArgs.cs
- ActiveXHelper.cs
- ItemsPresenter.cs
- XmlSchemaAppInfo.cs
- DocumentXPathNavigator.cs
- SystemWebSectionGroup.cs
- DataGridTableCollection.cs
- QueryableDataSourceView.cs
- MarginsConverter.cs
- _WinHttpWebProxyDataBuilder.cs
- TreeNodeStyleCollection.cs
- CodeChecksumPragma.cs
- LocationUpdates.cs
- XpsFontSubsetter.cs
- arabicshape.cs
- LinkLabelLinkClickedEvent.cs
- ReliabilityContractAttribute.cs
- _BufferOffsetSize.cs
- AudioStateChangedEventArgs.cs
- CreateUserWizardDesigner.cs
- SafeHandles.cs
- CodeObjectCreateExpression.cs
- HttpCacheVary.cs
- AmbientValueAttribute.cs
- DocumentCollection.cs
- SqlProvider.cs
- DragEvent.cs
- SchemaSetCompiler.cs
- UntypedNullExpression.cs
- MatrixTransform.cs
- DataRecordInfo.cs
- DataGridViewCheckBoxColumn.cs
- HostedTransportConfigurationBase.cs
- EnumDataContract.cs
- ReadOnlyHierarchicalDataSourceView.cs
- RepeaterItem.cs
- ProfileGroupSettings.cs
- VScrollProperties.cs
- SafeEventLogReadHandle.cs
- COM2ColorConverter.cs
- SafeThemeHandle.cs
- NameSpaceEvent.cs
- EntityReference.cs
- CompilerResults.cs
- DbDataSourceEnumerator.cs
- Label.cs
- SerializationFieldInfo.cs
- CompositeCollectionView.cs
- QueryOptionExpression.cs
- RegionIterator.cs
- TableCell.cs
- ComponentResourceKey.cs
- ButtonRenderer.cs
- COM2PropertyBuilderUITypeEditor.cs
- CodeChecksumPragma.cs
- DataRowView.cs
- OleDbCommand.cs
- IPGlobalProperties.cs
- Variant.cs
- IteratorFilter.cs
- DataGridViewCellStateChangedEventArgs.cs
- NGCSerializationManager.cs
- FontNamesConverter.cs
- MachineKeySection.cs
- NetworkAddressChange.cs
- StorageComplexPropertyMapping.cs
- BitmapEffect.cs
- TextEffect.cs
- InlineUIContainer.cs
- DataGridColumnFloatingHeader.cs
- PrimitiveXmlSerializers.cs
- DataTableReader.cs
- SchemaImporter.cs
- ThemeInfoAttribute.cs
- DataServiceExpressionVisitor.cs
- AspNetSynchronizationContext.cs
- XmlReflectionImporter.cs
- SafePEFileHandle.cs
- PointLight.cs
- IncomingWebResponseContext.cs
- HandleCollector.cs
- PresentationAppDomainManager.cs
- M3DUtil.cs
- Internal.cs
- ElementAction.cs
- ComPlusDiagnosticTraceSchemas.cs
- CqlParserHelpers.cs
- FixedSOMElement.cs
- BoolLiteral.cs
- FileBasedResourceGroveler.cs
- Pens.cs
- HtmlEncodedRawTextWriter.cs
- BamlRecordReader.cs
- TaiwanCalendar.cs
- DataColumnMappingCollection.cs
- SelectorItemAutomationPeer.cs