[WIN32K:NTUSER] Optimize IntWinListOwnedPopups() a little bit. Improve a trace.

This commit is contained in:
Hermès Bélusca-Maïto 2018-09-01 23:42:11 +02:00
parent f644a50cd7
commit e286c4c520
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -288,16 +288,19 @@ IntWinListOwnedPopups(PWND Window)
{
PWND Child, Desktop;
HWND *List;
UINT Index, NumChildren = 0;
UINT Index, NumOwned = 0;
Desktop = co_GetDesktopWindow(Window);
if (!Desktop)
return NULL;
for (Child = Desktop->spwndChild; Child; Child = Child->spwndNext)
++NumChildren;
{
if (Child->spwndOwner == Window)
++NumOwned;
}
List = ExAllocatePoolWithTag(PagedPool, (NumChildren + 1) * sizeof(HWND), USERTAG_WINDOWLIST);
List = ExAllocatePoolWithTag(PagedPool, (NumOwned + 1) * sizeof(HWND), USERTAG_WINDOWLIST);
if (!List)
{
ERR("Failed to allocate memory for children array\n");
@ -2626,7 +2629,7 @@ BOOLEAN co_UserDestroyWindow(PVOID Object)
hWnd = Window->head.h;
ti = PsGetCurrentThreadWin32Thread();
TRACE("co_UserDestroyWindow \n");
TRACE("co_UserDestroyWindow(Window = 0x%p, hWnd = 0x%p)\n", Window, hWnd);
/* Check for owner thread */
if ( Window->head.pti != PsGetCurrentThreadWin32Thread())