[KERNEL32]

Fix some broken logic: we can duplicate console handles only if both the source and the target processes are in fact the current process.

svn path=/trunk/; revision=59486
This commit is contained in:
Hermès Bélusca-Maïto 2013-07-14 16:57:26 +00:00
parent 542bb5560c
commit 9ff782961b

View file

@ -170,7 +170,11 @@ DuplicateHandle(IN HANDLE hSourceProcessHandle,
((hSourceHandle != NtCurrentProcess()) &&
(hSourceHandle != NtCurrentThread())))
{
if ((hSourceProcessHandle != NtCurrentProcess()) &&
/*
* We can duplicate console handles only if both the source
* and the target processes are in fact the current process.
*/
if ((hSourceProcessHandle != NtCurrentProcess()) ||
(hTargetProcessHandle != NtCurrentProcess()))
{
BaseSetLastNTError(STATUS_INVALID_PARAMETER);