win32u: Move GetWindowTextLength 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:
Jacek Caban 2022-03-08 14:23:45 +01:00 committed by Alexandre Julliard
parent 6c49dfff14
commit d312083e0a
3 changed files with 5 additions and 27 deletions

View File

@ -399,31 +399,6 @@ void update_window_state( HWND hwnd )
}
/*******************************************************************
* get_server_window_text
*
* Retrieve the window text from the server.
*/
static data_size_t get_server_window_text( HWND hwnd, WCHAR *text, data_size_t count )
{
data_size_t len = 0, needed = 0;
SERVER_START_REQ( get_window_text )
{
req->handle = wine_server_user_handle( hwnd );
if (count) wine_server_set_reply( req, text, (count - 1) * sizeof(WCHAR) );
if (!wine_server_call_err( req ))
{
needed = reply->length;
len = wine_server_reply_size(reply);
}
}
SERVER_END_REQ;
if (text) text[len / sizeof(WCHAR)] = 0;
return needed;
}
/*******************************************************************
* get_hwnd_message_parent
*
@ -3023,7 +2998,7 @@ INT WINAPI GetWindowTextLengthA( HWND hwnd )
/* when window belongs to other process, don't send a message */
GetCPInfo( CP_ACP, &info );
return get_server_window_text( hwnd, NULL, 0 ) * info.MaxCharSize;
return NtUserCallHwnd( hwnd, NtUserGetWindowTextLength ) * info.MaxCharSize;
}
/*******************************************************************
@ -3034,7 +3009,7 @@ INT WINAPI GetWindowTextLengthW( HWND hwnd )
if (WIN_IsCurrentProcess( hwnd )) return SendMessageW( hwnd, WM_GETTEXTLENGTH, 0, 0 );
/* when window belongs to other process, don't send a message */
return get_server_window_text( hwnd, NULL, 0 );
return NtUserCallHwnd( hwnd, NtUserGetWindowTextLength );
}

View File

@ -475,6 +475,8 @@ DWORD WINAPI NtUserCallHwnd( HWND hwnd, DWORD code )
{
switch (code)
{
case NtUserGetWindowTextLength:
return get_server_window_text( hwnd, NULL, 0 );
case NtUserIsWindow:
return is_window( hwnd );
default:

View File

@ -139,6 +139,7 @@ enum
/* NtUserCallHwnd codes, not compatible with Windows */
enum
{
NtUserGetWindowTextLength,
NtUserIsWindow,
};