https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c0af91ba198b3114db0f…
commit 2c0af91ba198b3114db0f9ad8973a345431b9d28
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Thu Feb 22 14:03:33 2024 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Thu Feb 22 22:41:05 2024 +0100
[WINSRV] Use ARRAYSIZE() instead of hardcoding buffer size in GetProcessImageFileNameW
call
---
win32ss/user/winsrv/consrv/shutdown.c | 3 +--
win32ss/user/winsrv/usersrv/shutdown.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/win32ss/user/winsrv/consrv/shutdown.c
b/win32ss/user/winsrv/consrv/shutdown.c
index 91e43993ba8..aec89dfb8e6 100644
--- a/win32ss/user/winsrv/consrv/shutdown.c
+++ b/win32ss/user/winsrv/consrv/shutdown.c
@@ -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);
}
diff --git a/win32ss/user/winsrv/usersrv/shutdown.c
b/win32ss/user/winsrv/usersrv/shutdown.c
index 42973b4cfc6..ce9d4f97e1e 100644
--- a/win32ss/user/winsrv/usersrv/shutdown.c
+++ b/win32ss/user/winsrv/usersrv/shutdown.c
@@ -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 */