mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 01:24:38 +00:00
[NTUSER] co_UserDestroyWindow: Validate window before destroying it (#5054)
Prevent the window from being destroyed twice fixes BSOD 0x1E CORE-18821
This commit is contained in:
parent
15c755e5f9
commit
77d4653164
1 changed files with 9 additions and 0 deletions
|
@ -2845,6 +2845,15 @@ BOOLEAN co_UserDestroyWindow(PVOID Object)
|
|||
|
||||
ASSERT_REFS_CO(Window); // FIXME: Temp HACK?
|
||||
|
||||
/* NtUserDestroyWindow does check if the window has already been destroyed
|
||||
but co_UserDestroyWindow can be called from more paths which means
|
||||
that it can also be called for a window that has already been destroyed. */
|
||||
if (!IntIsWindow(UserHMGetHandle(Window)))
|
||||
{
|
||||
TRACE("Tried to destroy a window twice\n");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
hWnd = Window->head.h;
|
||||
ti = PsGetCurrentThreadWin32Thread();
|
||||
|
||||
|
|
Loading…
Reference in a new issue