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
- CodeDomSerializationProvider.cs
- SessionStateUtil.cs
- Context.cs
- LineBreak.cs
- TypeName.cs
- Byte.cs
- BitmapCodecInfo.cs
- CodeMethodInvokeExpression.cs
- ProxyWebPart.cs
- DataService.cs
- SecurityKeyIdentifier.cs
- EncodedStreamFactory.cs
- ControlCachePolicy.cs
- GraphicsContainer.cs
- GenericFlowSwitchHelper.cs
- UnsafeNativeMethods.cs
- ToolStripButton.cs
- FontUnitConverter.cs
- DbProviderSpecificTypePropertyAttribute.cs
- GridViewRowEventArgs.cs
- Point3DKeyFrameCollection.cs
- CellTreeNodeVisitors.cs
- DivideByZeroException.cs
- PassportPrincipal.cs
- HtmlInputRadioButton.cs
- CollectionType.cs
- XmlSchemaValidator.cs
- Bitmap.cs
- StorageRoot.cs
- BlurBitmapEffect.cs
- ConfigXmlWhitespace.cs
- HtmlInputText.cs
- Selection.cs
- CursorInteropHelper.cs
- BoundsDrawingContextWalker.cs
- XmlEnumAttribute.cs
- AvtEvent.cs
- BindingMAnagerBase.cs
- LoadGrammarCompletedEventArgs.cs
- Encoding.cs
- ExpressionParser.cs
- FillErrorEventArgs.cs
- GPRECT.cs
- DropDownButton.cs
- PtsCache.cs
- LateBoundBitmapDecoder.cs
- FixedSOMSemanticBox.cs
- ProtectedProviderSettings.cs
- UnauthorizedAccessException.cs
- MulticastDelegate.cs
- HttpServerUtilityWrapper.cs
- Internal.cs
- RectConverter.cs
- DecimalAverageAggregationOperator.cs
- RequestResponse.cs
- XmlQueryStaticData.cs
- TrackingWorkflowEventArgs.cs
- OperandQuery.cs
- DynamicResourceExtensionConverter.cs
- DateTimeConstantAttribute.cs
- PropertyFilter.cs
- OdbcCommand.cs
- SoapMessage.cs
- SHA1CryptoServiceProvider.cs
- FieldBuilder.cs
- ConnectAlgorithms.cs
- StateManagedCollection.cs
- CreateUserErrorEventArgs.cs
- UriScheme.cs
- DataColumnCollection.cs
- PropertyRecord.cs
- GeneralTransform3DCollection.cs
- XmlStreamStore.cs
- SharedStatics.cs
- BitmapScalingModeValidation.cs
- AppDomainProtocolHandler.cs
- InvalidMessageContractException.cs
- ExceptionUtility.cs
- MULTI_QI.cs
- BooleanFacetDescriptionElement.cs
- BatchParser.cs
- SequenceDesigner.cs
- HttpUnhandledOperationInvoker.cs
- sqlmetadatafactory.cs
- CallbackException.cs
- Graph.cs
- PriorityChain.cs
- ValueType.cs
- RootContext.cs
- RowToFieldTransformer.cs
- CodeStatementCollection.cs
- DropShadowBitmapEffect.cs
- JournalEntryListConverter.cs
- UnionCodeGroup.cs
- HitTestParameters.cs
- IpcServerChannel.cs
- SqlDataSourceParameterParser.cs
- Stack.cs
- ValidationErrorInfo.cs
- HandoffBehavior.cs