Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CapabilitiesUse.cs
- ColumnBinding.cs
- ProjectedWrapper.cs
- AttachmentCollection.cs
- HostingEnvironmentSection.cs
- ImpersonationContext.cs
- XamlDebuggerXmlReader.cs
- SourceInterpreter.cs
- HMACSHA256.cs
- MimeFormatExtensions.cs
- Int32CollectionValueSerializer.cs
- ObjectStateEntry.cs
- ProxyDataContractResolver.cs
- SessionStateContainer.cs
- XmlSiteMapProvider.cs
- LayoutDump.cs
- ElementHostAutomationPeer.cs
- SqlCommand.cs
- xmlfixedPageInfo.cs
- Evaluator.cs
- SoapUnknownHeader.cs
- StringResourceManager.cs
- HasCopySemanticsAttribute.cs
- HtmlGenericControl.cs
- SurrogateEncoder.cs
- Evaluator.cs
- MemberInfoSerializationHolder.cs
- SecureEnvironment.cs
- RbTree.cs
- ExplicitDiscriminatorMap.cs
- DataMemberListEditor.cs
- Compiler.cs
- XmlReader.cs
- DataGridViewRowCancelEventArgs.cs
- MaskedTextBox.cs
- DeviceContexts.cs
- FuncCompletionCallbackWrapper.cs
- ZoomPercentageConverter.cs
- InputReferenceExpression.cs
- PolicyException.cs
- _Win32.cs
- MouseCaptureWithinProperty.cs
- Accessible.cs
- HtmlShimManager.cs
- DrawListViewColumnHeaderEventArgs.cs
- FixedSOMGroup.cs
- QuestionEventArgs.cs
- SchemaTypeEmitter.cs
- BitmapEncoder.cs
- MulticastNotSupportedException.cs
- SqlMethods.cs
- QueryCreatedEventArgs.cs
- httpserverutility.cs
- ConsumerConnectionPointCollection.cs
- SamlAttribute.cs
- PreparingEnlistment.cs
- EventToken.cs
- SqlConnection.cs
- ServiceAuthorizationElement.cs
- ArgumentsParser.cs
- TreeViewImageIndexConverter.cs
- WmiEventSink.cs
- WindowPattern.cs
- DescendantQuery.cs
- PlanCompilerUtil.cs
- RegionInfo.cs
- FixedSOMElement.cs
- TextAnchor.cs
- Timer.cs
- GridViewDeleteEventArgs.cs
- HtmlEncodedRawTextWriter.cs
- PeerApplicationLaunchInfo.cs
- lengthconverter.cs
- SingleTagSectionHandler.cs
- LoadedOrUnloadedOperation.cs
- ChineseLunisolarCalendar.cs
- XamlClipboardData.cs
- RegexRunnerFactory.cs
- DocumentPaginator.cs
- FormViewInsertedEventArgs.cs
- StylusCaptureWithinProperty.cs
- PatternMatcher.cs
- Renderer.cs
- TimeManager.cs
- DataList.cs
- ScriptDescriptor.cs
- RepeaterItemCollection.cs
- DashStyles.cs
- TrackingParticipant.cs
- XmlTextReaderImplHelpers.cs
- ComplexBindingPropertiesAttribute.cs
- ObjectCloneHelper.cs
- GeometryGroup.cs
- WebPartDescriptionCollection.cs
- UniqueConstraint.cs
- SchemaTableColumn.cs
- ParserHooks.cs
- MSG.cs
- HttpDictionary.cs
- HtmlTableRow.cs