Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- EngineSite.cs
- TopClause.cs
- ParseElementCollection.cs
- IndexedString.cs
- Rijndael.cs
- MemberDescriptor.cs
- ApplicationInfo.cs
- ProcessInputEventArgs.cs
- SByte.cs
- DictionarySectionHandler.cs
- IDictionary.cs
- ApplicationFileParser.cs
- SelectedPathEditor.cs
- BaseConfigurationRecord.cs
- FrameworkContentElement.cs
- RSAOAEPKeyExchangeDeformatter.cs
- Pair.cs
- MemberRelationshipService.cs
- X509AsymmetricSecurityKey.cs
- DynamicDataManager.cs
- COM2ExtendedUITypeEditor.cs
- XmlNamedNodeMap.cs
- TextSelectionHighlightLayer.cs
- CompiledQuery.cs
- GuidelineSet.cs
- CacheDict.cs
- XmlEventCache.cs
- IndentedWriter.cs
- Matrix3DConverter.cs
- BamlLocalizableResource.cs
- Transform.cs
- XsdBuilder.cs
- ZipArchive.cs
- CannotUnloadAppDomainException.cs
- UnsafeNativeMethods.cs
- ParentUndoUnit.cs
- JoinElimination.cs
- DescendantQuery.cs
- TextEditorThreadLocalStore.cs
- RuntimeConfigurationRecord.cs
- ItemsPanelTemplate.cs
- OpenTypeLayout.cs
- TransactionScopeDesigner.cs
- IdentitySection.cs
- AsyncCompletedEventArgs.cs
- XmlQueryOutput.cs
- DesignerActionMethodItem.cs
- DataReceivedEventArgs.cs
- SemaphoreFullException.cs
- RemoteWebConfigurationHost.cs
- InvokeMethod.cs
- ContentControl.cs
- TailCallAnalyzer.cs
- DecimalAnimation.cs
- SourceElementsCollection.cs
- SiteMap.cs
- OciHandle.cs
- StrokeCollection2.cs
- RecordsAffectedEventArgs.cs
- DocumentSignatureManager.cs
- ModelFunctionTypeElement.cs
- UriParserTemplates.cs
- PresentationAppDomainManager.cs
- StateInitializationDesigner.cs
- SQLBytes.cs
- Parallel.cs
- StylusCollection.cs
- Serialization.cs
- RNGCryptoServiceProvider.cs
- BeginStoryboard.cs
- RankException.cs
- FtpCachePolicyElement.cs
- XmlSiteMapProvider.cs
- SqlRetyper.cs
- StylusShape.cs
- ResourceManagerWrapper.cs
- Polyline.cs
- DataGridViewIntLinkedList.cs
- QuerySetOp.cs
- ConstructorArgumentAttribute.cs
- OpenFileDialog.cs
- ScrollItemProviderWrapper.cs
- InstalledFontCollection.cs
- ImageMapEventArgs.cs
- HttpValueCollection.cs
- CssClassPropertyAttribute.cs
- ApplicationFileCodeDomTreeGenerator.cs
- TimeSpanSecondsConverter.cs
- TemplateBindingExpressionConverter.cs
- GridPatternIdentifiers.cs
- TextComposition.cs
- WindowsBrush.cs
- LateBoundBitmapDecoder.cs
- MultipartContentParser.cs
- HttpDebugHandler.cs
- MD5CryptoServiceProvider.cs
- ClosableStream.cs
- UriTemplatePathSegment.cs
- TargetInvocationException.cs
- RoamingStoreFileUtility.cs