projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0e7eaf
)
[WIN32K:NTUSER] ValidateHwndNoErr: Fix window handle validation (#4981)
author
Thamatip Chitpong
<tangaming123456@outlook.com>
Sun, 22 Jan 2023 14:44:52 +0000
(21:44 +0700)
committer
GitHub
<noreply@github.com>
Sun, 22 Jan 2023 14:44:52 +0000
(17:44 +0300)
Also check window state. Addendum to
4d48b88b
.
win32ss/user/ntuser/window.c
patch
|
blob
|
history
diff --git
a/win32ss/user/ntuser/window.c
b/win32ss/user/ntuser/window.c
index
1c2b047
..
2bdc64f
100644
(file)
--- a/
win32ss/user/ntuser/window.c
+++ b/
win32ss/user/ntuser/window.c
@@
-117,8
+117,16
@@
PWND FASTCALL VerifyWnd(PWND pWnd)
PWND FASTCALL ValidateHwndNoErr(HWND hWnd)
{
- if (hWnd) return (PWND)UserGetObjectNoErr(gHandleTable, hWnd, TYPE_WINDOW);
- return NULL;
+ PWND Window;
+
+ if (!hWnd)
+ return NULL;
+
+ Window = (PWND)UserGetObjectNoErr(gHandleTable, hWnd, TYPE_WINDOW);
+ if (!Window || (Window->state & WNDS_DESTROYED))
+ return NULL;
+
+ return Window;
}
/* Temp HACK */