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

win32u: Move GetWindowTextLength implementation from user32.

parent 6c49dfff
......@@ -400,31 +400,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
*
* Return the parent for HWND_MESSAGE windows.
......@@ -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 );
}
......
......@@ -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:
......
......@@ -139,6 +139,7 @@ enum
/* NtUserCallHwnd codes, not compatible with Windows */
enum
{
NtUserGetWindowTextLength,
NtUserIsWindow,
};
......
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