diff --git a/src/input/dinput8.cpp b/src/input/dinput8.cpp index a0d3b6d43..7e8310c7f 100644 --- a/src/input/dinput8.cpp +++ b/src/input/dinput8.cpp @@ -1683,10 +1683,9 @@ SK_Input_HookDI8 (void) if (! config.input.gamepad.hook_dinput8) return; - static volatile LONG hooked = FALSE; - - if (SK_GetModuleHandle (L"dinput8.dll")) + if (SK_GetModuleHandle (L"dinput8.dll") && DirectInput8Create_Import == nullptr) { + static volatile LONG hooked = FALSE; if (! InterlockedCompareExchange (&hooked, TRUE, FALSE)) { if (SK_GetDLLRole () & DLL_ROLE::DInput8) @@ -1710,17 +1709,17 @@ SK_Input_HookDI8 (void) static_cast_p2p (&DirectInput8Create_Import) ); } - if (SK_GetModuleHandle (L"dinput.dll")) - { - SK_Input_HookDI7 (); - } - InterlockedIncrementRelease (&hooked); } else SK_Thread_SpinUntilAtomicMin (&hooked, 2); } + + if (SK_GetModuleHandle (L"dinput.dll")) + { + SK_Input_HookDI7 (); + } }