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
- MessageDecoder.cs
- XDRSchema.cs
- XmlTypeMapping.cs
- PostBackOptions.cs
- CryptoApi.cs
- DSASignatureFormatter.cs
- StorageMappingItemCollection.cs
- CodeObject.cs
- TableHeaderCell.cs
- PageStatePersister.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- Cursor.cs
- TreeNodeBindingCollection.cs
- ArgumentOutOfRangeException.cs
- HitTestWithPointDrawingContextWalker.cs
- ProviderCommandInfoUtils.cs
- ExpandCollapseIsCheckedConverter.cs
- SimpleModelProvider.cs
- _AuthenticationState.cs
- SvcMapFileSerializer.cs
- ParameterRetriever.cs
- Pen.cs
- MailHeaderInfo.cs
- DataTemplateKey.cs
- ContentElementCollection.cs
- HtmlHistory.cs
- DataViewManagerListItemTypeDescriptor.cs
- MiniAssembly.cs
- EmissiveMaterial.cs
- ImageCreator.cs
- SingleAnimation.cs
- AddInActivator.cs
- TreeViewEvent.cs
- ExtensibleClassFactory.cs
- ScrollData.cs
- ButtonChrome.cs
- BufferModesCollection.cs
- HtmlTextBoxAdapter.cs
- StyleModeStack.cs
- MatcherBuilder.cs
- TextCompositionEventArgs.cs
- Formatter.cs
- Utility.cs
- AccessorTable.cs
- Typeface.cs
- ArrayList.cs
- SqlInternalConnectionSmi.cs
- Command.cs
- SelectedGridItemChangedEvent.cs
- StylusEventArgs.cs
- LinkTarget.cs
- IndicCharClassifier.cs
- FreezableOperations.cs
- BrushValueSerializer.cs
- TypeLoadException.cs
- WarningException.cs
- SafeCancelMibChangeNotify.cs
- UTF7Encoding.cs
- ConstructorNeedsTagAttribute.cs
- HttpApplicationStateBase.cs
- AutomationPropertyInfo.cs
- BinarySecretKeyIdentifierClause.cs
- ListViewEditEventArgs.cs
- ICspAsymmetricAlgorithm.cs
- SqlConnection.cs
- MethodAccessException.cs
- DocumentPageTextView.cs
- PermissionRequestEvidence.cs
- GPStream.cs
- ThreadStaticAttribute.cs
- ParameterRetriever.cs
- NativeMethodsOther.cs
- SystemFonts.cs
- ModifiableIteratorCollection.cs
- SmtpTransport.cs
- RootNamespaceAttribute.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- SettingsSection.cs
- OdbcConnectionStringbuilder.cs
- PageTrueTypeFont.cs
- EntityClassGenerator.cs
- ZipIOExtraFieldZip64Element.cs
- StorageEntitySetMapping.cs
- SelectionItemPattern.cs
- WindowsContainer.cs
- SelectedDatesCollection.cs
- ListViewTableCell.cs
- AutomationPeer.cs
- TypeGeneratedEventArgs.cs
- FactoryGenerator.cs
- PersianCalendar.cs
- DataServiceQueryOfT.cs
- SQLDoubleStorage.cs
- CorrelationService.cs
- CreateUserWizardStep.cs
- ConstructorExpr.cs
- MultiBinding.cs
- FontNameConverter.cs
- NavigationPropertyAccessor.cs
- FunctionQuery.cs