From bf0433085ec095f5797d80b1744e135907b92cb9 Mon Sep 17 00:00:00 2001
From: Steven Casper <[EMAIL REDACTED]>
Date: Fri, 23 Oct 2026 16:14:04 -0700
Subject: [PATCH] Fix GameInputInitialize crash on 32bit
GameInputIntiailize is an STDAPI function, which uses a __stdcall
convention. On 64 bit __stdcall is ignored but on 32 bit the
default calling convention is __cdecl. This results in the stack getting
corrupted and GameInputCreateWithVersion returns to a garbage address.
---
src/core/windows/gameinput/gameinput.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/windows/gameinput/gameinput.cpp b/src/core/windows/gameinput/gameinput.cpp
index 2d88c4e501663..d92ea750105b0 100644
--- a/src/core/windows/gameinput/gameinput.cpp
+++ b/src/core/windows/gameinput/gameinput.cpp
@@ -606,7 +606,7 @@ static HRESULT GameInputCreateWithVersion(
RETURN_IF_FAILED(LoadGameInputDll(&g_gameInputDll));
}
- typedef HRESULT (*GameInputInitializeFn)(
+ typedef HRESULT (__stdcall *GameInputInitializeFn)(
_In_ REFIID riid,
_COM_Outptr_ LPVOID* ppv);