Re: [PATCH v2 0/1] MR3447: ntdll/unix: NtTerminateThread should accept NULL handle
On Tue Aug 15 14:52:18 2023 +0000, Ake Rehnman wrote:
```plaintext int test_ntterminatethread_proc_failed; DWORD WINAPI test_ntterminatethread_proc( void *arg ) { DWORD status = (UINT_PTR)arg; status = pNtTerminateThread(0, status); test_ntterminatethread_proc_failed = 1; return status; } /* verifies NtTerminateThread accepts NULL handle */ static void test_terminate_thread(void) { HANDLE thread; DWORD exitcode; NTSTATUS status; test_ntterminatethread_proc_failed = 0; status = pNtCreateThreadEx( &thread, THREAD_ALL_ACCESS, NULL, GetCurrentProcess(), (PRTL_THREAD_START_ROUTINE)test_ntterminatethread_proc, (void*)0x1234, 0, 0, 0, 0, NULL ); ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status ); WaitForSingleObject(thread, INFINITE); GetExitCodeThread(thread, &exitcode); ok( exitcode == 0x1234, "NtTerminateThread failed exitcode = %lx\n", (long)exitcode); ok( test_ntterminatethread_proc_failed == 0, "NtTerminateThread failed\n"); } ``` Better?
The reason it was not in the test case is I already tested it in the snippet in the Bugzilla ticket. The test case was more for making sure it did not pop up again. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3447#note_42339
participants (1)
-
Ake Rehnman (@ake.rehnman)