Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / Microsoft / Win32 / SafeHandles / SafeThreadHandle.cs / 1305376 / 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
- DnsPermission.cs
- XPathAncestorIterator.cs
- FtpWebResponse.cs
- VisualTreeUtils.cs
- CodeRegionDirective.cs
- TableCellAutomationPeer.cs
- EntityContainerEmitter.cs
- PageHandlerFactory.cs
- RestClientProxyHandler.cs
- TextTreeTextBlock.cs
- ILGenerator.cs
- X509Certificate2Collection.cs
- RangeValueProviderWrapper.cs
- PrivacyNoticeBindingElement.cs
- CompilerScope.Storage.cs
- RowSpanVector.cs
- FixedElement.cs
- ResourceDisplayNameAttribute.cs
- BinaryObjectReader.cs
- ZipIOModeEnforcingStream.cs
- PathTooLongException.cs
- AutomationAttributeInfo.cs
- SecurityKeyEntropyMode.cs
- ListSourceHelper.cs
- XmlSchemaFacet.cs
- ResourceDescriptionAttribute.cs
- DataControlImageButton.cs
- DataObject.cs
- BaseConfigurationRecord.cs
- ToolStripKeyboardHandlingService.cs
- ConstructorArgumentAttribute.cs
- CustomValidator.cs
- DBConnection.cs
- AttachedAnnotationChangedEventArgs.cs
- GetReadStreamResult.cs
- XmlElementList.cs
- ExpressionBuilderContext.cs
- WeakReadOnlyCollection.cs
- baseaxisquery.cs
- IOThreadScheduler.cs
- WaveHeader.cs
- RestClientProxyHandler.cs
- MenuItem.cs
- Events.cs
- TrustManagerPromptUI.cs
- OracleRowUpdatingEventArgs.cs
- RectAnimationBase.cs
- HttpModuleCollection.cs
- XmlComplianceUtil.cs
- Automation.cs
- AddInPipelineAttributes.cs
- CodeExpressionCollection.cs
- GeneralTransformCollection.cs
- EventProviderWriter.cs
- ListChangedEventArgs.cs
- GeneralTransform2DTo3D.cs
- StreamInfo.cs
- _Win32.cs
- TextSchema.cs
- CellParagraph.cs
- XmlSecureResolver.cs
- DetailsViewPagerRow.cs
- TextEditorContextMenu.cs
- EntityWithChangeTrackerStrategy.cs
- CompilerResults.cs
- Token.cs
- RSAProtectedConfigurationProvider.cs
- JsonXmlDataContract.cs
- BindingWorker.cs
- Point3DAnimationUsingKeyFrames.cs
- SerializationHelper.cs
- MachineKeyValidationConverter.cs
- CodeDomConfigurationHandler.cs
- Repeater.cs
- SafeRightsManagementSessionHandle.cs
- MethodSignatureGenerator.cs
- AttachmentService.cs
- SemanticKeyElement.cs
- ResourceDescriptionAttribute.cs
- DynamicQueryableWrapper.cs
- MdbDataFileEditor.cs
- DataGridPagingPage.cs
- SiteMapNodeItemEventArgs.cs
- DataGridAddNewRow.cs
- PointAnimationClockResource.cs
- ComplexBindingPropertiesAttribute.cs
- WindowsToolbarItemAsMenuItem.cs
- UserControlBuildProvider.cs
- sqlinternaltransaction.cs
- ScrollContentPresenter.cs
- MergeLocalizationDirectives.cs
- AsyncStreamReader.cs
- Parser.cs
- ClientConfigurationSystem.cs
- Matrix.cs
- GeneralTransformCollection.cs
- PageAdapter.cs
- MissingManifestResourceException.cs
- NodeLabelEditEvent.cs
- WebPartVerb.cs