From fc38b6bbf97b7d622542b06b78c291abfefcd557 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 30 Jun 2019 21:13:56 +0200 Subject: [PATCH] - fix querying for the wrong interface when the UNICODE define is set --- src/win32/i_input.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index 0fa35babc..46d7c139d 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -674,7 +674,7 @@ bool I_InitInput (void *hwnd) blah di8c = (blah)GetProcAddress(DInputDLL, "DirectInput8Create"); if (di8c != NULL) { - hr = di8c(g_hInst, DIRECTINPUT_VERSION, IID_IDirectInput8A, (void **)&g_pdi, NULL); + hr = di8c(g_hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (void **)&g_pdi, NULL); if (FAILED(hr)) { Printf(TEXTCOLOR_ORANGE "DirectInput8Create failed: %08lx\n", hr); @@ -700,7 +700,11 @@ bool I_InitInput (void *hwnd) } typedef HRESULT (WINAPI *blah)(HINSTANCE, DWORD, LPDIRECTINPUT*, LPUNKNOWN); - blah dic = (blah)GetProcAddress (DInputDLL, "DirectInputCreateA"); +#ifdef UNICODE + blah dic = (blah)GetProcAddress (DInputDLL, "DirectInputCreateW"); +#else + blah dic = (blah)GetProcAddress(DInputDLL, "DirectInputCreateA"); +#endif if (dic == NULL) {