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
- TableLayoutPanelCodeDomSerializer.cs
- UserPreferenceChangingEventArgs.cs
- MemoryFailPoint.cs
- SqlProcedureAttribute.cs
- EmbeddedMailObjectsCollection.cs
- ScriptServiceAttribute.cs
- ComplexPropertyEntry.cs
- ContentOnlyMessage.cs
- SafeNativeMethods.cs
- PTProvider.cs
- SkipStoryboardToFill.cs
- AnnotationAuthorChangedEventArgs.cs
- DataFormats.cs
- AttributeAction.cs
- FileVersionInfo.cs
- NumberFormatInfo.cs
- AddingNewEventArgs.cs
- Hash.cs
- ChooseAction.cs
- SpeechRecognitionEngine.cs
- SettingsProviderCollection.cs
- CodeAttributeDeclaration.cs
- SortedDictionary.cs
- InkCanvasSelection.cs
- InternalCache.cs
- ProcessHostFactoryHelper.cs
- Paragraph.cs
- LinearKeyFrames.cs
- SimpleHandlerFactory.cs
- datacache.cs
- Table.cs
- ProcessHost.cs
- MailWriter.cs
- COSERVERINFO.cs
- TextPointerBase.cs
- DataPager.cs
- MenuTracker.cs
- XmlSchemaComplexType.cs
- CodeDefaultValueExpression.cs
- CRYPTPROTECT_PROMPTSTRUCT.cs
- XmlSchemaChoice.cs
- PageCatalogPart.cs
- PropertyChangedEventManager.cs
- OutputCacheSection.cs
- GetCryptoTransformRequest.cs
- HitTestParameters.cs
- XmlMapping.cs
- NativeMethods.cs
- Rethrow.cs
- MessagingDescriptionAttribute.cs
- ListBox.cs
- ScrollProperties.cs
- DecoderReplacementFallback.cs
- StylusPointDescription.cs
- TemplateControlCodeDomTreeGenerator.cs
- InputScope.cs
- SerializerWriterEventHandlers.cs
- NamespaceDisplay.xaml.cs
- ProcessHostConfigUtils.cs
- CounterSetInstanceCounterDataSet.cs
- KeyNameIdentifierClause.cs
- TargetConverter.cs
- AsymmetricKeyExchangeDeformatter.cs
- BatchWriter.cs
- WebPartDisplayMode.cs
- QuaternionAnimation.cs
- AddingNewEventArgs.cs
- XmlLinkedNode.cs
- HScrollBar.cs
- ApplicationSecurityInfo.cs
- CellConstant.cs
- EditorResources.cs
- StreamGeometryContext.cs
- RequiredFieldValidator.cs
- PropertyKey.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- HttpVersion.cs
- XmlBinaryReader.cs
- StreamGeometry.cs
- MarginCollapsingState.cs
- _NestedSingleAsyncResult.cs
- SecurityUtils.cs
- InputEventArgs.cs
- ConnectivityStatus.cs
- Predicate.cs
- HandoffBehavior.cs
- GridViewPageEventArgs.cs
- ListBoxItemAutomationPeer.cs
- WorkerRequest.cs
- LogSwitch.cs
- CurrentChangingEventArgs.cs
- SqlStatistics.cs
- HierarchicalDataSourceControl.cs
- MetaColumn.cs
- BamlMapTable.cs
- CodeParameterDeclarationExpression.cs
- BitmapCacheBrush.cs
- UIAgentAsyncParams.cs
- SqlCrossApplyToCrossJoin.cs
- OuterGlowBitmapEffect.cs