https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1a4732703cd4ebedecbbdf384bb6e3a5a745dbec

commit 1a4732703cd4ebedecbbdf384bb6e3a5a745dbec
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Tue Jan 15 20:32:23 2019 +0900
Commit:     GitHub <[email protected]>
CommitDate: Tue Jan 15 20:32:23 2019 +0900

    [WIN32SS][USER32] Make IsHungAppWindow check FNID (#1245)
    
    CORE-11944
---
 win32ss/user/user32/windows/window.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/win32ss/user/user32/windows/window.c 
b/win32ss/user/user32/windows/window.c
index 4485c24d82..ccf0670bc1 100644
--- a/win32ss/user/user32/windows/window.c
+++ b/win32ss/user/user32/windows/window.c
@@ -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;

Reply via email to