Module: wine Branch: master Commit: c31954dfa7b026bc13960d3c8184ee94e1b4b05c URL: https://source.winehq.org/git/wine.git/?a=commit;h=c31954dfa7b026bc13960d3c8...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Apr 7 15:26:25 2022 +0200
win32u: Move IsWindowEnabled 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
---
dlls/user32/win.c | 9 ++------- dlls/win32u/window.c | 13 +++++++++++++ include/ntuser.h | 1 + 3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 0a3f65e5aa4..881825b5510 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -915,14 +915,9 @@ BOOL WINAPI EnableWindow( HWND hwnd, BOOL enable ) /*********************************************************************** * IsWindowEnabled (USER32.@) */ -BOOL WINAPI IsWindowEnabled(HWND hWnd) +BOOL WINAPI IsWindowEnabled( HWND hwnd ) { - LONG ret; - - SetLastError(NO_ERROR); - ret = GetWindowLongW( hWnd, GWL_STYLE ); - if (!ret && GetLastError() != NO_ERROR) return FALSE; - return !(ret & WS_DISABLED); + return NtUserCallHwnd( hwnd, NtUserIsWindowEnabled ); }
/*********************************************************************** diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 0b826644131..10c6ff4bf89 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -807,6 +807,17 @@ BOOL is_window_unicode( HWND hwnd ) return ret; }
+/* see IsWindowEnabled */ +static BOOL is_window_enabled( HWND hwnd ) +{ + LONG ret; + + SetLastError( NO_ERROR ); + ret = get_window_long( hwnd, GWL_STYLE ); + if (!ret && GetLastError() != NO_ERROR) return FALSE; + return !(ret & WS_DISABLED); +} + /* see GetWindowDpiAwarenessContext */ DPI_AWARENESS_CONTEXT get_window_dpi_awareness_context( HWND hwnd ) { @@ -4979,6 +4990,8 @@ ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code ) return get_server_window_text( hwnd, NULL, 0 ); case NtUserIsWindow: return is_window( hwnd ); + case NtUserIsWindowEnabled: + return is_window_enabled( hwnd ); case NtUserIsWindowUnicode: return is_window_unicode( hwnd ); case NtUserIsWindowVisible: diff --git a/include/ntuser.h b/include/ntuser.h index 46da835e24b..38cc8f96057 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -198,6 +198,7 @@ enum NtUserGetWindowDpiAwarenessContext, NtUserGetWindowTextLength, NtUserIsWindow, + NtUserIsWindowEnabled, NtUserIsWindowUnicode, NtUserIsWindowVisible, };