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
- DeploymentSection.cs
- QuadraticBezierSegment.cs
- PreviewKeyDownEventArgs.cs
- ProgressiveCrcCalculatingStream.cs
- WindowsUpDown.cs
- TextServicesManager.cs
- CodeFieldReferenceExpression.cs
- isolationinterop.cs
- UnwrappedTypesXmlSerializerManager.cs
- FixedSchema.cs
- WasEndpointConfigContainer.cs
- XmlSerializer.cs
- MultiAsyncResult.cs
- ManagedWndProcTracker.cs
- ExtentKey.cs
- PointAnimationUsingKeyFrames.cs
- SourceElementsCollection.cs
- ItemDragEvent.cs
- MobileCapabilities.cs
- LockCookie.cs
- WindowsBrush.cs
- CaseStatement.cs
- ToolStripDropDownDesigner.cs
- XmlSchemaInferenceException.cs
- HttpRequestCacheValidator.cs
- TableLayout.cs
- Converter.cs
- DateTimeValueSerializerContext.cs
- ParameterToken.cs
- ReflectionServiceProvider.cs
- httpapplicationstate.cs
- NGCUIElementCollectionSerializerAsync.cs
- DecimalConverter.cs
- ValidationEventArgs.cs
- ExpressionConverter.cs
- OuterGlowBitmapEffect.cs
- CachedRequestParams.cs
- X509SecurityTokenProvider.cs
- FacetValues.cs
- XmlSchemaExporter.cs
- OdbcConnectionPoolProviderInfo.cs
- DrawToolTipEventArgs.cs
- TextBlock.cs
- ListenerElementsCollection.cs
- WebConfigurationManager.cs
- OutOfMemoryException.cs
- EntityCollectionChangedParams.cs
- KeyGesture.cs
- ScriptReferenceBase.cs
- KernelTypeValidation.cs
- SignatureHelper.cs
- CalloutQueueItem.cs
- ReadOnlyNameValueCollection.cs
- ServiceProviders.cs
- BindingEntityInfo.cs
- OleDbParameterCollection.cs
- SerialPort.cs
- AddingNewEventArgs.cs
- SafeFileMappingHandle.cs
- OracleNumber.cs
- TextAnchor.cs
- CharEntityEncoderFallback.cs
- GridSplitter.cs
- ProjectionPlanCompiler.cs
- EventMappingSettings.cs
- ToolBarTray.cs
- TouchPoint.cs
- MaskedTextProvider.cs
- RewritingValidator.cs
- ImpersonationContext.cs
- WebRequestModuleElement.cs
- LinkedList.cs
- validation.cs
- DataGridColumnCollection.cs
- InvalidOperationException.cs
- TreeViewAutomationPeer.cs
- PinnedBufferMemoryStream.cs
- OdbcCommand.cs
- BulletedListEventArgs.cs
- BatchParser.cs
- ConnectionProviderAttribute.cs
- NamespaceList.cs
- CodeTypeOfExpression.cs
- MoveSizeWinEventHandler.cs
- TraceFilter.cs
- Menu.cs
- SkipStoryboardToFill.cs
- SoapAttributes.cs
- NativeCppClassAttribute.cs
- ParserContext.cs
- TypedTableGenerator.cs
- AsymmetricKeyExchangeDeformatter.cs
- CodeDirectiveCollection.cs
- QuotedStringFormatReader.cs
- ViewPort3D.cs
- DesignerAdRotatorAdapter.cs
- BooleanConverter.cs
- SymDocumentType.cs
- SymLanguageType.cs
- XmlSchemaSimpleTypeUnion.cs