Author: hbelusca
Date: Sun Jul 14 16:57:26 2013
New Revision: 59486

URL: http://svn.reactos.org/svn/reactos?rev=59486&view=rev
Log:
[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.

Modified:
    trunk/reactos/dll/win32/kernel32/client/handle.c

Modified: trunk/reactos/dll/win32/kernel32/client/handle.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/handle.c?rev=59486&r1=59485&r2=59486&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/handle.c    [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/handle.c    [iso-8859-1] Sun Jul 14 
16:57:26 2013
@@ -170,7 +170,11 @@
         ((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);


Reply via email to