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
- CorrelationTokenInvalidatedHandler.cs
- GetCertificateRequest.cs
- HtmlHead.cs
- ConfigDefinitionUpdates.cs
- TextModifier.cs
- RegisteredExpandoAttribute.cs
- TransformConverter.cs
- Figure.cs
- SqlBuilder.cs
- AnnouncementEventArgs.cs
- BaseValidator.cs
- SqlCacheDependencyDatabaseCollection.cs
- ControlAdapter.cs
- StringKeyFrameCollection.cs
- Pointer.cs
- StaticSiteMapProvider.cs
- ExpandCollapseProviderWrapper.cs
- DbConnectionFactory.cs
- AspNetHostingPermission.cs
- RadioButton.cs
- XmlSchemaRedefine.cs
- _Win32.cs
- ValidationHelpers.cs
- CompositeActivityMarkupSerializer.cs
- BulletedListEventArgs.cs
- TemplatePartAttribute.cs
- XPathDescendantIterator.cs
- MemberMaps.cs
- BulletedList.cs
- FunctionNode.cs
- ISAPIApplicationHost.cs
- ButtonFieldBase.cs
- QuaternionConverter.cs
- InvalidPrinterException.cs
- CustomAttributeFormatException.cs
- EntityProxyTypeInfo.cs
- MappingItemCollection.cs
- PageBuildProvider.cs
- DataGridViewIntLinkedList.cs
- Paragraph.cs
- CheckBoxField.cs
- x509utils.cs
- GridItemCollection.cs
- DataSourceControl.cs
- TransformProviderWrapper.cs
- BeginGetFileNameFromUserRequest.cs
- PropertyEmitterBase.cs
- BitmapEffectCollection.cs
- AliasExpr.cs
- LogicalTreeHelper.cs
- OutputCache.cs
- WebPartUserCapability.cs
- SingleObjectCollection.cs
- HealthMonitoringSection.cs
- Style.cs
- SequenceQuery.cs
- StateChangeEvent.cs
- RSAOAEPKeyExchangeFormatter.cs
- DmlSqlGenerator.cs
- CoTaskMemHandle.cs
- CompilerParameters.cs
- SHA384Cng.cs
- InstanceOwner.cs
- IPipelineRuntime.cs
- SymbolPair.cs
- WebSysDefaultValueAttribute.cs
- Misc.cs
- XsdDataContractImporter.cs
- ConnectionPoint.cs
- EditorPart.cs
- CapabilitiesPattern.cs
- TreeNodeCollection.cs
- processwaithandle.cs
- ServiceReference.cs
- KeyToListMap.cs
- XmlSchemaIdentityConstraint.cs
- ProviderConnectionPointCollection.cs
- Clipboard.cs
- CodeMethodInvokeExpression.cs
- ProcessHost.cs
- Processor.cs
- EmptyStringExpandableObjectConverter.cs
- DispatcherHooks.cs
- ADRole.cs
- CqlIdentifiers.cs
- InternalBase.cs
- LeaseManager.cs
- WinFormsComponentEditor.cs
- SoapClientMessage.cs
- XPathSelectionIterator.cs
- XsltFunctions.cs
- Header.cs
- BlockingCollection.cs
- HashHelper.cs
- MinimizableAttributeTypeConverter.cs
- EmptyEnumerator.cs
- BitmapEffectGeneralTransform.cs
- PerformanceCounterPermissionEntryCollection.cs
- XmlIlTypeHelper.cs
- EndpointAddress.cs