win32u: Move NtUserGetGUIThreadInfo implementation from user32.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
47ca0f49c7
commit
de739e9f91
|
@ -175,7 +175,7 @@ static BOOL set_active_window( HWND hwnd, HWND *prev, BOOL mouse, BOOL focus )
|
|||
GUITHREADINFO info;
|
||||
|
||||
info.cbSize = sizeof(info);
|
||||
GetGUIThreadInfo( GetCurrentThreadId(), &info );
|
||||
NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info );
|
||||
/* Do not change focus if the window is no more active */
|
||||
if (hwnd == info.hwndActive)
|
||||
{
|
||||
|
|
|
@ -2408,7 +2408,7 @@ static BOOL process_mouse_message( MSG *msg, UINT hw_id, ULONG_PTR extra_info, H
|
|||
/* find the window to dispatch this mouse message to */
|
||||
|
||||
info.cbSize = sizeof(info);
|
||||
GetGUIThreadInfo( GetCurrentThreadId(), &info );
|
||||
NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info );
|
||||
if (info.hwndCapture)
|
||||
{
|
||||
hittest = HTCLIENT;
|
||||
|
@ -4559,45 +4559,6 @@ BOOL WINAPI IsGUIThread( BOOL convert )
|
|||
}
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* GetGUIThreadInfo (USER32.@)
|
||||
*/
|
||||
BOOL WINAPI GetGUIThreadInfo( DWORD id, GUITHREADINFO *info )
|
||||
{
|
||||
BOOL ret;
|
||||
|
||||
if (info->cbSize != sizeof(*info))
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SERVER_START_REQ( get_thread_input )
|
||||
{
|
||||
req->tid = id;
|
||||
if ((ret = !wine_server_call_err( req )))
|
||||
{
|
||||
info->flags = 0;
|
||||
info->hwndActive = wine_server_ptr_handle( reply->active );
|
||||
info->hwndFocus = wine_server_ptr_handle( reply->focus );
|
||||
info->hwndCapture = wine_server_ptr_handle( reply->capture );
|
||||
info->hwndMenuOwner = wine_server_ptr_handle( reply->menu_owner );
|
||||
info->hwndMoveSize = wine_server_ptr_handle( reply->move_size );
|
||||
info->hwndCaret = wine_server_ptr_handle( reply->caret );
|
||||
info->rcCaret.left = reply->rect.left;
|
||||
info->rcCaret.top = reply->rect.top;
|
||||
info->rcCaret.right = reply->rect.right;
|
||||
info->rcCaret.bottom = reply->rect.bottom;
|
||||
if (reply->menu_owner) info->flags |= GUI_INMENUMODE;
|
||||
if (reply->move_size) info->flags |= GUI_INMOVESIZE;
|
||||
if (reply->caret) info->flags |= GUI_CARETBLINKING;
|
||||
}
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************
|
||||
* IsHungAppWindow (USER32.@)
|
||||
*
|
||||
|
|
|
@ -898,7 +898,7 @@ static HWND fix_caret(HWND hWnd, const RECT *scroll_rect, INT dx, INT dy,
|
|||
RECT rect, mapped_rcCaret;
|
||||
|
||||
info.cbSize = sizeof(info);
|
||||
if (!GetGUIThreadInfo( GetCurrentThreadId(), &info )) return 0;
|
||||
if (!NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info )) return 0;
|
||||
if (!info.hwndCaret) return 0;
|
||||
|
||||
mapped_rcCaret = info.rcCaret;
|
||||
|
|
|
@ -305,7 +305,7 @@
|
|||
@ stdcall GetForegroundWindow() NtUserGetForegroundWindow
|
||||
@ stdcall GetGestureConfig(long long long ptr ptr long)
|
||||
@ stdcall GetGestureInfo(long ptr)
|
||||
@ stdcall GetGUIThreadInfo(long ptr)
|
||||
@ stdcall GetGUIThreadInfo(long ptr) NtUserGetGUIThreadInfo
|
||||
@ stdcall GetGuiResources(long long)
|
||||
@ stdcall GetIconInfo(long ptr)
|
||||
@ stdcall GetIconInfoExA(long ptr)
|
||||
|
|
|
@ -1852,7 +1852,7 @@ static void WIN_SendDestroyMsg( HWND hwnd )
|
|||
GUITHREADINFO info;
|
||||
|
||||
info.cbSize = sizeof(info);
|
||||
if (GetGUIThreadInfo( GetCurrentThreadId(), &info ))
|
||||
if (NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ))
|
||||
{
|
||||
if (hwnd == info.hwndCaret) DestroyCaret();
|
||||
if (hwnd == info.hwndActive) WINPOS_ActivateOtherWindow( hwnd );
|
||||
|
|
|
@ -32,6 +32,7 @@ C_SRCS = \
|
|||
input.c \
|
||||
main.c \
|
||||
mapping.c \
|
||||
message.c \
|
||||
opentype.c \
|
||||
painting.c \
|
||||
palette.c \
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Window messaging support
|
||||
*
|
||||
* Copyright 2001 Alexandre Julliard
|
||||
* Copyright 2008 Maarten Lankhorst
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
#if 0
|
||||
#pragma makedep unix
|
||||
#endif
|
||||
|
||||
#include "win32u_private.h"
|
||||
#include "wine/server.h"
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* NtUserGetGUIThreadInfo (win32u.@)
|
||||
*/
|
||||
BOOL WINAPI NtUserGetGUIThreadInfo( DWORD id, GUITHREADINFO *info )
|
||||
{
|
||||
BOOL ret;
|
||||
|
||||
if (info->cbSize != sizeof(*info))
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
SERVER_START_REQ( get_thread_input )
|
||||
{
|
||||
req->tid = id;
|
||||
if ((ret = !wine_server_call_err( req )))
|
||||
{
|
||||
info->flags = 0;
|
||||
info->hwndActive = wine_server_ptr_handle( reply->active );
|
||||
info->hwndFocus = wine_server_ptr_handle( reply->focus );
|
||||
info->hwndCapture = wine_server_ptr_handle( reply->capture );
|
||||
info->hwndMenuOwner = wine_server_ptr_handle( reply->menu_owner );
|
||||
info->hwndMoveSize = wine_server_ptr_handle( reply->move_size );
|
||||
info->hwndCaret = wine_server_ptr_handle( reply->caret );
|
||||
info->rcCaret.left = reply->rect.left;
|
||||
info->rcCaret.top = reply->rect.top;
|
||||
info->rcCaret.right = reply->rect.right;
|
||||
info->rcCaret.bottom = reply->rect.bottom;
|
||||
if (reply->menu_owner) info->flags |= GUI_INMENUMODE;
|
||||
if (reply->move_size) info->flags |= GUI_INMOVESIZE;
|
||||
if (reply->caret) info->flags |= GUI_CARETBLINKING;
|
||||
}
|
||||
}
|
||||
SERVER_END_REQ;
|
||||
return ret;
|
||||
}
|
|
@ -118,6 +118,7 @@ static void * const syscalls[] =
|
|||
NtUserGetDoubleClickTime,
|
||||
NtUserGetDpiForMonitor,
|
||||
NtUserGetForegroundWindow,
|
||||
NtUserGetGUIThreadInfo,
|
||||
NtUserGetIconSize,
|
||||
NtUserGetKeyState,
|
||||
NtUserGetKeyboardLayout,
|
||||
|
|
|
@ -927,7 +927,7 @@
|
|||
@ stdcall -syscall NtUserGetDpiForMonitor(long long ptr ptr)
|
||||
@ stub NtUserGetExtendedPointerDeviceProperty
|
||||
@ stdcall -syscall NtUserGetForegroundWindow()
|
||||
@ stub NtUserGetGUIThreadInfo
|
||||
@ stdcall -syscall NtUserGetGUIThreadInfo(long ptr)
|
||||
@ stub NtUserGetGestureConfig
|
||||
@ stub NtUserGetGestureExtArgs
|
||||
@ stub NtUserGetGestureInfo
|
||||
|
|
|
@ -105,6 +105,7 @@
|
|||
SYSCALL_ENTRY( NtUserGetDoubleClickTime ) \
|
||||
SYSCALL_ENTRY( NtUserGetDpiForMonitor ) \
|
||||
SYSCALL_ENTRY( NtUserGetForegroundWindow ) \
|
||||
SYSCALL_ENTRY( NtUserGetGUIThreadInfo ) \
|
||||
SYSCALL_ENTRY( NtUserGetIconSize ) \
|
||||
SYSCALL_ENTRY( NtUserGetKeyState ) \
|
||||
SYSCALL_ENTRY( NtUserGetKeyboardLayout ) \
|
||||
|
|
|
@ -455,3 +455,39 @@ NTSTATUS WINAPI wow64_NtUserGetForegroundWindow( UINT *args )
|
|||
{
|
||||
return HandleToUlong( NtUserGetForegroundWindow() );
|
||||
}
|
||||
|
||||
NTSTATUS WINAPI wow64_NtUserGetGUIThreadInfo( UINT *args )
|
||||
{
|
||||
DWORD id = get_ulong( &args );
|
||||
struct
|
||||
{
|
||||
DWORD cbSize;
|
||||
DWORD flags;
|
||||
ULONG hwndActive;
|
||||
ULONG hwndFocus;
|
||||
ULONG hwndCapture;
|
||||
ULONG hwndMenuOwner;
|
||||
ULONG hwndMoveSize;
|
||||
ULONG hwndCaret;
|
||||
RECT rcCaret;
|
||||
} *info32 = get_ptr( &args );
|
||||
GUITHREADINFO info;
|
||||
|
||||
if (info32->cbSize != sizeof(*info32))
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
info.cbSize = sizeof(info);
|
||||
if (!NtUserGetGUIThreadInfo( id, &info )) return FALSE;
|
||||
info32->flags = info.flags;
|
||||
info32->hwndActive = HandleToUlong( info.hwndActive );
|
||||
info32->hwndFocus = HandleToUlong( info.hwndFocus );
|
||||
info32->hwndCapture = HandleToUlong( info.hwndCapture );
|
||||
info32->hwndMenuOwner = HandleToUlong( info.hwndMenuOwner );
|
||||
info32->hwndMoveSize = HandleToUlong( info.hwndMoveSize );
|
||||
info32->hwndCaret = HandleToUlong( info.hwndCaret );
|
||||
info32->rcCaret = info.rcCaret;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -211,6 +211,7 @@ LONG WINAPI NtUserGetDisplayConfigBufferSizes( UINT32 flags, UINT32 *num_path
|
|||
UINT WINAPI NtUserGetDoubleClickTime(void);
|
||||
BOOL WINAPI NtUserGetDpiForMonitor( HMONITOR monitor, UINT type, UINT *x, UINT *y );
|
||||
HWND WINAPI NtUserGetForegroundWindow(void);
|
||||
BOOL WINAPI NtUserGetGUIThreadInfo( DWORD id, GUITHREADINFO *info );
|
||||
BOOL WINAPI NtUserGetIconInfo( HICON icon, ICONINFO *info, UNICODE_STRING *module,
|
||||
UNICODE_STRING *res_name, DWORD *bpp, LONG unk );
|
||||
BOOL WINAPI NtUserGetIconSize( HICON handle, UINT step, LONG *width, LONG *height );
|
||||
|
|
Loading…
Reference in New Issue