https://git.reactos.org/?p=reactos.git;a=commitdiff;h=82caf5f82346013299337…
commit 82caf5f82346013299337ce47303daf915128a42
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Wed Dec 20 17:38:36 2017 +0100
[WIN32K] avoid BSOD in Bochs 2.6.8 CORE-13629, patch by Mark Jansen
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 | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c
index dbb2fff625..965a72b81d 100644
--- a/win32ss/user/ntuser/menu.c
+++ b/win32ss/user/ntuser/menu.c
@@ -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.
- 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))