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
- EventLogPermission.cs
- XmlSortKeyAccumulator.cs
- PrefixQName.cs
- SystemIPGlobalProperties.cs
- SizeLimitedCache.cs
- RuntimeWrappedException.cs
- Typography.cs
- DataServiceHostFactory.cs
- GradientStop.cs
- VisualCollection.cs
- DataGridViewColumnEventArgs.cs
- ActivityMarkupSerializer.cs
- ControlIdConverter.cs
- Internal.cs
- XmlSchemaAppInfo.cs
- BitmapSourceSafeMILHandle.cs
- QilParameter.cs
- DataStreamFromComStream.cs
- Cursor.cs
- DataTableNewRowEvent.cs
- ApplicationSecurityManager.cs
- DragEventArgs.cs
- AppSettings.cs
- ActivatableWorkflowsQueryResult.cs
- Timer.cs
- ByteViewer.cs
- FixedPageAutomationPeer.cs
- EnvironmentPermission.cs
- ListComponentEditor.cs
- BinaryCommonClasses.cs
- BaseConfigurationRecord.cs
- PDBReader.cs
- xmlglyphRunInfo.cs
- RoleGroupCollectionEditor.cs
- ComponentCommands.cs
- ToolStripOverflowButton.cs
- RtfToXamlReader.cs
- Assert.cs
- QueryPageSettingsEventArgs.cs
- SmiGettersStream.cs
- WsdlBuildProvider.cs
- GuidConverter.cs
- CacheForPrimitiveTypes.cs
- DbModificationCommandTree.cs
- PeerNameRecordCollection.cs
- MexTcpBindingElement.cs
- RMPublishingDialog.cs
- ThreadExceptionEvent.cs
- SmtpClient.cs
- DelegatingTypeDescriptionProvider.cs
- Line.cs
- SendingRequestEventArgs.cs
- DataControlImageButton.cs
- UInt16.cs
- ProcessHostFactoryHelper.cs
- x509utils.cs
- TreeNodeStyle.cs
- SqlConnectionString.cs
- TextOnlyOutput.cs
- AuthorizationRuleCollection.cs
- CallContext.cs
- CopyCodeAction.cs
- DataGridViewDataConnection.cs
- ErrorHandler.cs
- Ipv6Element.cs
- StrongNameMembershipCondition.cs
- CustomAssemblyResolver.cs
- BookmarkOptionsHelper.cs
- Stream.cs
- SecurityTokenTypes.cs
- IgnoreFileBuildProvider.cs
- WrapPanel.cs
- RotateTransform3D.cs
- Cursor.cs
- DataGridViewTextBoxColumn.cs
- HtmlInputCheckBox.cs
- EditorBrowsableAttribute.cs
- SqlHelper.cs
- KeySplineConverter.cs
- TextViewElement.cs
- BitmapSource.cs
- SmtpFailedRecipientException.cs
- XmlSchemaObjectCollection.cs
- CutCopyPasteHelper.cs
- HttpAsyncResult.cs
- BinHexDecoder.cs
- CachedPathData.cs
- PixelFormat.cs
- D3DImage.cs
- Point3DAnimation.cs
- Border.cs
- DefaultShape.cs
- DesignTimeVisibleAttribute.cs
- WinEventHandler.cs
- AnyAllSearchOperator.cs
- EntityAdapter.cs
- SizeAnimationBase.cs
- AlternateView.cs
- handlecollector.cs
- FunctionQuery.cs