[PATCH 3/7] win32u: Move SetWindowContextHelpId implementation from user32.

Jacek Caban wine at gitlab.winehq.org
Wed Jun 8 19:14:32 CDT 2022


From: Jacek Caban <jacek at codeweavers.com>

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
---
 dlls/user32/win.c    | 11 +----------
 dlls/win32u/window.c | 18 ++++++++++++++++++
 include/ntuser.h     |  6 ++++++
 3 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/dlls/user32/win.c b/dlls/user32/win.c
index bac75063f7d..4adffc37d6b 100644
--- a/dlls/user32/win.c
+++ b/dlls/user32/win.c
@@ -1475,16 +1475,7 @@ DWORD WINAPI GetWindowContextHelpId( HWND hwnd )
  */
 BOOL WINAPI SetWindowContextHelpId( HWND hwnd, DWORD id )
 {
-    WND *wnd = WIN_GetPtr( hwnd );
-    if (!wnd || wnd == WND_DESKTOP) return FALSE;
-    if (wnd == WND_OTHER_PROCESS)
-    {
-        if (IsWindow( hwnd )) FIXME( "not supported on other process window %p\n", hwnd );
-        return FALSE;
-    }
-    wnd->helpContext = id;
-    WIN_ReleasePtr( wnd );
-    return TRUE;
+    return NtUserSetWindowContextHelpId( hwnd, id );
 }
 
 
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c
index 34bf87bc9ba..d09a719185a 100644
--- a/dlls/win32u/window.c
+++ b/dlls/win32u/window.c
@@ -4539,6 +4539,21 @@ static DWORD get_window_context_help_id( HWND hwnd )
     return retval;
 }
 
+/* see SetWindowContextHelpId */
+static BOOL set_window_context_help_id( HWND hwnd, DWORD id )
+{
+    WND *win = get_win_ptr( hwnd );
+    if (!win || win == WND_DESKTOP) return FALSE;
+    if (win == WND_OTHER_PROCESS)
+    {
+        if (is_window( hwnd )) FIXME( "not supported on other process window %p\n", hwnd );
+        return FALSE;
+    }
+    win->helpContext = id;
+    release_win_ptr( win );
+    return TRUE;
+}
+
 /***********************************************************************
  *           send_destroy_message
  */
@@ -5432,6 +5447,9 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
     case NtUserCallHwndParam_SetForegroundWindow:
         return set_foreground_window( hwnd, param );
 
+    case NtUserCallHwndParam_SetWindowContextHelpId:
+        return set_window_context_help_id( hwnd, param );
+
     case NtUserCallHwndParam_SetWindowPixelFormat:
         return set_window_pixel_format( hwnd, param );
 
diff --git a/include/ntuser.h b/include/ntuser.h
index b6b69879dd7..482bdbcbddd 100644
--- a/include/ntuser.h
+++ b/include/ntuser.h
@@ -1021,6 +1021,7 @@ enum
     NtUserCallHwndParam_MonitorFromWindow,
     NtUserCallHwndParam_ScreenToClient,
     NtUserCallHwndParam_SetForegroundWindow,
+    NtUserCallHwndParam_SetWindowContextHelpId,
     NtUserCallHwndParam_SetWindowPixelFormat,
     NtUserCallHwndParam_ShowOwnedPopups,
     /* temporary exports */
@@ -1171,6 +1172,11 @@ static inline BOOL NtUserSetForegroundWindow( HWND hwnd, BOOL mouse )
     return NtUserCallHwndParam( hwnd, mouse, NtUserCallHwndParam_SetForegroundWindow );
 }
 
+static inline BOOL NtUserSetWindowContextHelpId( HWND hwnd, DWORD id )
+{
+    return NtUserCallHwndParam( hwnd, id, NtUserCallHwndParam_SetWindowContextHelpId );
+}
+
 static inline BOOL NtUserSetWindowPixelFormat( HWND hwnd, int format )
 {
     return NtUserCallHwndParam( hwnd, format, NtUserCallHwndParam_SetWindowPixelFormat );
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/211



More information about the wine-devel mailing list