[CSRSRV]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 1 Jan 2013 02:12:19 +0000 (02:12 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 1 Jan 2013 02:12:19 +0000 (02:12 +0000)
Do NOT confuse a handle and a pointer to a handle !! In this case we need a handle.

Caught in the following situation :

1- Launch a process A which initializes a console A (say, cmd.exe).
2- Launch a process B which also initializes a console B (for instance, in the first cmd.exe, do: start cmd.exe)
3- Click on the "Close" button (the "Cross" button in the right upper side) of the windows of the console A.
4- Notice that the console B closes but the process B remains alive, whereas the console A remains open but the process A is killed...
   (contrary to what you expected, closing the console A and the process A)

(when clicking on the "Close" button, the Console Server launches a remote thread in the context of the target process, and it appeared in the described situation
that it was the wrong process, because of bad parameter passing to the sub-function CsrLockProcessByClientId called when creating the remote thread).

svn path=/branches/ros-csrss/; revision=58073

subsystems/win32/csrsrv/thredsup.c

index 61a572e..2dc9df0 100644 (file)
@@ -579,7 +579,7 @@ CsrCreateRemoteThread(IN HANDLE hThread,
     }
 
     /* Lock the Owner Process */
     }
 
     /* Lock the Owner Process */
-    Status = CsrLockProcessByClientId(&ClientId->UniqueProcess, &CsrProcess);
+    Status = CsrLockProcessByClientId(ClientId->UniqueProcess, &CsrProcess);
     if (!NT_SUCCESS(Status))
     {
         DPRINT1("No known process for %lx\n", ClientId->UniqueProcess);
     if (!NT_SUCCESS(Status))
     {
         DPRINT1("No known process for %lx\n", ClientId->UniqueProcess);