Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Services / Monitoring / system / Diagnosticts / processwaithandle.cs / 1 / processwaithandle.cs
using System; using System.Threading; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; using System.Runtime.InteropServices; namespace System.Diagnostics { internal class ProcessWaitHandle : WaitHandle { 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; namespace System.Diagnostics { internal class ProcessWaitHandle : WaitHandle { 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
- MemoryStream.cs
- EndpointAddressMessageFilter.cs
- AuthenticationException.cs
- SoapAttributeOverrides.cs
- ObjRef.cs
- FilteredReadOnlyMetadataCollection.cs
- SimpleBitVector32.cs
- DataBoundControlHelper.cs
- RelationshipType.cs
- RuntimeHelpers.cs
- CalloutQueueItem.cs
- ZipIOModeEnforcingStream.cs
- _BufferOffsetSize.cs
- EncodingInfo.cs
- DrawingVisual.cs
- StyleXamlParser.cs
- TextLine.cs
- ManipulationStartedEventArgs.cs
- GregorianCalendar.cs
- FontSourceCollection.cs
- SelectorAutomationPeer.cs
- ImageList.cs
- DocComment.cs
- Baml2006KeyRecord.cs
- FileEnumerator.cs
- SchemaElement.cs
- CommonDialog.cs
- CodeIterationStatement.cs
- Int64AnimationBase.cs
- FormatControl.cs
- TextEndOfParagraph.cs
- DataServiceConfiguration.cs
- Accessible.cs
- TemplateKeyConverter.cs
- HtmlSelect.cs
- TreeViewTemplateSelector.cs
- XmlSchemaComplexType.cs
- CollectionConverter.cs
- UrlRoutingModule.cs
- SignatureConfirmationElement.cs
- WindowsTokenRoleProvider.cs
- SoapConverter.cs
- DefaultPropertyAttribute.cs
- UnsafeNativeMethods.cs
- hebrewshape.cs
- QuaternionValueSerializer.cs
- WindowsListViewGroupSubsetLink.cs
- TargetControlTypeAttribute.cs
- TextElementEditingBehaviorAttribute.cs
- NumericUpDown.cs
- ManualResetEvent.cs
- RuleInfoComparer.cs
- BaseDataList.cs
- EntityException.cs
- ItemCheckEvent.cs
- DataTableReader.cs
- CounterCreationData.cs
- HtmlDocument.cs
- KeyConverter.cs
- DocumentViewerHelper.cs
- DeploymentSection.cs
- _FtpDataStream.cs
- Point.cs
- Aggregates.cs
- CodeGenHelper.cs
- UnionCqlBlock.cs
- DateTimeEditor.cs
- ScrollProperties.cs
- DesignerDataRelationship.cs
- OdbcConnectionPoolProviderInfo.cs
- ClientOptions.cs
- SqlClientMetaDataCollectionNames.cs
- ServiceModelEnumValidatorAttribute.cs
- FormsAuthenticationTicket.cs
- XamlPointCollectionSerializer.cs
- SecurityDescriptor.cs
- TogglePattern.cs
- GridItemProviderWrapper.cs
- QueuePathDialog.cs
- RemoteArgument.cs
- CategoryNameCollection.cs
- ProcessModuleCollection.cs
- LessThan.cs
- PrinterResolution.cs
- InputLanguageManager.cs
- QueuePathEditor.cs
- FormsAuthentication.cs
- PixelFormats.cs
- CharStorage.cs
- StylusDownEventArgs.cs
- RadioButton.cs
- ProcessMonitor.cs
- Style.cs
- SettingsAttributeDictionary.cs
- CompilerErrorCollection.cs
- NumericUpDownAcceleration.cs
- DataSourceXmlElementAttribute.cs
- TextServicesLoader.cs
- Matrix3D.cs
- WebPartDisplayModeCollection.cs