[NTUSER][USER32] Simplify user32.IsHungAppWindow (#4150)

Check FNID_GHOST and MsqIsHung. CORE-17894
This commit is contained in:
Katayama Hirofumi MZ 2021-12-09 00:39:57 +09:00 committed by GitHub
parent 07c534c863
commit ee3659d5d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 17 deletions

View file

@ -3991,7 +3991,7 @@ NtUserQueryWindow(HWND hWnd, DWORD Index)
break;
case QUERY_WINDOW_ISHUNG:
Result = (DWORD_PTR)MsqIsHung(pWnd->head.pti, MSQ_HUNG);
Result = (pWnd->fnid == FNID_GHOST) || MsqIsHung(pWnd->head.pti, MSQ_HUNG);
break;
case QUERY_WINDOW_REAL_ID:

View file

@ -1875,22 +1875,7 @@ InternalGetWindowText(HWND hWnd, LPWSTR lpString, int nMaxCount)
BOOL WINAPI
IsHungAppWindow(HWND hwnd)
{
PWND Window;
UNICODE_STRING ClassName;
WCHAR szClass[16];
static const UNICODE_STRING GhostClass = RTL_CONSTANT_STRING(L"Ghost");
/* Ghost is a hung window */
RtlInitEmptyUnicodeString(&ClassName, szClass, sizeof(szClass));
Window = ValidateHwnd(hwnd);
if (Window && Window->fnid == FNID_GHOST &&
NtUserGetClassName(hwnd, FALSE, &ClassName) &&
RtlEqualUnicodeString(&ClassName, &GhostClass, TRUE))
{
return TRUE;
}
return (NtUserQueryWindow(hwnd, QUERY_WINDOW_ISHUNG) != 0);
return !!NtUserQueryWindow(hwnd, QUERY_WINDOW_ISHUNG);
}
/*