Jacek Caban : win32u: Use syscall interface for NtUserSetWindow* functions.
Alexandre Julliard
julliard at winehq.org
Tue Jul 26 15:40:52 CDT 2022
Module: wine
Branch: master
Commit: 87b8a912a8e42d0643096a420a71a7e0054191a1
URL: https://gitlab.winehq.org/wine/wine/-/commit/87b8a912a8e42d0643096a420a71a7e0054191a1
Author: Jacek Caban <jacek at codeweavers.com>
Date: Thu Jul 21 20:48:21 2022 +0200
win32u: Use syscall interface for NtUserSetWindow* functions.
---
dlls/win32u/gdiobj.c | 5 -----
dlls/win32u/syscall.c | 5 +++++
dlls/win32u/win32u.spec | 10 +++++-----
dlls/win32u/win32u_private.h | 5 -----
dlls/win32u/wrappers.c | 30 -----------------------------
dlls/wow64win/syscall.h | 5 +++++
dlls/wow64win/user.c | 46 ++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 61 insertions(+), 45 deletions(-)
diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c
index 0c7693d24ed..c5316137df4 100644
--- a/dlls/win32u/gdiobj.c
+++ b/dlls/win32u/gdiobj.c
@@ -1153,11 +1153,6 @@ static struct unix_funcs unix_funcs =
NtUserSetClassWord,
NtUserSetLayeredWindowAttributes,
NtUserSetParent,
- NtUserSetWindowLong,
- NtUserSetWindowLongPtr,
- NtUserSetWindowPlacement,
- NtUserSetWindowRgn,
- NtUserSetWindowWord,
NtUserShowWindow,
NtUserShowWindowAsync,
NtUserSystemParametersInfo,
diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c
index f6b044d8c38..562febcf7e0 100644
--- a/dlls/win32u/syscall.c
+++ b/dlls/win32u/syscall.c
@@ -259,7 +259,12 @@ static void * const syscalls[] =
NtUserSetThreadDesktop,
NtUserSetTimer,
NtUserSetWinEventHook,
+ NtUserSetWindowLong,
+ NtUserSetWindowLongPtr,
+ NtUserSetWindowPlacement,
NtUserSetWindowPos,
+ NtUserSetWindowRgn,
+ NtUserSetWindowWord,
NtUserSetWindowsHookEx,
NtUserShowCaret,
NtUserShowCursor,
diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec
index 8ddc4e0c9f7..18eb5e77d9c 100644
--- a/dlls/win32u/win32u.spec
+++ b/dlls/win32u/win32u.spec
@@ -1246,15 +1246,15 @@
@ stub NtUserSetWindowFNID
@ stub NtUserSetWindowFeedbackSetting
@ stub NtUserSetWindowGroup
-@ stdcall NtUserSetWindowLong(long long long long)
-@ stdcall NtUserSetWindowLongPtr(long long long long)
-@ stdcall NtUserSetWindowPlacement(long ptr)
+@ stdcall -syscall NtUserSetWindowLong(long long long long)
+@ stdcall -syscall NtUserSetWindowLongPtr(long long long long)
+@ stdcall -syscall NtUserSetWindowPlacement(long ptr)
@ stdcall -syscall NtUserSetWindowPos(long long long long long long long)
-@ stdcall NtUserSetWindowRgn(long long long)
+@ stdcall -syscall NtUserSetWindowRgn(long long long)
@ stub NtUserSetWindowRgnEx
@ stub NtUserSetWindowShowState
@ stub NtUserSetWindowStationUser
-@ stdcall NtUserSetWindowWord(long long long)
+@ stdcall -syscall NtUserSetWindowWord(long long long)
@ stub NtUserSetWindowsHookAW
@ stdcall -syscall NtUserSetWindowsHookEx(ptr ptr long long ptr long)
@ stdcall -syscall NtUserShowCaret(long)
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h
index aec24b73f53..582facc0ddf 100644
--- a/dlls/win32u/win32u_private.h
+++ b/dlls/win32u/win32u_private.h
@@ -209,11 +209,6 @@ struct unix_funcs
WORD (WINAPI *pNtUserSetClassWord)( HWND hwnd, INT offset, WORD newval );
BOOL (WINAPI *pNtUserSetLayeredWindowAttributes)( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags );
HWND (WINAPI *pNtUserSetParent)( HWND hwnd, HWND parent );
- LONG (WINAPI *pNtUserSetWindowLong)( HWND hwnd, INT offset, LONG newval, BOOL ansi );
- LONG_PTR (WINAPI *pNtUserSetWindowLongPtr)( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi );
- BOOL (WINAPI *pNtUserSetWindowPlacement)( HWND hwnd, const WINDOWPLACEMENT *wpl );
- int (WINAPI *pNtUserSetWindowRgn)( HWND hwnd, HRGN hrgn, BOOL redraw );
- WORD (WINAPI *pNtUserSetWindowWord)( HWND hwnd, INT offset, WORD newval );
BOOL (WINAPI *pNtUserShowWindow)( HWND hwnd, INT cmd );
BOOL (WINAPI *pNtUserShowWindowAsync)( HWND hwnd, INT cmd );
BOOL (WINAPI *pNtUserSystemParametersInfo)( UINT action, UINT val, PVOID ptr, UINT winini );
diff --git a/dlls/win32u/wrappers.c b/dlls/win32u/wrappers.c
index b2b143cc136..290c4a51f1d 100644
--- a/dlls/win32u/wrappers.c
+++ b/dlls/win32u/wrappers.c
@@ -826,36 +826,6 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent )
return unix_funcs->pNtUserSetParent( hwnd, parent );
}
-LONG WINAPI NtUserSetWindowLong( HWND hwnd, INT offset, LONG newval, BOOL ansi )
-{
- if (!unix_funcs) return 0;
- return unix_funcs->pNtUserSetWindowLong( hwnd, offset, newval, ansi );
-}
-
-LONG_PTR WINAPI NtUserSetWindowLongPtr( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi )
-{
- if (!unix_funcs) return 0;
- return unix_funcs->pNtUserSetWindowLongPtr( hwnd, offset, newval, ansi );
-}
-
-BOOL WINAPI NtUserSetWindowPlacement( HWND hwnd, const WINDOWPLACEMENT *wpl )
-{
- if (!unix_funcs) return 0;
- return unix_funcs->pNtUserSetWindowPlacement( hwnd, wpl );
-}
-
-int WINAPI NtUserSetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw )
-{
- if (!unix_funcs) return 0;
- return unix_funcs->pNtUserSetWindowRgn( hwnd, hrgn, redraw );
-}
-
-WORD WINAPI NtUserSetWindowWord( HWND hwnd, INT offset, WORD newval )
-{
- if (!unix_funcs) return 0;
- return unix_funcs->pNtUserSetWindowWord( hwnd, offset, newval );
-}
-
BOOL WINAPI NtUserShowWindowAsync( HWND hwnd, INT cmd )
{
if (!unix_funcs) return FALSE;
diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h
index 3a2cdf3f8ec..6a42e1ee7d7 100644
--- a/dlls/wow64win/syscall.h
+++ b/dlls/wow64win/syscall.h
@@ -246,7 +246,12 @@
SYSCALL_ENTRY( NtUserSetThreadDesktop ) \
SYSCALL_ENTRY( NtUserSetTimer ) \
SYSCALL_ENTRY( NtUserSetWinEventHook ) \
+ SYSCALL_ENTRY( NtUserSetWindowLong ) \
+ SYSCALL_ENTRY( NtUserSetWindowLongPtr ) \
+ SYSCALL_ENTRY( NtUserSetWindowPlacement ) \
SYSCALL_ENTRY( NtUserSetWindowPos ) \
+ SYSCALL_ENTRY( NtUserSetWindowRgn ) \
+ SYSCALL_ENTRY( NtUserSetWindowWord ) \
SYSCALL_ENTRY( NtUserSetWindowsHookEx ) \
SYSCALL_ENTRY( NtUserShowCaret ) \
SYSCALL_ENTRY( NtUserShowCursor ) \
diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c
index a6acccf5089..12ede1397c1 100644
--- a/dlls/wow64win/user.c
+++ b/dlls/wow64win/user.c
@@ -1959,6 +1959,34 @@ NTSTATUS WINAPI wow64_NtUserSetWinEventHook( UINT *args )
return HandleToUlong( ret );
}
+NTSTATUS WINAPI wow64_NtUserSetWindowLong( UINT *args )
+{
+ HWND hwnd = get_handle( &args );
+ INT offset = get_ulong( &args );
+ LONG newval = get_ulong( &args );
+ BOOL ansi = get_ulong( &args );
+
+ return NtUserSetWindowLong( hwnd, offset, newval, ansi );
+}
+
+NTSTATUS WINAPI wow64_NtUserSetWindowLongPtr( UINT *args )
+{
+ HWND hwnd = get_handle( &args );
+ INT offset = get_ulong( &args );
+ LONG_PTR newval = get_ulong( &args );
+ BOOL ansi = get_ulong( &args );
+
+ return NtUserSetWindowLongPtr( hwnd, offset, newval, ansi );
+}
+
+NTSTATUS WINAPI wow64_NtUserSetWindowPlacement( UINT *args )
+{
+ HWND hwnd = get_handle( &args );
+ const WINDOWPLACEMENT *wpl = get_ptr( &args );
+
+ return NtUserSetWindowPlacement( hwnd, wpl );
+}
+
NTSTATUS WINAPI wow64_NtUserSetWindowPos( UINT *args )
{
HWND hwnd = get_handle( &args );
@@ -1972,6 +2000,24 @@ NTSTATUS WINAPI wow64_NtUserSetWindowPos( UINT *args )
return NtUserSetWindowPos( hwnd, after, x, y, cx, cy, flags );
}
+NTSTATUS WINAPI wow64_NtUserSetWindowRgn( UINT *args )
+{
+ HWND hwnd = get_handle( &args );
+ HRGN hrgn = get_handle( &args );
+ BOOL redraw = get_ulong( &args );
+
+ return NtUserSetWindowRgn( hwnd, hrgn, redraw );
+}
+
+NTSTATUS WINAPI wow64_NtUserSetWindowWord( UINT *args )
+{
+ HWND hwnd = get_handle( &args );
+ INT offset = get_ulong( &args );
+ WORD newval = get_ulong( &args );
+
+ return NtUserSetWindowWord( hwnd, offset, newval );
+}
+
NTSTATUS WINAPI wow64_NtUserSetWindowsHookEx( UINT *args )
{
HINSTANCE inst = get_handle( &args );
More information about the wine-cvs
mailing list