mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[WINSRV] Use ARRAYSIZE() instead of hardcoding buffer size in GetProcessImageFileNameW call
This commit is contained in:
parent
e5db85276e
commit
2c0af91ba1
2 changed files with 2 additions and 4 deletions
|
@ -49,7 +49,7 @@ NonConsoleProcessShutdown(IN PCSR_PROCESS Process,
|
|||
/* Terminate this process */
|
||||
#if DBG
|
||||
WCHAR buffer[MAX_PATH];
|
||||
if (!GetProcessImageFileNameW(Process->ProcessHandle, buffer, MAX_PATH))
|
||||
if (!GetProcessImageFileNameW(Process->ProcessHandle, buffer, ARRAYSIZE(buffer)))
|
||||
{
|
||||
DPRINT1("Terminating process %x\n", Process->ClientId.UniqueProcess);
|
||||
}
|
||||
|
@ -58,7 +58,6 @@ NonConsoleProcessShutdown(IN PCSR_PROCESS Process,
|
|||
DPRINT1("Terminating process %x (%S)\n", Process->ClientId.UniqueProcess, buffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
NtTerminateProcess(Process->ProcessHandle, 0);
|
||||
WaitForSingleObject(Process->ProcessHandle, ShutdownSettings.ProcessTerminateTimeout);
|
||||
}
|
||||
|
|
|
@ -777,7 +777,7 @@ UserClientShutdown(IN PCSR_PROCESS CsrProcess,
|
|||
#if DBG
|
||||
{
|
||||
WCHAR buffer[MAX_PATH];
|
||||
if (!GetProcessImageFileNameW(CsrProcess->ProcessHandle, buffer, MAX_PATH))
|
||||
if (!GetProcessImageFileNameW(CsrProcess->ProcessHandle, buffer, ARRAYSIZE(buffer)))
|
||||
{
|
||||
DPRINT1("Terminating process %x\n", CsrProcess->ClientId.UniqueProcess);
|
||||
}
|
||||
|
@ -788,7 +788,6 @@ UserClientShutdown(IN PCSR_PROCESS CsrProcess,
|
|||
}
|
||||
#endif
|
||||
NtTerminateProcess(CsrProcess->ProcessHandle, 0);
|
||||
|
||||
WaitForSingleObject(CsrProcess->ProcessHandle, ShutdownSettings.ProcessTerminateTimeout);
|
||||
|
||||
/* We are done */
|
||||
|
|
Loading…
Reference in a new issue