Commit 32ea3ec7 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move NtUserGetProp implementation from user32.

parent 97fa9db4
......@@ -126,17 +126,7 @@ HANDLE WINAPI GetPropA( HWND hwnd, LPCSTR str )
*/
HANDLE WINAPI GetPropW( HWND hwnd, LPCWSTR str )
{
ULONG_PTR ret = 0;
SERVER_START_REQ( get_window_property )
{
req->window = wine_server_user_handle( hwnd );
if (IS_INTRESOURCE(str)) req->atom = LOWORD(str);
else wine_server_add_data( req, str, lstrlenW(str) * sizeof(WCHAR) );
if (!wine_server_call_err( req )) ret = reply->data;
}
SERVER_END_REQ;
return (HANDLE)ret;
return NtUserGetProp( hwnd, str );
}
......
......@@ -108,6 +108,7 @@ static void * const syscalls[] =
NtUserGetLayeredWindowAttributes,
NtUserGetObjectInformation,
NtUserGetProcessWindowStation,
NtUserGetProp,
NtUserGetThreadDesktop,
NtUserOpenDesktop,
NtUserOpenInputDesktop,
......
......@@ -49,6 +49,9 @@ static void test_window_props(void)
prop = GetPropW( hwnd, L"test" );
ok( prop == UlongToHandle(0xdeadbeef), "prop = %p\n", prop );
prop = NtUserGetProp( hwnd, UlongToPtr(atom) );
ok( prop == UlongToHandle(0xdeadbeef), "prop = %p\n", prop );
GlobalDeleteAtom( atom );
DestroyWindow( hwnd );
}
......
......@@ -980,7 +980,7 @@
@ stub NtUserGetProcessDpiAwarenessContext
@ stub NtUserGetProcessUIContextInformation
@ stdcall -syscall NtUserGetProcessWindowStation()
@ stub NtUserGetProp
@ stdcall -syscall NtUserGetProp(long wstr)
@ stub NtUserGetQueueStatus
@ stub NtUserGetQueueStatusReadonly
@ stub NtUserGetRawInputBuffer
......
......@@ -27,6 +27,27 @@
#include "wine/server.h"
/***********************************************************************
* NtUserGetProp (win32u.@)
*
* NOTE Native allows only ATOMs as the second argument. We allow strings
* to save extra server call in GetPropW.
*/
HANDLE WINAPI NtUserGetProp( HWND hwnd, const WCHAR *str )
{
ULONG_PTR ret = 0;
SERVER_START_REQ( get_window_property )
{
req->window = wine_server_user_handle( hwnd );
if (IS_INTRESOURCE(str)) req->atom = LOWORD(str);
else wine_server_add_data( req, str, lstrlenW(str) * sizeof(WCHAR) );
if (!wine_server_call_err( req )) ret = reply->data;
}
SERVER_END_REQ;
return (HANDLE)ret;
}
/*****************************************************************************
* NtUserSetProp (win32u.@)
*
......
......@@ -95,6 +95,7 @@
SYSCALL_ENTRY( NtUserGetLayeredWindowAttributes ) \
SYSCALL_ENTRY( NtUserGetObjectInformation ) \
SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \
SYSCALL_ENTRY( NtUserGetProp ) \
SYSCALL_ENTRY( NtUserGetThreadDesktop ) \
SYSCALL_ENTRY( NtUserOpenDesktop ) \
SYSCALL_ENTRY( NtUserOpenInputDesktop ) \
......
......@@ -156,6 +156,14 @@ NTSTATUS WINAPI wow64_NtUserSetObjectInformation( UINT *args )
return NtUserSetObjectInformation( handle, index, info, len );
}
NTSTATUS WINAPI wow64_NtUserGetProp( UINT *args )
{
HWND hwnd = get_handle( &args );
const WCHAR *str = get_ptr( &args );
return HandleToUlong( NtUserGetProp( hwnd, str ));
}
NTSTATUS WINAPI wow64_NtUserSetProp( UINT *args )
{
HWND hwnd = get_handle( &args );
......
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