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
- ColumnWidthChangingEvent.cs
- C14NUtil.cs
- ConnectionInterfaceCollection.cs
- DataControlField.cs
- shaperfactoryquerycacheentry.cs
- DBParameter.cs
- XmlSchemaValidator.cs
- SignatureHelper.cs
- glyphs.cs
- DataGridViewDataConnection.cs
- DataGridLength.cs
- TextChange.cs
- WebBaseEventKeyComparer.cs
- TypeUnloadedException.cs
- SelectionProcessor.cs
- XmlWrappingWriter.cs
- StringInfo.cs
- FormViewCommandEventArgs.cs
- DoWorkEventArgs.cs
- ServiceDebugBehavior.cs
- ButtonBase.cs
- SectionUpdates.cs
- PrintDialogException.cs
- RetrieveVirtualItemEventArgs.cs
- CompModSwitches.cs
- AddInToken.cs
- XhtmlTextWriter.cs
- DataGridViewAutoSizeModeEventArgs.cs
- ISAPIApplicationHost.cs
- AdornerHitTestResult.cs
- MetadataWorkspace.cs
- ColorContext.cs
- SoapIgnoreAttribute.cs
- WhitespaceRule.cs
- BufferedWebEventProvider.cs
- WindowProviderWrapper.cs
- SslStreamSecurityElement.cs
- DocumentViewerBaseAutomationPeer.cs
- DataRelation.cs
- Funcletizer.cs
- FontFamilyValueSerializer.cs
- TextDocumentView.cs
- AuthenticationManager.cs
- TextBoxBase.cs
- EncodingFallbackAwareXmlTextWriter.cs
- PropertyDescriptorCollection.cs
- TrackingValidationObjectDictionary.cs
- RouteTable.cs
- ScopedMessagePartSpecification.cs
- _ServiceNameStore.cs
- SQLDecimalStorage.cs
- XmlSchemaCollection.cs
- TimeZone.cs
- Converter.cs
- RenderOptions.cs
- RegisteredHiddenField.cs
- CodeTypeDelegate.cs
- TdsParserHelperClasses.cs
- HttpApplicationStateWrapper.cs
- ChannelToken.cs
- ImageListUtils.cs
- FileSystemWatcher.cs
- ScriptHandlerFactory.cs
- HttpStreamFormatter.cs
- VirtualDirectoryMapping.cs
- ListItemCollection.cs
- TypeSystem.cs
- OleServicesContext.cs
- GeometryGroup.cs
- AppLevelCompilationSectionCache.cs
- OdbcDataAdapter.cs
- StreamWriter.cs
- CodeArrayCreateExpression.cs
- DataGridCell.cs
- HasCopySemanticsAttribute.cs
- HttpModulesSection.cs
- InvariantComparer.cs
- MarshalByRefObject.cs
- sqlcontext.cs
- CommonBehaviorsSection.cs
- DbTransaction.cs
- XmlSerializableReader.cs
- UnionCodeGroup.cs
- RangeValueProviderWrapper.cs
- ConfigXmlSignificantWhitespace.cs
- BuildManagerHost.cs
- SqlServer2KCompatibilityCheck.cs
- MarkupCompiler.cs
- AddInAdapter.cs
- EventLogger.cs
- PersonalizationProvider.cs
- NumericUpDownAccelerationCollection.cs
- IgnoreDataMemberAttribute.cs
- safelink.cs
- WebPartTransformer.cs
- StringStorage.cs
- InstancePersistence.cs
- ToolBarButtonDesigner.cs
- ModuleConfigurationInfo.cs
- ExpressionUtilities.cs