[WIN32K] avoid BSOD in Bochs 2.6.8 CORE-13629, patch by Mark Jansen
authorJoachim Henze <Joachim.Henze@reactos.org>
Wed, 20 Dec 2017 16:38:36 +0000 (17:38 +0100)
committerJoachim Henze <Joachim.Henze@reactos.org>
Wed, 20 Dec 2017 16:38:36 +0000 (17:38 +0100)
We applied this patch also last second in 0.4.7rls, now in master.

IntTrackPopupMenuEx() caused the BSOD when called while window is in the process of being destroyed.

win32ss/user/ntuser/menu.c

index dbb2fff..965a72b 100644 (file)
@@ -4392,7 +4392,10 @@ BOOL WINAPI IntTrackPopupMenuEx( PMENU menu, UINT wFlags, int x, int y,
        {
           PWND pwndM = ValidateHwndNoErr( menu->hWnd );
           if (pwndM) // wine hack around this with their destroy function.
        {
           PWND pwndM = ValidateHwndNoErr( menu->hWnd );
           if (pwndM) // wine hack around this with their destroy function.
-             co_UserDestroyWindow( pwndM ); // Fix wrong error return.
+          {
+             if (!(pWnd->state & WNDS_DESTROYED))
+                co_UserDestroyWindow( pwndM ); // Fix wrong error return.
+          }
           menu->hWnd = 0;
 
           if (!(wFlags & TPM_NONOTIFY))
           menu->hWnd = 0;
 
           if (!(wFlags & TPM_NONOTIFY))