https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4bec8ff63e5558a3c2525…
commit 4bec8ff63e5558a3c2525b8ee006a668827430e2
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Jan 17 16:01:31 2022 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Jan 17 16:01:31 2022 +0900
[WIN32KNT_APITEST] Strengthen NtUserGetThreadState testcase (#4291)
Add some paramters to test on. CORE-17732
---
.../apitests/win32nt/ntuser/NtUserGetThreadState.c | 80 +++++++++++++++++++++-
1 file changed, 79 insertions(+), 1 deletion(-)
diff --git a/modules/rostests/apitests/win32nt/ntuser/NtUserGetThreadState.c
b/modules/rostests/apitests/win32nt/ntuser/NtUserGetThreadState.c
index 2ff394838b2..772d00b7355 100644
--- a/modules/rostests/apitests/win32nt/ntuser/NtUserGetThreadState.c
+++ b/modules/rostests/apitests/win32nt/ntuser/NtUserGetThreadState.c
@@ -2,7 +2,7 @@
* PROJECT: ReactOS api tests
* LICENSE: LGPL-2.0-or-later (
https://spdx.org/licenses/LGPL-2.0-or-later)
* PURPOSE: Test for NtUserGetThreadState
- * COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
+ * COPYRIGHT: Copyright 2021-2022 Katayama Hirofumi MZ
<katayama.hirofumi.mz(a)gmail.com>
*/
#include <win32nt.h>
@@ -73,6 +73,9 @@ static VOID DoTest_EDIT(VOID)
{
HWND hWnd, hImeWnd;
HIMC hIMC;
+ HCURSOR hCursor;
+ LPARAM ExtraInfo;
+ LONG MsgTime;
hWnd = CreateWindowA("EDIT", "Test", ES_LEFT | ES_MULTILINE |
WS_VISIBLE,
0, 0, 50, 30,
@@ -83,6 +86,9 @@ static VOID DoTest_EDIT(VOID)
hIMC = ImmGetContext(hWnd);
ok_int(hIMC != NULL, TRUE);
ok_int(hIMC == (HIMC)NtUserGetThreadState(4), TRUE);
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -92,8 +98,14 @@ static VOID DoTest_EDIT(VOID)
DO_CHECK(2, 0);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
SetCapture(hWnd);
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -103,8 +115,14 @@ static VOID DoTest_EDIT(VOID)
DO_CHECK(2, hWnd);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
ReleaseCapture();
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -114,8 +132,14 @@ static VOID DoTest_EDIT(VOID)
DO_CHECK(2, 0);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
SetFocus(hWnd);
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -125,8 +149,14 @@ static VOID DoTest_EDIT(VOID)
DO_CHECK(2, 0);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
SetActiveWindow(hWnd);
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -136,8 +166,14 @@ static VOID DoTest_EDIT(VOID)
DO_CHECK(2, 0);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
SetActiveWindow(NULL);
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -147,6 +183,9 @@ static VOID DoTest_EDIT(VOID)
DO_CHECK(2, 0);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
ImmReleaseContext(hWnd, hIMC);
DestroyWindow(hWnd);
@@ -156,6 +195,9 @@ static VOID DoTest_BUTTON(VOID)
{
HWND hWnd, hImeWnd;
HIMC hIMC;
+ HCURSOR hCursor;
+ LPARAM ExtraInfo;
+ LONG MsgTime;
hWnd = CreateWindowA("BUTTON", "Test", BS_PUSHBUTTON |
WS_VISIBLE,
0, 0, 50, 30,
@@ -168,6 +210,9 @@ static VOID DoTest_BUTTON(VOID)
hIMC = (HIMC)NtUserGetThreadState(4);
ok_int(hIMC != NULL, TRUE);
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -177,8 +222,14 @@ static VOID DoTest_BUTTON(VOID)
DO_CHECK(2, 0);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
SetCapture(hWnd);
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -188,8 +239,14 @@ static VOID DoTest_BUTTON(VOID)
DO_CHECK(2, hWnd);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
ReleaseCapture();
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -199,8 +256,14 @@ static VOID DoTest_BUTTON(VOID)
DO_CHECK(2, 0);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
SetFocus(hWnd);
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -210,8 +273,14 @@ static VOID DoTest_BUTTON(VOID)
DO_CHECK(2, 0);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
SetActiveWindow(hWnd);
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -221,8 +290,14 @@ static VOID DoTest_BUTTON(VOID)
DO_CHECK(2, 0);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
SetActiveWindow(NULL);
+ hCursor = GetCursor();
+ ExtraInfo = GetMessageExtraInfo();
+ MsgTime = GetMessageTime();
#ifdef DO_PRINT
PrintThreadState(__LINE__, hWnd);
@@ -232,6 +307,9 @@ static VOID DoTest_BUTTON(VOID)
DO_CHECK(2, 0);
DO_CHECK(3, hImeWnd);
DO_CHECK(4, hIMC);
+ DO_CHECK(6, hCursor);
+ DO_CHECK(8, ExtraInfo);
+ DO_CHECK(10, MsgTime);
DestroyWindow(hWnd);
}