mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[WIN32K:NTUSER] Add diagnostic asserts in IntLinkWindow() and IntUnlinkWindow(). Don't link a window to itself in IntLinkWindow()! Add diagnostic traces for this situation, as well as in IntLinkHwnd().
Helps in correctly fixing CORE-12071 and CORE-12085.
This commit is contained in:
parent
4d057cf626
commit
ee0511b49d
1 changed files with 14 additions and 0 deletions
|
@ -861,19 +861,28 @@ IntLinkWindow(
|
||||||
PWND WndInsertAfter /* Set to NULL if top sibling */
|
PWND WndInsertAfter /* Set to NULL if top sibling */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
if (Wnd == WndInsertAfter)
|
||||||
|
{
|
||||||
|
ERR("IntLinkWindow -- Trying to link window 0x%p to itself!!\n", Wnd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Wnd->spwndPrev = WndInsertAfter;
|
Wnd->spwndPrev = WndInsertAfter;
|
||||||
if (Wnd->spwndPrev)
|
if (Wnd->spwndPrev)
|
||||||
{
|
{
|
||||||
/* Link after WndInsertAfter */
|
/* Link after WndInsertAfter */
|
||||||
|
ASSERT(Wnd != WndInsertAfter->spwndNext);
|
||||||
Wnd->spwndNext = WndInsertAfter->spwndNext;
|
Wnd->spwndNext = WndInsertAfter->spwndNext;
|
||||||
if (Wnd->spwndNext)
|
if (Wnd->spwndNext)
|
||||||
Wnd->spwndNext->spwndPrev = Wnd;
|
Wnd->spwndNext->spwndPrev = Wnd;
|
||||||
|
|
||||||
|
ASSERT(Wnd != Wnd->spwndPrev);
|
||||||
Wnd->spwndPrev->spwndNext = Wnd;
|
Wnd->spwndPrev->spwndNext = Wnd;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Link at the top */
|
/* Link at the top */
|
||||||
|
ASSERT(Wnd != Wnd->spwndParent->spwndChild);
|
||||||
Wnd->spwndNext = Wnd->spwndParent->spwndChild;
|
Wnd->spwndNext = Wnd->spwndParent->spwndChild;
|
||||||
if (Wnd->spwndNext)
|
if (Wnd->spwndNext)
|
||||||
Wnd->spwndNext->spwndPrev = Wnd;
|
Wnd->spwndNext->spwndPrev = Wnd;
|
||||||
|
@ -956,6 +965,8 @@ VOID FASTCALL IntLinkHwnd(PWND Wnd, HWND hWndPrev)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Wnd == WndInsertAfter)
|
||||||
|
ERR("IntLinkHwnd -- Trying to link window 0x%p to itself!!\n", Wnd);
|
||||||
IntLinkWindow(Wnd, WndInsertAfter);
|
IntLinkWindow(Wnd, WndInsertAfter);
|
||||||
|
|
||||||
/* Fix the WS_EX_TOPMOST flag */
|
/* Fix the WS_EX_TOPMOST flag */
|
||||||
|
@ -1254,6 +1265,9 @@ co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
IntUnlinkWindow(PWND Wnd)
|
IntUnlinkWindow(PWND Wnd)
|
||||||
{
|
{
|
||||||
|
ASSERT(Wnd != Wnd->spwndNext);
|
||||||
|
ASSERT(Wnd != Wnd->spwndPrev);
|
||||||
|
|
||||||
if (Wnd->spwndNext)
|
if (Wnd->spwndNext)
|
||||||
Wnd->spwndNext->spwndPrev = Wnd->spwndPrev;
|
Wnd->spwndNext->spwndPrev = Wnd->spwndPrev;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue