diff options
author | Bartosz Sosnowski <bartosz@janeasystems.com> | 2017-11-03 12:18:52 +0100 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-11-03 23:29:39 -0500 |
commit | 92f86632d534125aa7a86fe11a34d7b794b22991 (patch) | |
tree | 00e55f4e3563cb49e031f31c8e5af364490a7447 /deps/uv/src/win/tty.c | |
parent | a5f3b3a6dab18e32ee5e7d0d79a63cec0d5d5cc5 (diff) | |
download | android-node-v8-92f86632d534125aa7a86fe11a34d7b794b22991.tar.gz android-node-v8-92f86632d534125aa7a86fe11a34d7b794b22991.tar.bz2 android-node-v8-92f86632d534125aa7a86fe11a34d7b794b22991.zip |
deps: cherry-pick e7f4e9e from upstream libuv
Original commit message:
tty, win: get SetWinEventHook pointer at startup
SetWinEventHook is not available on some Windows versions.
Fixes: https://github.com/nodejs/node/issues/16603
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/16724
Fixes: https://github.com/https://github.com/nodejs/node/issues/16603
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'deps/uv/src/win/tty.c')
-rw-r--r-- | deps/uv/src/win/tty.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/deps/uv/src/win/tty.c b/deps/uv/src/win/tty.c index 4cd1c72129..05a11e8830 100644 --- a/deps/uv/src/win/tty.c +++ b/deps/uv/src/win/tty.c @@ -2285,13 +2285,16 @@ static DWORD WINAPI uv__tty_console_resize_message_loop_thread(void* param) { uv__tty_console_width = sb_info.dwSize.X; uv__tty_console_height = sb_info.srWindow.Bottom - sb_info.srWindow.Top + 1; - if (!SetWinEventHook(EVENT_CONSOLE_LAYOUT, - EVENT_CONSOLE_LAYOUT, - NULL, - uv__tty_console_resize_event, - 0, - 0, - WINEVENT_OUTOFCONTEXT)) + if (pSetWinEventHook == NULL) + return 0; + + if (!pSetWinEventHook(EVENT_CONSOLE_LAYOUT, + EVENT_CONSOLE_LAYOUT, + NULL, + uv__tty_console_resize_event, + 0, + 0, + WINEVENT_OUTOFCONTEXT)) return 0; while (GetMessage(&msg, NULL, 0, 0)) { |