mirror of
https://github.com/reactos/reactos.git
synced 2024-09-27 21:16:34 +00:00
[0.4.13][NTUSER] co_UserDestroyWindow: Validate window before destroying it (#5054)
Prevent the window from being destroyed twice
fixes CORE-18821 'WIN32K BSOD 0x1E when opening Build menu in AVR Studio 4.19'
port of 0.4.15-dev-5938-g 77d4653164
And port back also some unrelated formatting improvements,
and kill a block of code that was commented out in all branches,
and was not x64 compatible in 0.4.7/0.4.8, and therefore was a diff already anyway.
This commit is contained in:
parent
9f69774f4e
commit
de21806b74
|
@ -739,7 +739,7 @@ IntGetWindowProc(PWND pWnd,
|
|||
PCLS Class;
|
||||
WNDPROC gcpd, Ret = 0;
|
||||
|
||||
ASSERT(UserIsEnteredExclusive() == TRUE);
|
||||
ASSERT(UserIsEnteredExclusive());
|
||||
|
||||
Class = pWnd->pcls;
|
||||
|
||||
|
@ -2588,6 +2588,9 @@ BOOLEAN co_UserDestroyWindow(PVOID Object)
|
|||
|
||||
ASSERT_REFS_CO(Window); // FIXME: Temp HACK?
|
||||
|
||||
if (!IntIsWindow(UserHMGetHandle(Window)))
|
||||
return TRUE;
|
||||
|
||||
hWnd = Window->head.h;
|
||||
ti = PsGetCurrentThreadWin32Thread();
|
||||
|
||||
|
@ -3599,13 +3602,6 @@ co_IntSetWindowLongPtr(HWND hWnd, DWORD Index, LONG_PTR NewValue, BOOL Ansi, ULO
|
|||
#endif
|
||||
{
|
||||
OldValue = *((LONG_PTR *)((PCHAR)(Window + 1) + Index));
|
||||
/*
|
||||
if ( Index == DWLP_DLGPROC && Wnd->state & WNDS_DIALOGWINDOW)
|
||||
{
|
||||
OldValue = (LONG_PTR)IntSetWindowProc( Wnd, (WNDPROC)NewValue, Ansi);
|
||||
if (!OldValue) return 0;
|
||||
}
|
||||
*/
|
||||
*((LONG_PTR*)((PCHAR)(Window + 1) + Index)) = NewValue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue