System.Diagnostics.ProcessWaitHandle.ProcessWaitHandle C# (CSharp) Method

ProcessWaitHandle() private method

private ProcessWaitHandle ( SafeProcessHandle processHandle ) : Microsoft.Win32.SafeHandles
processHandle SafeProcessHandle
return Microsoft.Win32.SafeHandles
        internal ProcessWaitHandle(SafeProcessHandle processHandle)
        {
            SafeWaitHandle waitHandle = null;
            SafeProcessHandle currentProcHandle = Interop.Kernel32.GetCurrentProcess();
            bool succeeded = Interop.Kernel32.DuplicateHandle(
                currentProcHandle,
                processHandle,
                currentProcHandle,
                out waitHandle,
                0,
                false,
                Interop.Kernel32.HandleOptions.DUPLICATE_SAME_ACCESS);

            if (!succeeded)
            {
                Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
            }

            this.SetSafeWaitHandle(waitHandle);
        }
    }
ProcessWaitHandle