Commit bde39137 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move IsWindow implementation from user32.

parent cb4c3b8d
......@@ -3063,26 +3063,7 @@ INT WINAPI GetWindowTextLengthW( HWND hwnd )
*/
BOOL WINAPI IsWindow( HWND hwnd )
{
WND *ptr;
BOOL ret;
if (!(ptr = WIN_GetPtr( hwnd ))) return FALSE;
if (ptr == WND_DESKTOP) return TRUE;
if (ptr != WND_OTHER_PROCESS)
{
WIN_ReleasePtr( ptr );
return TRUE;
}
/* check other processes */
SERVER_START_REQ( get_window_info )
{
req->handle = wine_server_user_handle( hwnd );
ret = !wine_server_call_err( req );
}
SERVER_END_REQ;
return ret;
return NtUserCallHwnd( hwnd, NtUserIsWindow );
}
......
......@@ -1150,6 +1150,7 @@ static struct unix_funcs unix_funcs =
NtGdiUpdateColors,
NtGdiWidenPath,
NtUserActivateKeyboardLayout,
NtUserCallHwnd,
NtUserCallHwndParam,
NtUserCallNextHookEx,
NtUserCallNoParam,
......
......@@ -768,7 +768,7 @@
@ stub NtUserBuildPropList
@ stub NtUserCalcMenuBar
@ stub NtUserCalculatePopupWindowPosition
@ stub NtUserCallHwnd
@ stdcall NtUserCallHwnd(long long)
@ stub NtUserCallHwndLock
@ stub NtUserCallHwndLockSafe
@ stub NtUserCallHwndOpt
......
......@@ -183,6 +183,7 @@ struct unix_funcs
BOOL (WINAPI *pNtGdiUpdateColors)( HDC hdc );
BOOL (WINAPI *pNtGdiWidenPath)( HDC hdc );
HKL (WINAPI *pNtUserActivateKeyboardLayout)( HKL layout, UINT flags );
DWORD (WINAPI *pNtUserCallHwnd)( HWND hwnd, DWORD code );
DWORD (WINAPI *pNtUserCallHwndParam)( HWND hwnd, DWORD_PTR param, DWORD code );
LRESULT (WINAPI *pNtUserCallNextHookEx)( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam );
ULONG_PTR (WINAPI *pNtUserCallNoParam)( ULONG code );
......
......@@ -247,6 +247,31 @@ HWND is_current_thread_window( HWND hwnd )
return ret;
}
/* see IsWindow */
static BOOL is_window( HWND hwnd )
{
WND *win;
BOOL ret;
if (!(win = get_win_ptr( hwnd ))) return FALSE;
if (win == WND_DESKTOP) return TRUE;
if (win != WND_OTHER_PROCESS)
{
release_win_ptr( win );
return TRUE;
}
/* check other processes */
SERVER_START_REQ( get_window_info )
{
req->handle = wine_server_user_handle( hwnd );
ret = !wine_server_call_err( req );
}
SERVER_END_REQ;
return ret;
}
/* see GetWindowThreadProcessId */
static DWORD get_window_thread( HWND hwnd, DWORD *process )
{
......@@ -401,6 +426,21 @@ NTSTATUS WINAPI NtUserBuildHwndList( HDESK desktop, ULONG unk2, ULONG unk3, ULON
}
/*****************************************************************************
* NtUserCallHwnd (win32u.@)
*/
DWORD WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
{
switch (code)
{
case NtUserIsWindow:
return is_window( hwnd );
default:
FIXME( "invalid code %u\n", code );
return 0;
}
}
/*****************************************************************************
* NtUserCallHwndParam (win32u.@)
*/
DWORD WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
......
......@@ -725,6 +725,12 @@ ULONG_PTR WINAPI NtUserCallTwoParam( ULONG_PTR arg1, ULONG_PTR arg2, ULONG code
return unix_funcs->pNtUserCallTwoParam( arg1, arg2, code );
}
DWORD WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserCallHwnd( hwnd, code );
}
DWORD WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
{
if (!unix_funcs) return 0;
......
......@@ -134,6 +134,12 @@ enum
NtUserSetHandlePtr,
};
/* NtUserCallHwnd codes, not compatible with Windows */
enum
{
NtUserIsWindow,
};
/* NtUserCallHwndParam codes, not compatible with Windows */
enum
{
......@@ -198,6 +204,7 @@ BOOL WINAPI NtUserAddClipboardFormatListener( HWND hwnd );
BOOL WINAPI NtUserAttachThreadInput( DWORD from, DWORD to, BOOL attach );
NTSTATUS WINAPI NtUserBuildHwndList( HDESK desktop, ULONG unk2, ULONG unk3, ULONG unk4,
ULONG thread_id, ULONG count, HWND *buffer, ULONG *size );
DWORD WINAPI NtUserCallHwnd( HWND hwnd, DWORD code );
DWORD WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code );
LRESULT WINAPI NtUserCallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam );
ULONG_PTR WINAPI NtUserCallNoParam( ULONG code );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment