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
- ThreadPool.cs
- GeneralTransformCollection.cs
- ClientBuildManagerCallback.cs
- MarkupExtensionParser.cs
- HwndKeyboardInputProvider.cs
- XmlEntity.cs
- PropertyTabAttribute.cs
- GridViewColumnHeader.cs
- Array.cs
- QilCloneVisitor.cs
- XmlEntity.cs
- TypeListConverter.cs
- BStrWrapper.cs
- SharedConnectionWorkflowTransactionService.cs
- TimelineGroup.cs
- SettingsContext.cs
- DataGridViewRowHeaderCell.cs
- ToolStripDropTargetManager.cs
- FrameworkTemplate.cs
- ChannelSinkStacks.cs
- MatrixStack.cs
- StreamSecurityUpgradeInitiator.cs
- CustomErrorCollection.cs
- WebResponse.cs
- InstanceNotReadyException.cs
- _FtpDataStream.cs
- TableRowCollection.cs
- Latin1Encoding.cs
- DataGridViewRowsRemovedEventArgs.cs
- TemplateAction.cs
- GlyphInfoList.cs
- TableColumn.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- ApplicationDirectory.cs
- ConfigurationStrings.cs
- CounterSampleCalculator.cs
- DataGridViewCellEventArgs.cs
- SqlTypeConverter.cs
- DashStyle.cs
- FileCodeGroup.cs
- WebConfigurationHost.cs
- WhitespaceRuleLookup.cs
- ToolStripSettings.cs
- DetailsViewPagerRow.cs
- UnaryNode.cs
- SchemaCollectionPreprocessor.cs
- TextSearch.cs
- CodeGeneratorOptions.cs
- ConnectionPoolManager.cs
- XmlnsDictionary.cs
- WSTrust.cs
- AsyncPostBackTrigger.cs
- VideoDrawing.cs
- EventLogPermissionEntryCollection.cs
- SystemTcpConnection.cs
- MailDefinition.cs
- BatchWriter.cs
- MessageDispatch.cs
- XPathNodeInfoAtom.cs
- ScrollableControlDesigner.cs
- ChannelManager.cs
- UrlPath.cs
- FormViewInsertedEventArgs.cs
- linebase.cs
- CompletionCallbackWrapper.cs
- EventsTab.cs
- shaperfactory.cs
- SqlDataSource.cs
- HostingEnvironmentSection.cs
- DataListItemCollection.cs
- VerticalAlignConverter.cs
- DirectionalLight.cs
- DetailsViewRowCollection.cs
- RootProfilePropertySettingsCollection.cs
- ListParaClient.cs
- SamlSubject.cs
- ConfigXmlWhitespace.cs
- NativeMethods.cs
- LexicalChunk.cs
- RoleManagerModule.cs
- NameTable.cs
- PropertyManager.cs
- SmiEventSink.cs
- DataGridViewDataConnection.cs
- ObjectListCommandEventArgs.cs
- WebServiceData.cs
- BindingCollectionElement.cs
- SqlDelegatedTransaction.cs
- NameValuePermission.cs
- XmlAutoDetectWriter.cs
- OpenFileDialog.cs
- NotFiniteNumberException.cs
- AssemblyAssociatedContentFileAttribute.cs
- WindowsSlider.cs
- UInt64Storage.cs
- EmptyQuery.cs
- X509UI.cs
- SignedInfo.cs
- SpotLight.cs
- BoundField.cs