aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/process.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/win32/process.c b/win32/process.c
index 6abc329da..a7074ec75 100644
--- a/win32/process.c
+++ b/win32/process.c
@@ -373,6 +373,7 @@ BOOL WINAPI kill_child_ctrl_handler(DWORD dwCtrlType)
373{ 373{
374 static pid_t child_pid = 0; 374 static pid_t child_pid = 0;
375 DWORD dummy, *procs, count, rcount, i; 375 DWORD dummy, *procs, count, rcount, i;
376 DECLARE_PROC_ADDR(DWORD, GetConsoleProcessList, LPDWORD, DWORD);
376 377
377 if (child_pid == 0) { 378 if (child_pid == 0) {
378 // First call sets child pid 379 // First call sets child pid
@@ -381,6 +382,9 @@ BOOL WINAPI kill_child_ctrl_handler(DWORD dwCtrlType)
381 } 382 }
382 383
383 if (dwCtrlType == CTRL_C_EVENT || dwCtrlType == CTRL_BREAK_EVENT) { 384 if (dwCtrlType == CTRL_C_EVENT || dwCtrlType == CTRL_BREAK_EVENT) {
385 if (!INIT_PROC_ADDR(kernel32.dll, GetConsoleProcessList))
386 return TRUE;
387
384 count = GetConsoleProcessList(&dummy, 1) + 16; 388 count = GetConsoleProcessList(&dummy, 1) + 16;
385 procs = malloc(sizeof(DWORD) * count); 389 procs = malloc(sizeof(DWORD) * count);
386 rcount = GetConsoleProcessList(procs, count); 390 rcount = GetConsoleProcessList(procs, count);