|
5 | 5 | * FILE: win32ss/user/ntuser/window.c
|
6 | 6 | * PROGRAMER: Casper S. Hornstrup ([email protected])
|
7 | 7 | */
|
8 |
| - |
| 8 | +// |
9 | 9 | #include <win32k.h>
|
10 | 10 | DBG_DEFAULT_CHANNEL(UserWnd);
|
11 | 11 |
|
@@ -581,7 +581,7 @@ LRESULT co_UserFreeWindow(PWND Window,
|
581 | 581 | MsqRemoveWindowMessagesFromQueue(Window);
|
582 | 582 |
|
583 | 583 | /* from now on no messages can be sent to this window anymore */
|
584 |
| - Window->state |= WNDS_DESTROYED; |
| 584 | + //Window->state |= WNDS_DESTROYED; |
585 | 585 | Window->fnid |= FNID_FREED;
|
586 | 586 |
|
587 | 587 | /* don't remove the WINDOWSTATUS_DESTROYING bit */
|
@@ -2599,7 +2599,7 @@ BOOLEAN co_UserDestroyWindow(PVOID Object)
|
2599 | 2599 | {
|
2600 | 2600 | if ((Window->style & (WS_POPUP|WS_CHILD)) != WS_CHILD)
|
2601 | 2601 | {
|
2602 |
| - if (Window->spwndOwner) |
| 2602 | + if (VerifyWnd(Window->spwndOwner)) |
2603 | 2603 | {
|
2604 | 2604 | //ERR("DestroyWindow Owner out.\n");
|
2605 | 2605 | UserAttachThreadInput(Window->head.pti, Window->spwndOwner->head.pti, FALSE);
|
@@ -2635,7 +2635,7 @@ BOOLEAN co_UserDestroyWindow(PVOID Object)
|
2635 | 2635 | // Adjust last active.
|
2636 | 2636 | if ((pwndTemp = Window->spwndOwner))
|
2637 | 2637 | {
|
2638 |
| - while (pwndTemp->spwndOwner) |
| 2638 | + while (VerifyWnd(pwndTemp->spwndOwner)) |
2639 | 2639 | pwndTemp = pwndTemp->spwndOwner;
|
2640 | 2640 |
|
2641 | 2641 | if (pwndTemp->spwndLastActive == Window)
|
@@ -2753,6 +2753,8 @@ BOOLEAN co_UserDestroyWindow(PVOID Object)
|
2753 | 2753 | return TRUE;
|
2754 | 2754 | }
|
2755 | 2755 |
|
| 2756 | + Window->state |= WNDS_DESTROYED; |
| 2757 | + |
2756 | 2758 | /* Destroy the window storage */
|
2757 | 2759 | co_UserFreeWindow(Window, PsGetCurrentProcessWin32Process(), PsGetCurrentThreadWin32Thread(), TRUE);
|
2758 | 2760 |
|
|
0 commit comments