Skip to content

Commit bfcab8b

Browse files
committed
[0.4.8] [WIN32SS] a risky fix to avoid BSOD CORE-13907 & CORE-11678
object2.patch in CORE-11678 is from jimtabor and Work in Progress. As expected it mitigates CORE-11678 by preventing the sporadic BSOD upon closing CCleaner. But it will always lead to the program remaining in taskmgr upon closing instead. User can manually kill the app from taskmgr. To my own surprise this patch also reliably hides the BSOD in HxD portable for me (CORE-13907). I am still sceptical regarding this patch and will carefully watch out for surprises like zombie processes during the test-cycle.
1 parent 1906186 commit bfcab8b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

win32ss/user/ntuser/window.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* FILE: win32ss/user/ntuser/window.c
66
* PROGRAMER: Casper S. Hornstrup ([email protected])
77
*/
8-
8+
//
99
#include <win32k.h>
1010
DBG_DEFAULT_CHANNEL(UserWnd);
1111

@@ -581,7 +581,7 @@ LRESULT co_UserFreeWindow(PWND Window,
581581
MsqRemoveWindowMessagesFromQueue(Window);
582582

583583
/* from now on no messages can be sent to this window anymore */
584-
Window->state |= WNDS_DESTROYED;
584+
//Window->state |= WNDS_DESTROYED;
585585
Window->fnid |= FNID_FREED;
586586

587587
/* don't remove the WINDOWSTATUS_DESTROYING bit */
@@ -2599,7 +2599,7 @@ BOOLEAN co_UserDestroyWindow(PVOID Object)
25992599
{
26002600
if ((Window->style & (WS_POPUP|WS_CHILD)) != WS_CHILD)
26012601
{
2602-
if (Window->spwndOwner)
2602+
if (VerifyWnd(Window->spwndOwner))
26032603
{
26042604
//ERR("DestroyWindow Owner out.\n");
26052605
UserAttachThreadInput(Window->head.pti, Window->spwndOwner->head.pti, FALSE);
@@ -2635,7 +2635,7 @@ BOOLEAN co_UserDestroyWindow(PVOID Object)
26352635
// Adjust last active.
26362636
if ((pwndTemp = Window->spwndOwner))
26372637
{
2638-
while (pwndTemp->spwndOwner)
2638+
while (VerifyWnd(pwndTemp->spwndOwner))
26392639
pwndTemp = pwndTemp->spwndOwner;
26402640

26412641
if (pwndTemp->spwndLastActive == Window)
@@ -2753,6 +2753,8 @@ BOOLEAN co_UserDestroyWindow(PVOID Object)
27532753
return TRUE;
27542754
}
27552755

2756+
Window->state |= WNDS_DESTROYED;
2757+
27562758
/* Destroy the window storage */
27572759
co_UserFreeWindow(Window, PsGetCurrentProcessWin32Process(), PsGetCurrentThreadWin32Thread(), TRUE);
27582760

0 commit comments

Comments
 (0)