MessageBoxIndirectA() should check whether the MB_USERICON bit is set

to prevent an exception.
oldstable
Thomas Weidenmueller 2004-12-14 11:47:46 +00:00 committed by Alexandre Julliard
parent 3e2af5d04f
commit 130197b8c2
1 changed files with 9 additions and 3 deletions

View File

@ -427,10 +427,16 @@ INT WINAPI MessageBoxIndirectA( LPMSGBOXPARAMSA msgbox )
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;