mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 03:46:38 +00:00
Optimize IsChild() to use the desktop heap instead of calling win32k
svn path=/trunk/; revision=30519
This commit is contained in:
parent
1e40d2861b
commit
0a9026f76e
1 changed files with 32 additions and 10 deletions
|
@ -1252,18 +1252,40 @@ BOOL STDCALL
|
||||||
IsChild(HWND hWndParent,
|
IsChild(HWND hWndParent,
|
||||||
HWND hWnd)
|
HWND hWnd)
|
||||||
{
|
{
|
||||||
if (! IsWindow(hWndParent) || ! IsWindow(hWnd))
|
PWINDOW WndParent, Wnd;
|
||||||
{
|
BOOL Ret = FALSE;
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
do
|
WndParent = ValidateHwnd(hWndParent);
|
||||||
{
|
if (!WndParent)
|
||||||
hWnd = (HWND)NtUserGetWindowLong(hWnd, GWL_HWNDPARENT, FALSE);
|
return FALSE;
|
||||||
}
|
Wnd = ValidateHwnd(hWnd);
|
||||||
while (hWnd != NULL && hWnd != hWndParent);
|
if (!Wnd)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
return hWnd == hWndParent;
|
_SEH_TRY
|
||||||
|
{
|
||||||
|
while (Wnd != NULL)
|
||||||
|
{
|
||||||
|
if (Wnd->Parent != NULL)
|
||||||
|
{
|
||||||
|
Wnd = DesktopPtrToUser(Wnd->Parent);
|
||||||
|
if (Wnd == WndParent)
|
||||||
|
{
|
||||||
|
Ret = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_SEH_HANDLE
|
||||||
|
{
|
||||||
|
/* Do nothing */
|
||||||
|
}
|
||||||
|
_SEH_END;
|
||||||
|
|
||||||
|
return Ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue