On Tue Aug 15 13:21:04 2023 +0000, Ake Rehnman wrote:
The most obvious test that I can think off the top of my head is
whether `NtTerminateThread(NULL, _)` returns or not. It is already in the test case for the patch.
No, I don't think so.
How do you determine whether `NtTerminateThread()` actually terminated the thread on the spot, or just returned normally to `test_ntterminatethread_proc` which *in turn* returned to the system? There's nothing between `status = pNtTerminateThread(0, status);` and `return status;` that signals that the thread was still alive after the call.
On the other hand, we *do* test that `NtTerminateProcess(0, 195);` returns to the caller without immediately terminating the process. See `dlls/kernel32/tests/loader.c` for details.