Skip to content
Permalink
Browse files

- fix querying for the wrong interface when the UNICODE define is set

  • Loading branch information...
dpjudas committed Jun 30, 2019
1 parent 6e29d81 commit 259909b6dd4e537703e7d9d4334b809519d5f03a
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/win32/i_input.cpp
@@ -650,7 +650,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);
@@ -676,7 +676,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)
{

0 comments on commit 259909b

Please sign in to comment.
You can’t perform that action at this time.