Module: wine Branch: master Commit: b201a41edf29386074f6b1c410d00254344994b8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=b201a41edf29386074f6b1c410...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Dec 22 18:09:30 2009 +0100
user32: Export the WIN_GetFullHandle function through the WoW handlers.
---
dlls/user32/comm16.c | 2 +- dlls/user32/controls.h | 6 ++++++ dlls/user32/hook16.c | 2 +- dlls/user32/win.c | 12 ++++++------ dlls/user32/win.h | 8 +------- dlls/user32/winproc.c | 1 + 6 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/dlls/user32/comm16.c b/dlls/user32/comm16.c index 46f72c6..072b8bd 100644 --- a/dlls/user32/comm16.c +++ b/dlls/user32/comm16.c @@ -63,7 +63,7 @@ #include "windef.h" #include "winbase.h" #include "wine/winuser16.h" -#include "win.h" +#include "controls.h" #include "user_private.h"
#include "wine/debug.h" diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index 65269c5..ae964b8 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -115,6 +115,7 @@ struct wow_handlers32 LRESULT (*scrollbar_proc)(HWND,UINT,WPARAM,LPARAM,BOOL); LRESULT (*static_proc)(HWND,UINT,WPARAM,LPARAM,BOOL); HWND (*create_window)(CREATESTRUCTW*,LPCWSTR,HINSTANCE,UINT); + HWND (*get_win_handle)(HWND); WNDPROC (*alloc_winproc)(WNDPROC,BOOL); struct tagDIALOGINFO *(*get_dialog_info)(HWND,BOOL); INT (*dialog_box_loop)(HWND,HWND); @@ -137,6 +138,11 @@ extern void free_module_classes(HINSTANCE16) DECLSPEC_HIDDEN; extern void register_wow_handlers(void) DECLSPEC_HIDDEN; extern void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wow_handlers32 *orig ); +static inline HWND WIN_Handle32( HWND16 hwnd16 ) +{ + return wow_handlers32.get_win_handle( (HWND)(ULONG_PTR)hwnd16 ); +} +
/* Class functions */ struct tagCLASS; /* opaque structure */ diff --git a/dlls/user32/hook16.c b/dlls/user32/hook16.c index 17d187d..cdea60f 100644 --- a/dlls/user32/hook16.c +++ b/dlls/user32/hook16.c @@ -28,7 +28,7 @@ #include "winuser.h" #include "wownt32.h" #include "wine/winuser16.h" -#include "win.h" +#include "controls.h" #include "user_private.h" #include "wine/debug.h"
diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 393c562..6ce524c 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -524,18 +524,18 @@ HWND WIN_IsCurrentThread( HWND hwnd )
/*********************************************************************** - * WIN_Handle32 + * WIN_GetFullHandle * - * Convert a 16-bit window handle to a full 32-bit handle. + * Convert a possibly truncated window handle to a full 32-bit handle. */ -HWND WIN_Handle32( HWND16 hwnd16 ) +HWND WIN_GetFullHandle( HWND hwnd ) { WND *ptr; - HWND hwnd = (HWND)(ULONG_PTR)hwnd16;
- if (hwnd16 <= 1 || hwnd16 == 0xffff) return hwnd; + if (!hwnd || (ULONG_PTR)hwnd >> 16) return hwnd; + if (LOWORD(hwnd) <= 1 || LOWORD(hwnd) == 0xffff) return hwnd; /* do sign extension for -2 and -3 */ - if (hwnd16 >= (HWND16)-3) return (HWND)(LONG_PTR)(INT16)hwnd16; + if (LOWORD(hwnd) >= (WORD)-3) return (HWND)(LONG_PTR)(INT16)LOWORD(hwnd);
if (!(ptr = WIN_GetPtr( hwnd ))) return hwnd;
diff --git a/dlls/user32/win.h b/dlls/user32/win.h index ab37e3e..f764d89 100644 --- a/dlls/user32/win.h +++ b/dlls/user32/win.h @@ -79,7 +79,7 @@ typedef struct tagWND extern HWND get_hwnd_message_parent(void) DECLSPEC_HIDDEN; extern BOOL is_desktop_window( HWND hwnd ) DECLSPEC_HIDDEN; extern WND *WIN_GetPtr( HWND hwnd ) DECLSPEC_HIDDEN; -extern HWND WIN_Handle32( HWND16 hwnd16 ) DECLSPEC_HIDDEN; +extern HWND WIN_GetFullHandle( HWND hwnd ) DECLSPEC_HIDDEN; extern HWND WIN_IsCurrentProcess( HWND hwnd ) DECLSPEC_HIDDEN; extern HWND WIN_IsCurrentThread( HWND hwnd ) DECLSPEC_HIDDEN; extern HWND WIN_SetOwner( HWND hwnd, HWND owner ) DECLSPEC_HIDDEN; @@ -98,12 +98,6 @@ extern HDESK open_winstation_desktop( HWINSTA hwinsta, LPCWSTR name, DWORD flags extern void USER_Lock(void) DECLSPEC_HIDDEN; extern void USER_Unlock(void) DECLSPEC_HIDDEN;
-static inline HWND WIN_GetFullHandle( HWND hwnd ) -{ - if (!HIWORD(hwnd) && hwnd) hwnd = WIN_Handle32( LOWORD(hwnd) ); - return hwnd; -} - /* to release pointers retrieved by WIN_GetPtr */ static inline void WIN_ReleasePtr( WND *ptr ) { diff --git a/dlls/user32/winproc.c b/dlls/user32/winproc.c index c38c087..b84abb5 100644 --- a/dlls/user32/winproc.c +++ b/dlls/user32/winproc.c @@ -1168,6 +1168,7 @@ void WINAPI UserRegisterWowHandlers( const struct wow_handlers16 *new, struct wo orig->scrollbar_proc = ScrollBarWndProc_common; orig->static_proc = StaticWndProc_common; orig->create_window = WIN_CreateWindowEx; + orig->get_win_handle = WIN_GetFullHandle; orig->alloc_winproc = WINPROC_AllocProc; orig->get_dialog_info = DIALOG_get_info; orig->dialog_box_loop = DIALOG_DoDialogBox;