aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/installer
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-10-14 22:41:36 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2021-10-16 12:01:38 -0600
commit74b8c3cb9f75e4f53018e4cf21d295a47e8f164f (patch)
treead29a2c217207b1e2659c686c931bf1f8d801640 /installer
parentembeddable-dll-service: remove named pipe mention from README (diff)
downloadwireguard-windows-74b8c3cb9f75e4f53018e4cf21d295a47e8f164f.tar.xz
wireguard-windows-74b8c3cb9f75e4f53018e4cf21d295a47e8f164f.zip
installer: cast to farproc instead of other way around
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'installer')
-rw-r--r--installer/customactions.c2
-rw-r--r--installer/fetcher/systeminfo.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/installer/customactions.c b/installer/customactions.c
index b16e9aa4..66fa4610 100644
--- a/installer/customactions.c
+++ b/installer/customactions.c
@@ -96,7 +96,7 @@ __declspec(dllexport) UINT __stdcall CheckWow64(MSIHANDLE installer)
log_errorf(installer, LOG_LEVEL_ERR, ret, TEXT("Failed to get kernel32.dll handle"));
goto out;
}
- IsWow64Process2 = (void *)GetProcAddress(kernel32, "IsWow64Process2");
+ *(FARPROC *)&IsWow64Process2 = GetProcAddress(kernel32, "IsWow64Process2");
if (IsWow64Process2) {
if (!IsWow64Process2(GetCurrentProcess(), &process_machine, &native_machine)) {
ret = GetLastError();
diff --git a/installer/fetcher/systeminfo.c b/installer/fetcher/systeminfo.c
index 2281226b..0132196a 100644
--- a/installer/fetcher/systeminfo.c
+++ b/installer/fetcher/systeminfo.c
@@ -25,7 +25,7 @@ const char *architecture(void)
kernel32 = GetModuleHandleA("kernel32.dll");
if (!kernel32)
return NULL;
- IsWow64Process2 = (void *)GetProcAddress(kernel32, "IsWow64Process2");
+ *(FARPROC *)&IsWow64Process2 = GetProcAddress(kernel32, "IsWow64Process2");
if (IsWow64Process2) {
if (!IsWow64Process2(GetCurrentProcess(), &process_machine, &native_machine))
return NULL;