[WIN32SS][USER32] Ghost is a hung window (#1244)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Tue, 15 Jan 2019 10:40:34 +0000 (19:40 +0900)
committerGitHub <noreply@github.com>
Tue, 15 Jan 2019 10:40:34 +0000 (19:40 +0900)
IsHungAppWindow(a ghost window) == TRUE. CORE-11944

win32ss/user/user32/windows/window.c

index 7624c63..4485c24 100644 (file)
@@ -1841,6 +1841,18 @@ InternalGetWindowText(HWND hWnd, LPWSTR lpString, int nMaxCount)
 BOOL WINAPI
 IsHungAppWindow(HWND hwnd)
 {
+    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));
+    if (NtUserGetClassName(hwnd, FALSE, &ClassName) &&
+        RtlEqualUnicodeString(&ClassName, &GhostClass, TRUE))
+    {
+        return TRUE;
+    }
+
     return (NtUserQueryWindow(hwnd, QUERY_WINDOW_ISHUNG) != 0);
 }