From 130197b8c274d527d50353a8b81d8c183c761e86 Mon Sep 17 00:00:00 2001 From: Thomas Weidenmueller Date: Tue, 14 Dec 2004 11:47:46 +0000 Subject: [PATCH] MessageBoxIndirectA() should check whether the MB_USERICON bit is set to prevent an exception. --- windows/msgbox.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/windows/msgbox.c b/windows/msgbox.c index fddbf4cb0f0..fb5ce9bf0d5 100644 --- a/windows/msgbox.c +++ b/windows/msgbox.c @@ -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;