Skip to content

Commit

Permalink
[WIN32K:NTUSER] Add ASSERT() on "linking window to itself" (reactos#4749
Browse files Browse the repository at this point in the history
)

Addendum to ee0511b (0.4.10-dev-323).
CORE-18132
  • Loading branch information
SergeGautherie authored Jul 2, 2023
1 parent 5e4c6ae commit 3856076
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions win32ss/user/ntuser/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,8 @@ IntLinkWindow(
{
if (Wnd == WndInsertAfter)
{
ERR("IntLinkWindow -- Trying to link window 0x%p to itself!!\n", Wnd);
ERR("Trying to link window 0x%p to itself\n", Wnd);
ASSERT(WndInsertAfter != Wnd);
return;
}

Expand Down Expand Up @@ -1046,8 +1047,15 @@ VOID FASTCALL IntLinkHwnd(PWND Wnd, HWND hWndPrev)
}

if (Wnd == WndInsertAfter)
ERR("IntLinkHwnd -- Trying to link window 0x%p to itself!!\n", Wnd);
IntLinkWindow(Wnd, WndInsertAfter);
{
ERR("Trying to link window 0x%p to itself\n", Wnd);
ASSERT(WndInsertAfter != Wnd);
// FIXME: IntUnlinkWindow(Wnd) was already called. Continuing as is seems wrong!
}
else
{
IntLinkWindow(Wnd, WndInsertAfter);
}

/* Fix the WS_EX_TOPMOST flag */
if (!(WndInsertAfter->ExStyle & WS_EX_TOPMOST))
Expand Down

0 comments on commit 3856076

Please sign in to comment.