summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibuv/src/win/winapi.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-19 18:03:04 (GMT)
committerBrad King <brad.king@kitware.com>2018-01-19 18:03:04 (GMT)
commitb58d48c15f9ee18015960e2eed7410f5166c855f (patch)
tree640add606d5ca6c0a03f58589a7528eaa9511428 /Utilities/cmlibuv/src/win/winapi.c
parente8b57c2283f731f42b4c7eece0531dab67df3d41 (diff)
parentf4a26c748b5ea2cafecdf5490b744a2b167c01ae (diff)
downloadCMake-b58d48c15f9ee18015960e2eed7410f5166c855f.zip
CMake-b58d48c15f9ee18015960e2eed7410f5166c855f.tar.gz
CMake-b58d48c15f9ee18015960e2eed7410f5166c855f.tar.bz2
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv: libuv 2018-01-19 (63de1eca)
Diffstat (limited to 'Utilities/cmlibuv/src/win/winapi.c')
-rw-r--r--Utilities/cmlibuv/src/win/winapi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Utilities/cmlibuv/src/win/winapi.c b/Utilities/cmlibuv/src/win/winapi.c
index aa5d719..4ccdf0a 100644
--- a/Utilities/cmlibuv/src/win/winapi.c
+++ b/Utilities/cmlibuv/src/win/winapi.c
@@ -52,11 +52,15 @@ sGetFinalPathNameByHandleW pGetFinalPathNameByHandleW;
/* Powrprof.dll function pointer */
sPowerRegisterSuspendResumeNotification pPowerRegisterSuspendResumeNotification;
+/* User32.dll function pointer */
+sSetWinEventHook pSetWinEventHook;
+
void uv_winapi_init(void) {
HMODULE ntdll_module;
HMODULE kernel32_module;
HMODULE powrprof_module;
+ HMODULE user32_module;
ntdll_module = GetModuleHandleA("ntdll.dll");
if (ntdll_module == NULL) {
@@ -156,4 +160,10 @@ void uv_winapi_init(void) {
GetProcAddress(powrprof_module, "PowerRegisterSuspendResumeNotification");
}
+ user32_module = LoadLibraryA("user32.dll");
+ if (user32_module != NULL) {
+ pSetWinEventHook = (sSetWinEventHook)
+ GetProcAddress(user32_module, "SetWinEventHook");
+ }
+
}