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

win32u: Move NtUserRemoveProp implementation from user32.

parent 32ea3ec7
...@@ -170,18 +170,7 @@ HANDLE WINAPI RemovePropA( HWND hwnd, LPCSTR str ) ...@@ -170,18 +170,7 @@ HANDLE WINAPI RemovePropA( HWND hwnd, LPCSTR str )
*/ */
HANDLE WINAPI RemovePropW( HWND hwnd, LPCWSTR str ) HANDLE WINAPI RemovePropW( HWND hwnd, LPCWSTR str )
{ {
ULONG_PTR ret = 0; return NtUserRemoveProp( hwnd, str );
SERVER_START_REQ( remove_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;
} }
......
...@@ -113,6 +113,7 @@ static void * const syscalls[] = ...@@ -113,6 +113,7 @@ static void * const syscalls[] =
NtUserOpenDesktop, NtUserOpenDesktop,
NtUserOpenInputDesktop, NtUserOpenInputDesktop,
NtUserOpenWindowStation, NtUserOpenWindowStation,
NtUserRemoveProp,
NtUserSetObjectInformation, NtUserSetObjectInformation,
NtUserSetProcessWindowStation, NtUserSetProcessWindowStation,
NtUserSetProp, NtUserSetProp,
......
...@@ -52,6 +52,12 @@ static void test_window_props(void) ...@@ -52,6 +52,12 @@ static void test_window_props(void)
prop = NtUserGetProp( hwnd, UlongToPtr(atom) ); prop = NtUserGetProp( hwnd, UlongToPtr(atom) );
ok( prop == UlongToHandle(0xdeadbeef), "prop = %p\n", prop ); ok( prop == UlongToHandle(0xdeadbeef), "prop = %p\n", prop );
prop = NtUserRemoveProp( hwnd, UlongToPtr(atom) );
ok( prop == UlongToHandle(0xdeadbeef), "prop = %p\n", prop );
prop = GetPropW(hwnd, L"test");
ok(!prop, "prop = %p\n", prop);
GlobalDeleteAtom( atom ); GlobalDeleteAtom( atom );
DestroyWindow( hwnd ); DestroyWindow( hwnd );
} }
......
...@@ -1148,7 +1148,7 @@ ...@@ -1148,7 +1148,7 @@
@ stub NtUserRemoveClipboardFormatListener @ stub NtUserRemoveClipboardFormatListener
@ stub NtUserRemoveInjectionDevice @ stub NtUserRemoveInjectionDevice
@ stub NtUserRemoveMenu @ stub NtUserRemoveMenu
@ stub NtUserRemoveProp @ stdcall -syscall NtUserRemoveProp(long wstr)
@ stub NtUserRemoveVisualIdentifier @ stub NtUserRemoveVisualIdentifier
@ stub NtUserReportInertia @ stub NtUserReportInertia
@ stub NtUserRequestMoveSizeOperation @ stub NtUserRequestMoveSizeOperation
......
...@@ -70,6 +70,30 @@ BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle ) ...@@ -70,6 +70,30 @@ BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle )
return ret; return ret;
} }
/***********************************************************************
* NtUserRemoveProp (win32u.@)
*
* NOTE Native allows only ATOMs as the second argument. We allow strings
* to save extra server call in RemovePropW.
*/
HANDLE WINAPI NtUserRemoveProp( HWND hwnd, const WCHAR *str )
{
ULONG_PTR ret = 0;
SERVER_START_REQ( remove_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;
}
/***************************************************************************** /*****************************************************************************
* NtUserGetLayeredWindowAttributes (win32u.@) * NtUserGetLayeredWindowAttributes (win32u.@)
*/ */
......
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
SYSCALL_ENTRY( NtUserOpenDesktop ) \ SYSCALL_ENTRY( NtUserOpenDesktop ) \
SYSCALL_ENTRY( NtUserOpenInputDesktop ) \ SYSCALL_ENTRY( NtUserOpenInputDesktop ) \
SYSCALL_ENTRY( NtUserOpenWindowStation ) \ SYSCALL_ENTRY( NtUserOpenWindowStation ) \
SYSCALL_ENTRY( NtUserRemoveProp ) \
SYSCALL_ENTRY( NtUserSetObjectInformation ) \ SYSCALL_ENTRY( NtUserSetObjectInformation ) \
SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \ SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \
SYSCALL_ENTRY( NtUserSetProp ) \ SYSCALL_ENTRY( NtUserSetProp ) \
......
...@@ -173,6 +173,14 @@ NTSTATUS WINAPI wow64_NtUserSetProp( UINT *args ) ...@@ -173,6 +173,14 @@ NTSTATUS WINAPI wow64_NtUserSetProp( UINT *args )
return NtUserSetProp( hwnd, str, handle ); return NtUserSetProp( hwnd, str, handle );
} }
NTSTATUS WINAPI wow64_NtUserRemoveProp( UINT *args )
{
HWND hwnd = get_handle( &args );
const WCHAR *str = get_ptr( &args );
return HandleToUlong( NtUserRemoveProp( hwnd, str ));
}
NTSTATUS WINAPI wow64_NtUserGetLayeredWindowAttributes( UINT *args ) NTSTATUS WINAPI wow64_NtUserGetLayeredWindowAttributes( UINT *args )
{ {
HWND hwnd = get_handle( &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