mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +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 */
|
/* Terminate this process */
|
||||||
#if DBG
|
#if DBG
|
||||||
WCHAR buffer[MAX_PATH];
|
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);
|
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);
|
DPRINT1("Terminating process %x (%S)\n", Process->ClientId.UniqueProcess, buffer);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NtTerminateProcess(Process->ProcessHandle, 0);
|
NtTerminateProcess(Process->ProcessHandle, 0);
|
||||||
WaitForSingleObject(Process->ProcessHandle, ShutdownSettings.ProcessTerminateTimeout);
|
WaitForSingleObject(Process->ProcessHandle, ShutdownSettings.ProcessTerminateTimeout);
|
||||||
}
|
}
|
||||||
|
|
|
@ -777,7 +777,7 @@ UserClientShutdown(IN PCSR_PROCESS CsrProcess,
|
||||||
#if DBG
|
#if DBG
|
||||||
{
|
{
|
||||||
WCHAR buffer[MAX_PATH];
|
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);
|
DPRINT1("Terminating process %x\n", CsrProcess->ClientId.UniqueProcess);
|
||||||
}
|
}
|
||||||
|
@ -788,7 +788,6 @@ UserClientShutdown(IN PCSR_PROCESS CsrProcess,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
NtTerminateProcess(CsrProcess->ProcessHandle, 0);
|
NtTerminateProcess(CsrProcess->ProcessHandle, 0);
|
||||||
|
|
||||||
WaitForSingleObject(CsrProcess->ProcessHandle, ShutdownSettings.ProcessTerminateTimeout);
|
WaitForSingleObject(CsrProcess->ProcessHandle, ShutdownSettings.ProcessTerminateTimeout);
|
||||||
|
|
||||||
/* We are done */
|
/* We are done */
|
||||||
|
|
Loading…
Reference in a new issue