[PATCH] must init MONITORINFO.cbSize

Marcus Meissner marcus at jet.franken.de
Sun Aug 12 11:08:48 CDT 2007


tracking a regression in MessageBox handling causing
spurious traces with WINPROC_wrapper in them converged
on:

$ git bisect good
ddb4be2bb0d03ec9a6beccfcb688844087a4f0ea is first bad commit
commit ddb4be2bb0d03ec9a6beccfcb688844087a4f0ea
Author: Markus Gömmel <m.goemmel at compulab.de>
Date:   Fri Jun 22 13:53:30 2007 +0200

    user32: Center MessageBox dialogs to desktop, as Windows does.

:040000 040000 ee079c7edf0f91859da75d916555ebc6e139a4ec 20027a3bc0036fd081da08ac8b170e8cf6237f1a M      dlls
$ 

Well, yes.

You need to initialize MONITORINFO.cbSize.
I reviewed the other GetMonitorInfos, they looked ok.

Ciao, Marcus
---
 dlls/user32/msgbox.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c
index 1353d6b..95d98a9 100644
--- a/dlls/user32/msgbox.c
+++ b/dlls/user32/msgbox.c
@@ -248,6 +248,7 @@ static HFONT MSGBOX_OnInit(HWND hwnd, LP
 
     /* Message boxes are always desktop centered, so query desktop size and center window */
     monitor = MonitorFromWindow(lpmb->hwndOwner ? lpmb->hwndOwner : GetActiveWindow(), MONITOR_DEFAULTTOPRIMARY);
+    mon_info.cbSize = sizeof(mon_info);
     GetMonitorInfoW(monitor, &mon_info);
     wleft = (mon_info.rcWork.left + mon_info.rcWork.right - wwidth) / 2;
     wtop = (mon_info.rcWork.top + mon_info.rcWork.bottom - wheight) / 2;
-- 
1.4.3.4



More information about the wine-patches mailing list