[PATCH 2/2] winusb: Add WinUsb_Free stub.

Mohamad Al-Jaf mohamadaljaf at gmail.com
Tue Mar 1 17:16:58 CST 2022


This allows the game Nickelodeon All-Star Brawl to run.

Proton-Issue: https://github.com/ValveSoftware/Proton/issues/5198
Signed-off-by: Mohamad Al-Jaf <mohamadaljaf at gmail.com>
---
Proton has disabled this dll to fix the issue. But seeing as
how it affects one game, it's not unreasonable to conclude
it may affect other games.

Since it can be disabled, this entire dll can likely be stubbed.
It probably won't affect games, but I'm not sure if applications
call other functions in this dll and expect an actual implementation.
Though, seeing as how it's still undeveloped, I'm guessing
it's not a very important dll.

I can add stubs in a separate patchset for the other functions
if the wine-dev team wants me to.

Also, I thought about adding heap_free(handle) to make this
into a semi-stub, but wouldn't that cause heap corruption
since the handle is not initialized? I'm not sure why
it's being called first and not the function that
initializes WINUSB_INTERFACE_HANDLE.
---
 dlls/winusb/Makefile.in |  5 +++++
 dlls/winusb/main.c      | 36 ++++++++++++++++++++++++++++++++++++
 dlls/winusb/winusb.spec |  2 +-
 3 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 dlls/winusb/main.c

diff --git a/dlls/winusb/Makefile.in b/dlls/winusb/Makefile.in
index c8cab4dbed9..b6f01a1346c 100644
--- a/dlls/winusb/Makefile.in
+++ b/dlls/winusb/Makefile.in
@@ -1 +1,6 @@
 MODULE    = winusb.dll
+
+EXTRADLLFLAGS = -Wb,--prefer-native
+
+C_SRCS = \
+	main.c
diff --git a/dlls/winusb/main.c b/dlls/winusb/main.c
new file mode 100644
index 00000000000..8376823d88f
--- /dev/null
+++ b/dlls/winusb/main.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2022 Mohamad Al-Jaf
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winusb.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(usb);
+
+/***********************************************************************
+ *           WinUsb_Free (winusb.@)
+ */
+BOOL WINAPI WinUsb_Free(WINUSB_INTERFACE_HANDLE handle)
+{
+    FIXME( "(%p) - stub\n", handle );
+    return TRUE;
+}
diff --git a/dlls/winusb/winusb.spec b/dlls/winusb/winusb.spec
index 09371e9ee46..a0b57d58096 100644
--- a/dlls/winusb/winusb.spec
+++ b/dlls/winusb/winusb.spec
@@ -1,7 +1,7 @@
 @ stub WinUsb_AbortPipe
 @ stub WinUsb_ControlTransfer
 @ stub WinUsb_FlushPipe
-@ stub WinUsb_Free
+@ stdcall WinUsb_Free(ptr)
 @ stub WinUsb_GetAssociatedInterface
 @ stub WinUsb_GetCurrentAlternateSetting
 @ stub WinUsb_GetDescriptor
-- 
2.35.1




More information about the wine-devel mailing list