https://git.reactos.org/?p=reactos.git;a=commitdiff;h=051561ed172abf44da5b93a9e9dd0df976431831

commit 051561ed172abf44da5b93a9e9dd0df976431831
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Thu Dec 23 11:53:18 2021 +0900
Commit:     GitHub <[email protected]>
CommitDate: Thu Dec 23 11:53:18 2021 +0900

    [NTUSER] Use call procedure handle if available (#4178)
    
    Based on I_Kill_Bugs' patch.
    - Use IsCallProcHandle to check if the procedure is a call procedure handle.
    - If so, use the call procedure.
    CORE-10499
---
 win32ss/user/ntuser/window.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/win32ss/user/ntuser/window.c b/win32ss/user/ntuser/window.c
index 8e42d693d45..d9cba3219d6 100644
--- a/win32ss/user/ntuser/window.c
+++ b/win32ss/user/ntuser/window.c
@@ -1623,6 +1623,7 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
    PTHREADINFO pti = NULL;
    BOOL MenuChanged;
    BOOL bUnicodeWindow;
+   PCALLPROCDATA pcpd;
 
    pti = pdeskCreated ? gptiDesktopThread : GetW32ThreadInfo();
 
@@ -1769,7 +1770,16 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
     see what problems this would cause. */
 
    // Set WndProc from Class.
-   pWnd->lpfnWndProc  = pWnd->pcls->lpfnWndProc;
+   if (IsCallProcHandle(pWnd->pcls->lpfnWndProc))
+   {
+      pcpd = UserGetObject(gHandleTable, pWnd->pcls->lpfnWndProc, 
TYPE_CALLPROC);
+      if (pcpd)
+         pWnd->lpfnWndProc = pcpd->pfnClientPrevious;
+   }
+   else
+   {
+      pWnd->lpfnWndProc = pWnd->pcls->lpfnWndProc;
+   }
 
    // GetWindowProc, test for non server side default classes and set WndProc.
     if ( pWnd->pcls->fnid <= FNID_GHOST && pWnd->pcls->fnid >= FNID_BUTTON )

Reply via email to