user32: Export DIALOG_get_info and DIALOG_DoDialogBox through the WoW handlers.

This commit is contained in:
Alexandre Julliard 2009-12-22 17:57:42 +01:00
parent 7f11441af9
commit eb36bb2e47
5 changed files with 23 additions and 16 deletions

View File

@ -116,6 +116,8 @@ struct wow_handlers32
LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL);
HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,UINT);
WNDPROC (*alloc_winproc)(WNDPROC,BOOL);
struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL);
INT (*dialog_box_loop)(HWND,HWND);
};
extern struct wow_handlers16 wow_handlers DECLSPEC_HIDDEN;
@ -129,6 +131,7 @@ extern LRESULT ScrollBarWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HI
extern LRESULT StaticWndProc_common(HWND,UINT,WPARAM,LPARAM,BOOL) DECLSPEC_HIDDEN;
/* 16-bit support */
extern struct wow_handlers32 wow_handlers32 DECLSPEC_HIDDEN;
extern HWND create_window16(CREATESTRUCTW*,LPCWSTR,HINSTANCE,UINT) DECLSPEC_HIDDEN;
extern void free_module_classes(HINSTANCE16) DECLSPEC_HIDDEN;
extern void register_wow_handlers(void) DECLSPEC_HIDDEN;

View File

@ -177,7 +177,7 @@ static LPCSTR DIALOG_GetControl16( LPCSTR p, DLG_CONTROL_INFO *info )
static BOOL DIALOG_CreateControls16( HWND hwnd, LPCSTR template,
const DLG_TEMPLATE *dlgTemplate, HINSTANCE16 hInst )
{
DIALOGINFO *dlgInfo = DIALOG_get_info( hwnd, TRUE );
DIALOGINFO *dlgInfo = wow_handlers32.get_dialog_info( hwnd, TRUE );
DLG_CONTROL_INFO info;
HWND hwndCtrl, hwndDefButton = 0;
INT items = dlgTemplate->nbItems;
@ -441,7 +441,7 @@ static HWND DIALOG_CreateIndirect16( HINSTANCE16 hInst, LPCVOID dlgTemplate,
if (modal && (flags & DF_OWNERENABLED)) DIALOG_EnableOwner(owner);
return 0;
}
dlgInfo = DIALOG_get_info( hwnd, TRUE );
dlgInfo = wow_handlers32.get_dialog_info( hwnd, TRUE );
dlgInfo->hwndFocus = 0;
dlgInfo->hUserFont = hUserFont;
dlgInfo->hMenu = HMENU_32( hMenu );
@ -745,7 +745,7 @@ INT16 WINAPI DialogBoxParam16( HINSTANCE16 hInst, LPCSTR template,
{
HWND owner = WIN_Handle32(owner16);
hwnd = DIALOG_CreateIndirect16( hInst, data, owner, dlgProc, param, TRUE );
if (hwnd) ret = DIALOG_DoDialogBox( hwnd, owner );
if (hwnd) ret = wow_handlers32.dialog_box_loop( hwnd, owner );
GlobalUnlock16( hmem );
}
FreeResource16( hmem );
@ -765,7 +765,7 @@ INT16 WINAPI DialogBoxIndirectParam16( HINSTANCE16 hInst, HANDLE16 dlgTemplate,
if (!(ptr = GlobalLock16( dlgTemplate ))) return -1;
hwnd = DIALOG_CreateIndirect16( hInst, ptr, owner, dlgProc, param, TRUE );
GlobalUnlock16( dlgTemplate );
if (hwnd) return DIALOG_DoDialogBox( hwnd, owner );
if (hwnd) return wow_handlers32.dialog_box_loop( hwnd, owner );
return -1;
}

View File

@ -38,7 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(msg);
DWORD USER16_AlertableWait = 0;
static struct wow_handlers32 wow_handlers32;
struct wow_handlers32 wow_handlers32;
static LRESULT cwp_hook_callback( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
LRESULT *result, void *arg )

View File

@ -1169,6 +1169,8 @@ void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wo
orig->static_proc = StaticWndProc_common;
orig->create_window = WIN_CreateWindowEx;
orig->alloc_winproc = WINPROC_AllocProc;
orig->get_dialog_info = DIALOG_get_info;
orig->dialog_box_loop = DIALOG_DoDialogBox;
wow_handlers = *new;
}

View File

@ -848,7 +848,8 @@ LONG WINAPI GetWindowLong16( HWND16 hwnd16, INT16 offset )
return 0;
}
}
else if (offset == DWLP_DLGPROC) is_winproc = (DIALOG_get_info( hwnd, FALSE ) != NULL);
else if (offset == DWLP_DLGPROC)
is_winproc = (wow_handlers32.get_dialog_info( hwnd, FALSE ) != NULL);
}
retvalue = GetWindowLongA( hwnd, offset );
if (is_winproc) retvalue = (LONG_PTR)WINPROC_GetProc16( (WNDPROC)retvalue, FALSE );
@ -864,7 +865,8 @@ LONG WINAPI SetWindowLong16( HWND16 hwnd16, INT16 offset, LONG newval )
HWND hwnd = WIN_Handle32( hwnd16 );
BOOL is_winproc = (offset == GWLP_WNDPROC);
if (offset == DWLP_DLGPROC) is_winproc = (DIALOG_get_info( hwnd, FALSE ) != NULL);
if (offset == DWLP_DLGPROC)
is_winproc = (wow_handlers32.get_dialog_info( hwnd, FALSE ) != NULL);
if (is_winproc)
{