https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1fbed1710e0d24ea67055…
commit 1fbed1710e0d24ea670557636e10cd776b67f000
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sun Dec 4 08:58:34 2022 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Sun Dec 4 08:58:34 2022 +0900
[NTUSER] Fix SetActiveWindow return value
Apply set-active.patch. CORE-13257
---
win32ss/user/ntuser/focus.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/win32ss/user/ntuser/focus.c b/win32ss/user/ntuser/focus.c
index a72070c3542..07cc78c4f08 100644
--- a/win32ss/user/ntuser/focus.c
+++ b/win32ss/user/ntuser/focus.c
@@ -1667,7 +1667,6 @@ NtUserSetActiveWindow(HWND hWnd)
HWND hWndPrev;
PWND Window, pwndPrev;
DECLARE_RETURN(HWND);
- BOOL bActivated;
TRACE("Enter NtUserSetActiveWindow(%p)\n", hWnd);
UserEnterExclusive();
@@ -1688,11 +1687,9 @@ NtUserSetActiveWindow(HWND hWnd)
pwndPrev = gptiCurrent->MessageQueue->spwndActive;
hWndPrev = (pwndPrev ? UserHMGetHandle(pwndPrev) : NULL);
if (Window) UserRefObjectCo(Window, &Ref);
- bActivated = UserSetActiveWindow(Window);
+ UserSetActiveWindow(Window);
if (Window) UserDerefObjectCo(Window);
- if (!bActivated)
- RETURN(NULL);
- RETURN(hWndPrev ? hWndPrev : hWnd);
+ RETURN(hWndPrev ? (IntIsWindow(hWndPrev) ? hWndPrev : NULL) : NULL);
}
RETURN( NULL);