Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / Microsoft / Win32 / SafeHandles / SafeWaitHandle.cs / 2 / SafeWaitHandle.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: SafeWaitHandle ** ** ** A wrapper for Win32 events (mutexes, auto reset events, and ** manual reset events). Used by WaitHandle. ** ** ===========================================================*/ using System; using System.Security; using System.Security.Permissions; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.Versioning; using Microsoft.Win32; using System.Threading; namespace Microsoft.Win32.SafeHandles { [SecurityPermission(SecurityAction.LinkDemand,UnmanagedCode=true)] public sealed class SafeWaitHandle : SafeHandleZeroOrMinusOneIsInvalid { // Called by P/Invoke marshaler private SafeWaitHandle() : base(true) { } [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] public SafeWaitHandle(IntPtr existingHandle, bool ownsHandle) : base(ownsHandle) { SetHandle(existingHandle); } [ResourceExposure(ResourceScope.Machine)] [ResourceConsumption(ResourceScope.Machine)] override protected bool ReleaseHandle() { return Win32Native.CloseHandle(handle); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CodeIdentifier.cs
- VideoDrawing.cs
- ToolStripRenderEventArgs.cs
- AddressHeaderCollectionElement.cs
- TreeIterator.cs
- RawStylusInputCustomDataList.cs
- OracleParameter.cs
- BypassElementCollection.cs
- BamlWriter.cs
- DataGridCellsPresenter.cs
- TransformationRules.cs
- EncryptedPackageFilter.cs
- Context.cs
- Rotation3DAnimation.cs
- EndpointAddress.cs
- GroupDescription.cs
- ErrorFormatter.cs
- ButtonField.cs
- RemotingClientProxy.cs
- BrushConverter.cs
- BuildDependencySet.cs
- ServicePrincipalNameElement.cs
- EDesignUtil.cs
- TreeIterators.cs
- NavigationEventArgs.cs
- base64Transforms.cs
- EventProviderWriter.cs
- RegexInterpreter.cs
- odbcmetadatafactory.cs
- httpserverutility.cs
- NGCSerializationManagerAsync.cs
- BamlRecordWriter.cs
- IndependentAnimationStorage.cs
- PropertyChangedEventArgs.cs
- smtppermission.cs
- AdornedElementPlaceholder.cs
- CompositeScriptReferenceEventArgs.cs
- ArgumentValidation.cs
- ScriptResourceHandler.cs
- NotifyIcon.cs
- RayMeshGeometry3DHitTestResult.cs
- MsmqSecureHashAlgorithm.cs
- RadialGradientBrush.cs
- Utils.cs
- BamlBinaryWriter.cs
- WebBrowserNavigatedEventHandler.cs
- DSACryptoServiceProvider.cs
- XmlSchemaSimpleContent.cs
- HotSpotCollection.cs
- X509ThumbprintKeyIdentifierClause.cs
- PathFigure.cs
- XPathDescendantIterator.cs
- XhtmlBasicLabelAdapter.cs
- ModelProperty.cs
- BitmapCodecInfo.cs
- SqlClientWrapperSmiStream.cs
- MessageCredentialType.cs
- XmlSignatureManifest.cs
- PropertyGeneratedEventArgs.cs
- MouseButton.cs
- Statements.cs
- GorillaCodec.cs
- XPathDocumentNavigator.cs
- NumberFormatInfo.cs
- SoapFault.cs
- DbProviderFactory.cs
- UshortList2.cs
- PerfProviderCollection.cs
- PermissionSetTriple.cs
- ColorAnimationBase.cs
- PersonalizationState.cs
- NumericUpDownAcceleration.cs
- RelOps.cs
- Matrix.cs
- DirectoryNotFoundException.cs
- SqlClientPermission.cs
- TransformGroup.cs
- FontFamilyValueSerializer.cs
- Condition.cs
- SelectionProviderWrapper.cs
- FrameworkRichTextComposition.cs
- MDIClient.cs
- ActiveXHost.cs
- configsystem.cs
- TemplateControl.cs
- ContactManager.cs
- GlyphCache.cs
- TableSectionStyle.cs
- ADMembershipProvider.cs
- XamlStyleSerializer.cs
- AttachmentService.cs
- ProfessionalColors.cs
- PersistChildrenAttribute.cs
- ColorContext.cs
- DataGridLength.cs
- FixedSOMImage.cs
- DesignerSerializationOptionsAttribute.cs
- CheckBoxPopupAdapter.cs
- SocketException.cs
- Permission.cs