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
- HashMembershipCondition.cs
- exports.cs
- CodePrimitiveExpression.cs
- DesignerSerializationVisibilityAttribute.cs
- TableRowCollection.cs
- EmitterCache.cs
- RegisteredExpandoAttribute.cs
- XPathQilFactory.cs
- BasicHttpSecurityElement.cs
- HostingEnvironment.cs
- GridViewColumn.cs
- CodeMethodReturnStatement.cs
- MultiAsyncResult.cs
- MenuScrollingVisibilityConverter.cs
- SafeLocalMemHandle.cs
- UInt16.cs
- RtfControlWordInfo.cs
- ImmutableDispatchRuntime.cs
- ProcessStartInfo.cs
- TransactionWaitAsyncResult.cs
- TemplateKeyConverter.cs
- SoapClientProtocol.cs
- MultipleViewProviderWrapper.cs
- VisualStyleInformation.cs
- StoreItemCollection.Loader.cs
- MissingFieldException.cs
- DropDownButton.cs
- MessageQueueAccessControlEntry.cs
- BoundColumn.cs
- ResourcePool.cs
- TextFormatter.cs
- InvalidDataException.cs
- CheckBox.cs
- DefaultValueTypeConverter.cs
- SqlInternalConnectionTds.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- Connector.xaml.cs
- GradientBrush.cs
- RegexParser.cs
- InputQueue.cs
- FormatterServices.cs
- ExecutedRoutedEventArgs.cs
- OdbcEnvironment.cs
- ArrayListCollectionBase.cs
- ToolboxComponentsCreatedEventArgs.cs
- SByteConverter.cs
- SoapReflectionImporter.cs
- ServiceModelConfigurationSectionGroup.cs
- ActiveXHelper.cs
- DataGridViewRowCancelEventArgs.cs
- XamlSerializerUtil.cs
- HashStream.cs
- FormViewRow.cs
- TrustManagerMoreInformation.cs
- TextServicesPropertyRanges.cs
- Gdiplus.cs
- UIElementCollection.cs
- StoreItemCollection.Loader.cs
- NullableDoubleMinMaxAggregationOperator.cs
- ListViewTableRow.cs
- HttpRequestCacheValidator.cs
- Inflater.cs
- CatalogPart.cs
- AnchoredBlock.cs
- ColumnMapVisitor.cs
- Pen.cs
- HtmlWindow.cs
- EdmItemError.cs
- PatternMatcher.cs
- SharedUtils.cs
- TextEditorDragDrop.cs
- RegexGroupCollection.cs
- DataGridViewColumnEventArgs.cs
- EntityDataSourceStatementEditorForm.cs
- sqlstateclientmanager.cs
- ZoneButton.cs
- AnnouncementInnerClientCD1.cs
- WizardStepCollectionEditor.cs
- NamespaceTable.cs
- WindowsButton.cs
- DbConnectionPoolCounters.cs
- securestring.cs
- EntityConnectionStringBuilder.cs
- ExpressionBuilderCollection.cs
- RawStylusInputCustomDataList.cs
- ErrorInfoXmlDocument.cs
- EdmToObjectNamespaceMap.cs
- MarkupWriter.cs
- HttpWrapper.cs
- HtmlHead.cs
- ServiceDescriptionImporter.cs
- TimeSpanSecondsConverter.cs
- AnnouncementService.cs
- AppSettingsExpressionBuilder.cs
- DataGridRelationshipRow.cs
- DigitShape.cs
- ManagementEventArgs.cs
- IItemProperties.cs
- DateTimePicker.cs
- UpdateTranslator.cs