[WINSRV] usersrv: Simplify sanity checks in UserClientShutdown

UserClientShutdown will never be called for csrss so we don't need to have a check for that. The existing check was broken and wasn't doing anything anyway.
Handle processing winlogon by doing nothing so that consrv won't be bothered about it.
This commit is contained in:
Giannis Adamopoulos 2019-01-04 01:22:44 +02:00
parent d84ab9ec7c
commit 0a80b77e76

View file

@ -770,15 +770,17 @@ UserClientShutdown(IN PCSR_PROCESS CsrProcess,
return CsrShutdownNonCsrProcess;
}
/* Do not kill Winlogon or CSRSS */
if (CsrProcess->ClientId.UniqueProcess == NtCurrentProcess() ||
CsrProcess->ClientId.UniqueProcess == UlongToHandle(LogonProcessId))
/* Do not kill Winlogon */
if (CsrProcess->ClientId.UniqueProcess == UlongToHandle(LogonProcessId))
{
DPRINT("Not killing %s; CsrProcess->ShutdownFlags = %lu\n",
CsrProcess->ClientId.UniqueProcess == NtCurrentProcess() ? "CSRSS" : "Winlogon",
CsrProcess->ShutdownFlags);
return CsrShutdownNonCsrProcess;
/* Returning CsrShutdownCsrProcess means that we handled this process by doing nothing */
/* This will mark winlogon as processed so consrv won't be notified again for it */
CsrDereferenceProcess(CsrProcess);
return CsrShutdownCsrProcess;
}
/* Notify the process for shutdown if needed */