winex11-MONITORENUMPROC: Rebase and move code to user32.

This commit is contained in:
Sebastian Lackner 2016-03-25 22:50:15 +01:00
parent 5cc96d631e
commit 980743ad37
5 changed files with 53 additions and 86 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "47cf3fe36d4f5a2f83c0d48ee763c256cd6010c5"
echo "4315caeff699325cd681b9beb7d22908b098411b"
}
# Show version information
@ -326,6 +326,7 @@ patch_enable_all ()
enable_user32_DeferWindowPos="$1"
enable_user32_Dialog_Paint_Event="$1"
enable_user32_DrawTextExW="$1"
enable_user32_EnumDisplayMonitors="$1"
enable_user32_GetSystemMetrics="$1"
enable_user32_Invalidate_Key_State="$1"
enable_user32_ListBox_Size="$1"
@ -373,7 +374,6 @@ patch_enable_all ()
enable_winex11_CandidateWindowPos="$1"
enable_winex11_Clipboard_HTML="$1"
enable_winex11_DefaultDisplayFrequency="$1"
enable_winex11_MONITORENUMPROC="$1"
enable_winex11_Window_Groups="$1"
enable_winex11_Window_Style="$1"
enable_winex11_XEMBED="$1"
@ -1153,6 +1153,9 @@ patch_enable ()
user32-DrawTextExW)
enable_user32_DrawTextExW="$2"
;;
user32-EnumDisplayMonitors)
enable_user32_EnumDisplayMonitors="$2"
;;
user32-GetSystemMetrics)
enable_user32_GetSystemMetrics="$2"
;;
@ -1294,9 +1297,6 @@ patch_enable ()
winex11-DefaultDisplayFrequency)
enable_winex11_DefaultDisplayFrequency="$2"
;;
winex11-MONITORENUMPROC)
enable_winex11_MONITORENUMPROC="$2"
;;
winex11-Window_Groups)
enable_winex11_Window_Groups="$2"
;;
@ -6701,6 +6701,21 @@ if test "$enable_user32_DrawTextExW" -eq 1; then
) >> "$patchlist"
fi
# Patchset user32-EnumDisplayMonitors
# |
# | This patchset fixes the following Wine bugs:
# | * [#24421] Set %ecx to address of rect in EnumDisplayMonitors callback
# |
# | Modified files:
# | * dlls/user32/misc.c
# |
if test "$enable_user32_EnumDisplayMonitors" -eq 1; then
patch_apply user32-EnumDisplayMonitors/0001-user32-Set-ecx-to-address-of-rect-in-EnumDisplayMoni.patch
(
echo '+ { "Sebastian Lackner", "user32: Set %ecx to address of rect in EnumDisplayMonitors callback.", 1 },';
) >> "$patchlist"
fi
# Patchset user32-GetSystemMetrics
# |
# | This patchset fixes the following Wine bugs:
@ -7387,21 +7402,6 @@ if test "$enable_winex11_DefaultDisplayFrequency" -eq 1; then
) >> "$patchlist"
fi
# Patchset winex11-MONITORENUMPROC
# |
# | This patchset fixes the following Wine bugs:
# | * [#24421] Use assembler wrapper to call MONITORENUMPROC callback
# |
# | Modified files:
# | * dlls/winex11.drv/xinerama.c
# |
if test "$enable_winex11_MONITORENUMPROC" -eq 1; then
patch_apply winex11-MONITORENUMPROC/0001-winex11.drv-Use-assembler-wrapper-to-call-MONITORENU.patch
(
echo '+ { "Sebastian Lackner", "winex11.drv: Use assembler wrapper to call MONITORENUMPROC callback.", 1 },';
) >> "$patchlist"
fi
# Patchset winex11-Window_Groups
# |
# | This patchset fixes the following Wine bugs:

View File

@ -0,0 +1,32 @@
From 3c1402c7476be339a313f7603439b42f471a4b12 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 25 Mar 2016 22:46:15 +0100
Subject: user32: Set %ecx to address of rect in EnumDisplayMonitors callback.
---
dlls/user32/misc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dlls/user32/misc.c b/dlls/user32/misc.c
index 109809f..54be9c9 100644
--- a/dlls/user32/misc.c
+++ b/dlls/user32/misc.c
@@ -471,6 +471,7 @@ BOOL WINAPI GetMonitorInfoW(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo)
#ifdef __i386__
/* Some apps pass a non-stdcall callback to EnumDisplayMonitors,
* so we need a small assembly wrapper to call it.
+ * MJ's Help Diagnostic expects that %ecx contains the address to rect.
*/
struct enumdisplaymonitors_lparam
{
@@ -491,6 +492,7 @@ __ASM_STDCALL_FUNC( enumdisplaymonitors_callback_wrapper, 16,
"pushl 16(%ebp)\n\t"
"pushl 12(%ebp)\n\t"
"pushl 8(%ebp)\n\t"
+ "movl 16(%ebp),%ecx\n\t"
"call *(%eax)\n\t" /* call orig->proc */
"leave\n\t"
__ASM_CFI(".cfi_def_cfa %esp,4\n\t")
--
2.7.1

View File

@ -0,0 +1 @@
Fixes: [24421] Set %ecx to address of rect in EnumDisplayMonitors callback

View File

@ -1,65 +0,0 @@
From c02ba27cd7b2a59b3ad636184602077048dce128 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 12 Feb 2016 00:08:32 +0100
Subject: winex11.drv: Use assembler wrapper to call MONITORENUMPROC callback.
---
dlls/winex11.drv/xinerama.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c
index 7e28726..93fb9be 100644
--- a/dlls/winex11.drv/xinerama.c
+++ b/dlls/winex11.drv/xinerama.c
@@ -243,6 +243,30 @@ BOOL CDECL X11DRV_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info )
return TRUE;
}
+#ifdef __i386__
+/* MJ's Help Diagnostic expects that %ecx contains the address to rect,
+ * so we need a small assembly wrapper to call the proc. */
+extern BOOL enum_monitor_wrapper( void *callback, HMONITOR monitor, HDC hdc, RECT *rect, LPARAM data );
+__ASM_GLOBAL_FUNC( enum_monitor_wrapper,
+ "pushl %ebp\n\t"
+ __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
+ __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
+ "movl %esp,%ebp\n\t"
+ __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
+ "subl $8,%esp\n\t"
+ "pushl 24(%ebp)\n\t"
+ "pushl 20(%ebp)\n\t"
+ "pushl 16(%ebp)\n\t"
+ "pushl 12(%ebp)\n\t"
+ "movl 20(%ebp),%ecx\n\t"
+ "call *8(%ebp)\n\t"
+ "leave\n\t"
+ __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
+ __ASM_CFI(".cfi_same_value %ebp\n\t")
+ "ret" )
+#else
+#define enum_monitor_wrapper( callback, monitor, hdc, rect, data ) (callback)( (monitor), (hdc), (rect), (data) )
+#endif
/***********************************************************************
* X11DRV_EnumDisplayMonitors (X11DRV.@)
@@ -266,7 +290,7 @@ BOOL CDECL X11DRV_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC pro
RECT monrect = monitors[i].rcMonitor;
OffsetRect( &monrect, -origin.x, -origin.y );
if (IntersectRect( &monrect, &monrect, &limit ))
- if (!proc( index_to_monitor(i), hdc, &monrect, lp ))
+ if (!enum_monitor_wrapper( proc, index_to_monitor(i), hdc, &monrect, lp ))
return FALSE;
}
}
@@ -276,7 +300,7 @@ BOOL CDECL X11DRV_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC pro
{
RECT unused;
if (!rect || IntersectRect( &unused, &monitors[i].rcMonitor, rect ))
- if (!proc( index_to_monitor(i), 0, &monitors[i].rcMonitor, lp ))
+ if (!enum_monitor_wrapper( proc, index_to_monitor(i), 0, &monitors[i].rcMonitor, lp ))
return FALSE;
}
}
--
2.7.1

View File

@ -1 +0,0 @@
Fixes: [24421] Use assembler wrapper to call MONITORENUMPROC callback