- Fix a problem where application that used WH_CBT hook procedures were receiving destroy window notification on windows that were never created. The window was never created because the application had returned a non zero value when it was notified of window creation, which effectively destroys the window and returns failure for window creation. See CBTProc Function on MSDN. Fixes bug #4461.

svn path=/trunk/; revision=47059
This commit is contained in:
Michael Martin 2010-04-29 13:41:32 +00:00
parent 0ec839d544
commit d34a8d86bc

View file

@ -2468,7 +2468,23 @@ AllocErr:
CLEANUP:
if (!_ret_ && Window && Window->Wnd && ti)
{
ULONG SavedHooks;
/* HACK: co_UserDestroyWindow will call CBT proc with code HCBT_DESTROYWND.
Applications can choke on this as a hwnd was never returned from this call */
/* Save the flags */
SavedHooks = ((PTHREADINFO)PsGetCurrentThreadWin32Thread())->fsHooks;
/* Temporary remove the flag */
((PTHREADINFO)PsGetCurrentThreadWin32Thread())->fsHooks &= ~HOOKID_TO_FLAG(WH_CBT);
/* Destroy the window */
co_UserDestroyWindow(Window);
/* Restore the flag */
((PTHREADINFO)PsGetCurrentThreadWin32Thread())->fsHooks = SavedHooks;
}
// UserFreeWindowInfo(ti, Window);
if (Window)
{