mirror of
https://github.com/reactos/reactos.git
synced 2024-11-23 11:33:31 +08:00
[NTOS:PS] Address FIXME in ps\kill.c, move JOB_OBJECT_MSG_EXIT_PROCESS to the right place
This fixes an unexpected overlapped in the WINE test.
This commit is contained in:
parent
5da317c3fe
commit
a6c90d7973
@ -473,17 +473,6 @@ PspExitProcessFromJob(
|
||||
InterlockedOr((PLONG)&Process->JobStatus, JOB_NOT_REALLY_ACTIVE);
|
||||
}
|
||||
|
||||
/* If the job has a completion port, notify it of the process exit */
|
||||
if (Job->CompletionPort)
|
||||
{
|
||||
IoSetIoCompletion(Job->CompletionPort,
|
||||
Job->CompletionKey,
|
||||
NULL,
|
||||
STATUS_SUCCESS,
|
||||
JOB_OBJECT_MSG_EXIT_PROCESS,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
/* If no active processes remain, notify the job completion port */
|
||||
if (Job->ActiveProcesses == 0 && Job->CompletionPort)
|
||||
{
|
||||
|
@ -1120,10 +1120,22 @@ PspExitProcess(IN BOOLEAN LastThread,
|
||||
ZwSetTimerResolution(KeMaximumIncrement, 0, &Actual);
|
||||
}
|
||||
|
||||
/* Check if we are part of a Job that has a completion port */
|
||||
if ((Process->Job) && (Process->Job->CompletionPort))
|
||||
/* Check if we are part of a Job that has a completion port
|
||||
and do I/O completion if needed */
|
||||
if (Process->Job &&
|
||||
Process->Job->CompletionPort &&
|
||||
!(Process->JobStatus & JOB_NOT_REALLY_ACTIVE))
|
||||
{
|
||||
/* FIXME: Check job status code and do I/O completion if needed */
|
||||
ExEnterCriticalRegionAndAcquireResourceShared(&Process->Job->JobLock);
|
||||
|
||||
IoSetIoCompletion(Process->Job->CompletionPort,
|
||||
Process->Job->CompletionKey,
|
||||
Process->UniqueProcessId,
|
||||
STATUS_SUCCESS,
|
||||
JOB_OBJECT_MSG_EXIT_PROCESS,
|
||||
FALSE);
|
||||
|
||||
ExReleaseResourceAndLeaveCriticalRegion(&Process->Job->JobLock);
|
||||
}
|
||||
|
||||
/* FIXME: Notify the Prefetcher */
|
||||
|
Loading…
Reference in New Issue
Block a user