deps: cherry-pick e7f4e9e from upstream libuv · nodejs/node@b98fa82

Original file line numberDiff line numberDiff line change

@@ -2285,13 +2285,16 @@ static DWORD WINAPI uv__tty_console_resize_message_loop_thread(void* param) {

22852285

uv__tty_console_width = sb_info.dwSize.X;

22862286

uv__tty_console_height = sb_info.srWindow.Bottom - sb_info.srWindow.Top + 1;

22872287
2288-

if (!SetWinEventHook(EVENT_CONSOLE_LAYOUT,

2289-

EVENT_CONSOLE_LAYOUT,

2290-

NULL,

2291-

uv__tty_console_resize_event,

2292-

0,

2293-

0,

2294-

WINEVENT_OUTOFCONTEXT))

2288+

if (pSetWinEventHook == NULL)

2289+

return 0;

2290+
2291+

if (!pSetWinEventHook(EVENT_CONSOLE_LAYOUT,

2292+

EVENT_CONSOLE_LAYOUT,

2293+

NULL,

2294+

uv__tty_console_resize_event,

2295+

0,

2296+

0,

2297+

WINEVENT_OUTOFCONTEXT))

22952298

return 0;

22962299
22972300

while (GetMessage(&msg, NULL, 0, 0)) {