[PATCH 5/5] winebus.sys: Move fastcall wrapper together with the functions.
Rémi Bernon
rbernon at codeweavers.com
Mon Sep 20 02:37:07 CDT 2021
As in https://bugs.winehq.org/show_bug.cgi?id=47751, the .text directive
sometimes makes the global variables go in the wrong section.
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
Reported by Bernhard Übelacker, non-mingw builds are crashing in
RtlEnterCriticalSection(&device_list_cs), and this is possibly related,
according to 0c853f026578dd7c8aede2f716c8e55d816ccf40, although I didn't
reproduce the problem.
dlls/winebus.sys/main.c | 29 ++++++++++++-----------------
1 file changed, 12 insertions(+), 17 deletions(-)
diff --git a/dlls/winebus.sys/main.c b/dlls/winebus.sys/main.c
index ffe54fcbf87..b5130a7908e 100644
--- a/dlls/winebus.sys/main.c
+++ b/dlls/winebus.sys/main.c
@@ -41,23 +41,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(plugplay);
WINE_DECLARE_DEBUG_CHANNEL(hid_report);
-#if defined(__i386__) && !defined(_WIN32)
-
-extern void * WINAPI wrap_fastcall_func1( void *func, const void *a );
-__ASM_STDCALL_FUNC( wrap_fastcall_func1, 8,
- "popl %ecx\n\t"
- "popl %eax\n\t"
- "xchgl (%esp),%ecx\n\t"
- "jmp *%eax" );
-
-#define call_fastcall_func1(func,a) wrap_fastcall_func1(func,a)
-
-#else
-
-#define call_fastcall_func1(func,a) func(a)
-
-#endif
-
static DRIVER_OBJECT *driver_obj;
static DEVICE_OBJECT *mouse_obj;
@@ -359,6 +342,18 @@ static void bus_unlink_hid_device(DEVICE_OBJECT *device)
RtlLeaveCriticalSection(&device_list_cs);
}
+#if defined(__i386__) && !defined(_WIN32)
+extern void * WINAPI wrap_fastcall_func1(void *func, const void *a);
+__ASM_STDCALL_FUNC(wrap_fastcall_func1, 8,
+ "popl %ecx\n\t"
+ "popl %eax\n\t"
+ "xchgl (%esp),%ecx\n\t"
+ "jmp *%eax");
+#define call_fastcall_func1(func,a) wrap_fastcall_func1(func,a)
+#else
+#define call_fastcall_func1(func,a) func(a)
+#endif
+
static NTSTATUS build_device_relations(DEVICE_RELATIONS **devices)
{
struct device_extension *ext;
--
2.33.0
More information about the wine-devel
mailing list