Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Monitoring / system / Diagnosticts / processwaithandle.cs / 1305376 / processwaithandle.cs
using System; using System.Threading; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; using System.Runtime.InteropServices; using System.Runtime.Versioning; namespace System.Diagnostics { internal class ProcessWaitHandle : WaitHandle { [ResourceExposure(ResourceScope.None)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] internal ProcessWaitHandle( SafeProcessHandle processHandle): base() { SafeWaitHandle waitHandle = null; bool succeeded = NativeMethods.DuplicateHandle( new HandleRef(this, NativeMethods.GetCurrentProcess()), processHandle, new HandleRef(this, NativeMethods.GetCurrentProcess()), out waitHandle, 0, false, NativeMethods.DUPLICATE_SAME_ACCESS); if (!succeeded) { Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); } this.SafeWaitHandle = waitHandle; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Threading; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; using System.Runtime.InteropServices; using System.Runtime.Versioning; namespace System.Diagnostics { internal class ProcessWaitHandle : WaitHandle { [ResourceExposure(ResourceScope.None)] [ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)] internal ProcessWaitHandle( SafeProcessHandle processHandle): base() { SafeWaitHandle waitHandle = null; bool succeeded = NativeMethods.DuplicateHandle( new HandleRef(this, NativeMethods.GetCurrentProcess()), processHandle, new HandleRef(this, NativeMethods.GetCurrentProcess()), out waitHandle, 0, false, NativeMethods.DUPLICATE_SAME_ACCESS); if (!succeeded) { Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error()); } this.SafeWaitHandle = waitHandle; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataControlImageButton.cs
- DataObjectCopyingEventArgs.cs
- RegexMatch.cs
- XmlDocumentFragment.cs
- StateDesignerConnector.cs
- WMIGenerator.cs
- CngKey.cs
- MoveSizeWinEventHandler.cs
- LineGeometry.cs
- ChainOfResponsibility.cs
- MULTI_QI.cs
- Int32Storage.cs
- EntitySetRetriever.cs
- EditBehavior.cs
- MemberProjectedSlot.cs
- TextLine.cs
- ClientScriptManager.cs
- ListViewGroup.cs
- ObjectSecurity.cs
- InvokeHandlers.cs
- IsolatedStorageFile.cs
- ObjectDataSourceView.cs
- Double.cs
- path.cs
- DialogBaseForm.cs
- AnimatedTypeHelpers.cs
- IssuanceTokenProviderState.cs
- CssClassPropertyAttribute.cs
- MetroSerializationManager.cs
- SafeArrayTypeMismatchException.cs
- DataGridViewCheckBoxCell.cs
- HTTPRemotingHandler.cs
- Span.cs
- XmlBoundElement.cs
- OrderedDictionary.cs
- TextRunProperties.cs
- ValidationSummary.cs
- ContentFilePart.cs
- DateTimeValueSerializerContext.cs
- GetReadStreamResult.cs
- ProcessProtocolHandler.cs
- ProfileSettings.cs
- InternalDuplexBindingElement.cs
- GeneralTransform3DCollection.cs
- BitmapImage.cs
- ChannelSinkStacks.cs
- FixedSOMLineCollection.cs
- ScriptManager.cs
- FirewallWrapper.cs
- XmlSchemaAnnotated.cs
- PackWebResponse.cs
- UpDownEvent.cs
- IImplicitResourceProvider.cs
- ContractMethodParameterInfo.cs
- Graph.cs
- EventDrivenDesigner.cs
- UnescapedXmlDiagnosticData.cs
- DBSqlParserColumnCollection.cs
- IsolatedStorageException.cs
- HandlerBase.cs
- EntityDataSourceDesigner.cs
- HttpException.cs
- TransformGroup.cs
- _ConnectStream.cs
- embossbitmapeffect.cs
- UnorderedHashRepartitionStream.cs
- ICspAsymmetricAlgorithm.cs
- AccessText.cs
- BrowserCapabilitiesCodeGenerator.cs
- AssemblyCollection.cs
- MessageDirection.cs
- WebMessageEncoderFactory.cs
- EnumerableRowCollection.cs
- RayHitTestParameters.cs
- ApplicationSecurityInfo.cs
- ConstrainedGroup.cs
- XmlComplianceUtil.cs
- ParallelForEach.cs
- WindowsScrollBar.cs
- BuildResult.cs
- FacetDescriptionElement.cs
- XsltArgumentList.cs
- SqlDataSourceQueryEditorForm.cs
- ListViewCancelEventArgs.cs
- DeleteHelper.cs
- PartialArray.cs
- DependencyPropertyHelper.cs
- IQueryable.cs
- QueryOperatorEnumerator.cs
- TextRenderer.cs
- OdbcConnectionStringbuilder.cs
- WeakReference.cs
- SoapSchemaExporter.cs
- SQLCharsStorage.cs
- TextEmbeddedObject.cs
- DocumentPageTextView.cs
- DeferredElementTreeState.cs
- InstanceCompleteException.cs
- Propagator.Evaluator.cs
- InitializerFacet.cs