From: Hermès Bélusca-Maïto Date: Mon, 28 Apr 2014 23:09:09 +0000 (+0000) Subject: [CSRSRV] X-Git-Tag: backups/0.3.17@66124~1365^2~19 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=487d3f80bfa39cc5e282eb82d43611b2393a130c [CSRSRV] When the CsrProcessCreateNewGroup (~= CREATE_NEW_PROCESS_GROUP) flag is set, it means that we are creating a new process group leader, and not the reverse :P svn path=/branches/ntvdm/; revision=63041 --- diff --git a/subsystems/win32/csrsrv/procsup.c b/subsystems/win32/csrsrv/procsup.c index d682c379388..451f2697d45 100644 --- a/subsystems/win32/csrsrv/procsup.c +++ b/subsystems/win32/csrsrv/procsup.c @@ -605,15 +605,18 @@ CsrCreateProcess(IN HANDLE hProcess, } /* Check if CreateProcess got CREATE_NEW_PROCESS_GROUP */ - if ((Flags & CsrProcessCreateNewGroup) == 0) + if (Flags & CsrProcessCreateNewGroup) { - /* Create new data */ + /* + * We create the process group leader of a new process group, therefore + * its process group ID and sequence number are its own ones. + */ CsrProcess->ProcessGroupId = HandleToUlong(ClientId->UniqueProcess); CsrProcess->ProcessGroupSequence = CsrProcess->SequenceNumber; } else { - /* Copy it from the current process */ + /* Inherit the process group ID and sequence number from the current process */ CsrProcess->ProcessGroupId = CurrentProcess->ProcessGroupId; CsrProcess->ProcessGroupSequence = CurrentProcess->ProcessGroupSequence; }