Module: wine Branch: master Commit: d51a6b673c22ad31321822bcb1c9a9ed0675eca0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d51a6b673c22ad31321822bcb1...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Dec 23 17:11:53 2009 +0100
user32: Don't pass the 16-bit instance through to 32-bit MessageBoxIndirectA.
---
dlls/user.exe16/window.c | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/dlls/user.exe16/window.c b/dlls/user.exe16/window.c index c746a1f..244924f 100644 --- a/dlls/user.exe16/window.c +++ b/dlls/user.exe16/window.c @@ -23,6 +23,9 @@ #include "user_private.h" #include "wine/list.h" #include "wine/server.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(win);
/* size of buffer needed to store an atom string */ #define ATOM_BUFFER_SIZE 256 @@ -2099,17 +2102,37 @@ INT16 WINAPI SetWindowRgn16( HWND16 hwnd, HRGN16 hrgn, BOOL16 redraw ) */ INT16 WINAPI MessageBoxIndirect16( LPMSGBOXPARAMS16 msgbox ) { + char caption[256], text[256]; MSGBOXPARAMSA msgbox32;
msgbox32.cbSize = msgbox->cbSize; msgbox32.hwndOwner = WIN_Handle32( msgbox->hwndOwner ); - msgbox32.hInstance = HINSTANCE_32(msgbox->hInstance); - msgbox32.lpszText = MapSL(msgbox->lpszText); - msgbox32.lpszCaption = MapSL(msgbox->lpszCaption); + msgbox32.hInstance = 0; msgbox32.dwStyle = msgbox->dwStyle; - msgbox32.lpszIcon = MapSL(msgbox->lpszIcon); + msgbox32.lpszIcon = NULL; msgbox32.dwContextHelpId = msgbox->dwContextHelpId; msgbox32.lpfnMsgBoxCallback = msgbox->lpfnMsgBoxCallback; msgbox32.dwLanguageId = msgbox->dwLanguageId; + + if (!HIWORD(msgbox->lpszCaption)) + { + LoadString16( msgbox->hInstance, LOWORD(msgbox->lpszCaption), caption, sizeof(caption) ); + msgbox32.lpszCaption = caption; + } + else msgbox32.lpszCaption = MapSL(msgbox->lpszCaption); + + if (!HIWORD(msgbox->lpszText)) + { + LoadString16( msgbox->hInstance, LOWORD(msgbox->lpszText), text, sizeof(text) ); + msgbox32.lpszText = text; + } + else msgbox32.lpszText = MapSL(msgbox->lpszText); + + if ((msgbox->dwStyle & MB_ICONMASK) == MB_USERICON) + { + FIXME( "user icon %s not supported\n", debugstr_a( MapSL(msgbox->lpszIcon) )); + msgbox32.dwStyle &= ~MB_USERICON; + } + return MessageBoxIndirectA( &msgbox32 ); }