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
- ipaddressinformationcollection.cs
- HopperCache.cs
- DelayedRegex.cs
- DefaultTextStore.cs
- DataServiceCollectionOfT.cs
- SmiContext.cs
- __Filters.cs
- SamlAttribute.cs
- SHA256Managed.cs
- SR.cs
- XmlDomTextWriter.cs
- DataBindingExpressionBuilder.cs
- TerminateWorkflow.cs
- BaseValidatorDesigner.cs
- SelectorAutomationPeer.cs
- SiteMapDataSource.cs
- SqlTransaction.cs
- OperationCanceledException.cs
- StateRuntime.cs
- InProcStateClientManager.cs
- TextFormatter.cs
- DesignerContextDescriptor.cs
- ViewValidator.cs
- PeerNameRecordCollection.cs
- StackSpiller.Temps.cs
- DesigntimeLicenseContext.cs
- StylusPointPropertyUnit.cs
- ProcessHostFactoryHelper.cs
- ConfigurationException.cs
- MemberDomainMap.cs
- DbResourceAllocator.cs
- DotExpr.cs
- ContextMarshalException.cs
- ProcessRequestArgs.cs
- AgileSafeNativeMemoryHandle.cs
- OracleEncoding.cs
- BitSet.cs
- ParameterCollection.cs
- DataQuery.cs
- SystemIPInterfaceStatistics.cs
- EdmValidator.cs
- GridViewColumnHeader.cs
- DigestComparer.cs
- AssociationProvider.cs
- Repeater.cs
- DataKeyCollection.cs
- GridViewSelectEventArgs.cs
- WpfPayload.cs
- CellPartitioner.cs
- HostedImpersonationContext.cs
- DisposableCollectionWrapper.cs
- namescope.cs
- DomNameTable.cs
- AndCondition.cs
- SoapServerProtocol.cs
- ListViewTableRow.cs
- TdsValueSetter.cs
- DataGridViewComboBoxColumn.cs
- While.cs
- FileClassifier.cs
- IWorkflowDebuggerService.cs
- UnsafeNativeMethods.cs
- ListCollectionView.cs
- SHA1CryptoServiceProvider.cs
- MenuEventArgs.cs
- LogExtent.cs
- ErrorWebPart.cs
- Tokenizer.cs
- XmlWellformedWriter.cs
- SplitterPanel.cs
- TransportDefaults.cs
- OverrideMode.cs
- ToolStripDesignerUtils.cs
- ImagingCache.cs
- WindowsRegion.cs
- SharedUtils.cs
- TriggerAction.cs
- TypeContext.cs
- CreateUserWizard.cs
- ResourceDescriptionAttribute.cs
- ProfileSection.cs
- ShaperBuffers.cs
- XDeferredAxisSource.cs
- ImageCreator.cs
- ExtendedTransformFactory.cs
- XamlVector3DCollectionSerializer.cs
- BamlTreeUpdater.cs
- ProvideValueServiceProvider.cs
- GACIdentityPermission.cs
- KoreanCalendar.cs
- UriTemplateDispatchFormatter.cs
- FontWeight.cs
- URLMembershipCondition.cs
- ErrorFormatterPage.cs
- HostingEnvironmentException.cs
- NetMsmqBinding.cs
- DoubleLinkList.cs
- HwndAppCommandInputProvider.cs
- QilParameter.cs
- CodeDomDesignerLoader.cs