From 82caf5f82346013299337ce47303daf915128a42 Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Wed, 20 Dec 2017 17:38:36 +0100 Subject: [PATCH 1/1] [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 dbb2fff625a..965a72b81d9 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)) -- 2.17.1