From 17805a4b24857d51b809db38cfae0d6b1563cbad Mon Sep 17 00:00:00 2001 From: praydog Date: Thu, 4 Jan 2024 12:56:00 -0800 Subject: [PATCH] DInputHook: GUID memcmp instead --- src/hooks/DInputHook.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/DInputHook.cpp b/src/hooks/DInputHook.cpp index f86803fc..700eddad 100644 --- a/src/hooks/DInputHook.cpp +++ b/src/hooks/DInputHook.cpp @@ -91,7 +91,7 @@ HRESULT WINAPI DInputHook::create_hooked( auto iface = (LPDIRECTINPUT8W)*ppvOut; // TODO: IID_IDirectInput8A or we don't care? - if (iface != nullptr && riidltf == IID_IDirectInput8W) { + if (iface != nullptr && memcmp(&riidltf, &IID_IDirectInput8W, sizeof(GUID)) == 0) { // Its not necessary to make a full blown vtable hook for this because // the vtable will always be the same for IDirectInput8W if (g_dinput_hook->m_enum_devices_hook == nullptr) {