[PATCH v2 1/4] windows.gaming.input: Add stub dll.

Rémi Bernon rbernon at codeweavers.com
Fri Aug 21 01:58:32 CDT 2020


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---

v2: Split the patch, moved IAgileObject to objidl.idl, rename channel
to "input", rename dll folder.

This DLL is used by Death Stranding to enumerate gamepads on startup.
It queries these interfaces using the Ro* api, and tries to iterate over
the gamepads through the IVectorView interface.

Stubbing everything so that the calls return an empty gamepad list is
enough to make the game start, and gamepad input then even works.

 configure.ac                                  |  1 +
 dlls/windows.gaming.input.dll/Makefile.in     |  7 +++
 .../windows.gaming.input.spec                 |  3 ++
 .../windows.gaming.input_main.c               | 54 +++++++++++++++++++
 4 files changed, 65 insertions(+)
 create mode 100644 dlls/windows.gaming.input.dll/Makefile.in
 create mode 100644 dlls/windows.gaming.input.dll/windows.gaming.input.spec
 create mode 100644 dlls/windows.gaming.input.dll/windows.gaming.input_main.c

diff --git a/configure.ac b/configure.ac
index 13adf2da7eb..c092dca9177 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3835,6 +3835,7 @@ WINE_CONFIG_MAKEFILE(dlls/win32s16.dll16,enable_win16)
 WINE_CONFIG_MAKEFILE(dlls/win87em.dll16,enable_win16)
 WINE_CONFIG_MAKEFILE(dlls/winaspi.dll16,enable_win16)
 WINE_CONFIG_MAKEFILE(dlls/windebug.dll16,enable_win16)
+WINE_CONFIG_MAKEFILE(dlls/windows.gaming.input.dll)
 WINE_CONFIG_MAKEFILE(dlls/windowscodecs)
 WINE_CONFIG_MAKEFILE(dlls/windowscodecs/tests)
 WINE_CONFIG_MAKEFILE(dlls/windowscodecsext)
diff --git a/dlls/windows.gaming.input.dll/Makefile.in b/dlls/windows.gaming.input.dll/Makefile.in
new file mode 100644
index 00000000000..782d81ad346
--- /dev/null
+++ b/dlls/windows.gaming.input.dll/Makefile.in
@@ -0,0 +1,7 @@
+MODULE    = windows.gaming.input.dll
+IMPORTS   = combase uuid
+
+EXTRADLLFLAGS = -mno-cygwin
+
+C_SRCS = \
+	windows.gaming.input_main.c
diff --git a/dlls/windows.gaming.input.dll/windows.gaming.input.spec b/dlls/windows.gaming.input.dll/windows.gaming.input.spec
new file mode 100644
index 00000000000..20a8bfa98ea
--- /dev/null
+++ b/dlls/windows.gaming.input.dll/windows.gaming.input.spec
@@ -0,0 +1,3 @@
+@ stdcall -private DllCanUnloadNow()
+@ stdcall -private DllGetActivationFactory(ptr ptr)
+@ stdcall -private DllGetClassObject(ptr ptr ptr)
diff --git a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
new file mode 100644
index 00000000000..3c12a83e6b2
--- /dev/null
+++ b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
@@ -0,0 +1,54 @@
+#include <stdarg.h>
+
+#define COBJMACROS
+#include "windef.h"
+#include "winbase.h"
+#include "winstring.h"
+#include "wine/debug.h"
+#include "activation.h"
+#include "objbase.h"
+#include "initguid.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(input);
+
+static const char *debugstr_hstring(HSTRING hstr)
+{
+    const WCHAR *str;
+    UINT32 len;
+    if (hstr && !((ULONG_PTR)hstr >> 16)) return "(invalid)";
+    str = WindowsGetStringRawBuffer(hstr, &len);
+    return wine_dbgstr_wn(str, len);
+}
+
+BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, void *reserved)
+{
+    TRACE("(%p, %u, %p)\n", instance, reason, reserved);
+
+    switch (reason)
+    {
+    case DLL_WINE_PREATTACH:
+        return FALSE;    /* prefer native version */
+    case DLL_PROCESS_ATTACH:
+        DisableThreadLibraryCalls(instance);
+        break;
+    }
+
+    return TRUE;
+}
+
+HRESULT WINAPI DllCanUnloadNow(void)
+{
+    return S_FALSE;
+}
+
+HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID riid, LPVOID *object)
+{
+    FIXME("clsid %s, riid %s, object %p stub!\n", debugstr_guid(clsid), debugstr_guid(riid), object);
+    return CLASS_E_CLASSNOTAVAILABLE;
+}
+
+HRESULT WINAPI DllGetActivationFactory(HSTRING classid, IActivationFactory **factory)
+{
+    FIXME("classid %s, factory %p stub!\n", debugstr_hstring(classid), factory);
+    return E_NOINTERFACE;
+}
-- 
2.28.0




More information about the wine-devel mailing list