No subject


Tue Aug 30 15:12:41 CDT 2005


MessageBoxIndirectA() should check whether the MB_USERICON bit was set, 
otherwise in case the lpszIcon field of the MSGBOXPARAMS structure, the 
application passed to it, was never initialized and is not being 
interpreted as an atom, it takes this random pointer and tries to 
convert the string to unicode - which might cause an exception.

Changelog:
"Thomas Weidenmueller" <w3seek at reactos.org>
MessageBoxIndirectA() should check whether the MB_USERICON bit is set
to prevent an exception.



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250
--0-225619445-1102999708=:54554
Content-Type: text/x-patch; name="msgbox.diff"
Content-Description: msgbox.diff
Content-Disposition: inline; filename="msgbox.diff"

Index: wine/windows/msgbox.c
===================================================================
RCS file: /home/wine/wine/windows/msgbox.c,v
retrieving revision 1.53
diff -u -r1.53 msgbox.c
--- wine/windows/msgbox.c	8 Dec 2004 18:06:14 -0000	1.53
+++ wine/windows/msgbox.c	14 Dec 2004 05:34:10 -0000
@@ -427,10 +427,15 @@
         RtlCreateUnicodeStringFromAsciiz(&captionW, msgbox->lpszCaption);
     else
         captionW.Buffer = (LPWSTR)msgbox->lpszCaption;
-    if (HIWORD(msgbox->lpszIcon))
-        RtlCreateUnicodeStringFromAsciiz(&iconW, msgbox->lpszIcon);
+    if (msgbox->dwStyle & MB_USERICON)
+    {
+        if (HIWORD(msgbox->lpszIcon))
+            RtlCreateUnicodeStringFromAsciiz(&iconW, msgbox->lpszIcon);
+        else
+            iconW.Buffer = (LPWSTR)msgbox->lpszIcon;
+    }
     else
-        iconW.Buffer = (LPWSTR)msgbox->lpszIcon;
+        iconW.Buffer = NULL;
 
     msgboxW.cbSize = sizeof(msgboxW);
     msgboxW.hwndOwner = msgbox->hwndOwner;
@@ -447,7 +452,9 @@
 
     if (HIWORD(textW.Buffer)) RtlFreeUnicodeString(&textW);
     if (HIWORD(captionW.Buffer)) RtlFreeUnicodeString(&captionW);
-    if (HIWORD(iconW.Buffer)) RtlFreeUnicodeString(&iconW);
+    if ((msgbox->dwStyle & MB_USERICON) && HIWORD(iconW.Buffer))
+        RtlFreeUnicodeString(&iconW);
+
     return ret;
 }
 

--0-225619445-1102999708=:54554--



More information about the wine-patches mailing list