aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-10-15 00:43:52 +0000
committerJason A. Donenfeld <Jason@zx2c4.com>2021-10-15 00:43:52 +0000
commit6e579cf4f840aa90d7315bbe279bfc91d92b5897 (patch)
tree531f40aeedf4ec4d77e7ed128dc919129e5a04a1
parentexample: remove overly specific casts (diff)
downloadwintun-6e579cf4f840aa90d7315bbe279bfc91d92b5897.tar.xz
wintun-6e579cf4f840aa90d7315bbe279bfc91d92b5897.zip
api: main: avoid excessive function cast
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--api/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/api/main.c b/api/main.c
index 28937fa..032225e 100644
--- a/api/main.c
+++ b/api/main.c
@@ -89,13 +89,12 @@ static void EnvInit(VOID)
#endif
#ifdef MAYBE_WOW64
- typedef BOOL(WINAPI * IsWow64Process2_t)(
- _In_ HANDLE hProcess, _Out_ USHORT * pProcessMachine, _Out_opt_ USHORT * pNativeMachine);
HANDLE Kernel32;
- IsWow64Process2_t IsWow64Process2;
+ BOOL(WINAPI * IsWow64Process2)
+ (_In_ HANDLE Process, _Out_ USHORT * ProcessMachine, _Out_opt_ USHORT * NativeMachine);
USHORT ProcessMachine;
if ((Kernel32 = GetModuleHandleW(L"kernel32.dll")) == NULL ||
- (IsWow64Process2 = (IsWow64Process2_t)GetProcAddress(Kernel32, "IsWow64Process2")) == NULL ||
+ (*(FARPROC *)&IsWow64Process2 = GetProcAddress(Kernel32, "IsWow64Process2")) == NULL ||
!IsWow64Process2(GetCurrentProcess(), &ProcessMachine, &NativeMachine))
{
BOOL IsWoW64;