[WIN32SS][USER32] Make IsHungAppWindow check FNID (#1245)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Tue, 15 Jan 2019 11:32:23 +0000 (20:32 +0900)
committerGitHub <noreply@github.com>
Tue, 15 Jan 2019 11:32:23 +0000 (20:32 +0900)
CORE-11944

win32ss/user/user32/windows/window.c

index 4485c24..ccf0670 100644 (file)
@@ -1841,13 +1841,16 @@ 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));
-    if (NtUserGetClassName(hwnd, FALSE, &ClassName) &&
+    Window = ValidateHwnd(hwnd);
+    if (Window && Window->fnid == FNID_GHOST &&
+        NtUserGetClassName(hwnd, FALSE, &ClassName) &&
         RtlEqualUnicodeString(&ClassName, &GhostClass, TRUE))
     {
         return TRUE;