ntdll/tests: Enable compilation with long types in thread.c.

Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Eric Pouech 2022-03-24 08:35:17 +01:00 committed by Alexandre Julliard
parent 0726870f7c
commit bd9b459d70
1 changed files with 11 additions and 10 deletions

View File

@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#undef WINE_NO_LONG_TYPES /* temporary for migration */
#include "ntdll_test.h"
@ -56,30 +57,30 @@ static void test_dbg_hidden_thread_creation(void)
status = pNtCreateThreadEx( &thread, THREAD_ALL_ACCESS, NULL, GetCurrentProcess(), test_NtCreateThreadEx_proc,
NULL, THREAD_CREATE_FLAGS_CREATE_SUSPENDED, 0, 0, 0, NULL );
ok( status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status );
ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status );
dbg_hidden = 0xcc;
status = NtQueryInformationThread( thread, ThreadHideFromDebugger, &dbg_hidden, sizeof(dbg_hidden), NULL );
ok( status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status );
ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status );
ok( !dbg_hidden, "Got unexpected dbg_hidden %#x.\n", dbg_hidden );
status = NtResumeThread( thread, NULL );
ok( status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status );
ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status );
WaitForSingleObject( thread, INFINITE );
CloseHandle( thread );
status = pNtCreateThreadEx( &thread, THREAD_ALL_ACCESS, NULL, GetCurrentProcess(), test_NtCreateThreadEx_proc,
NULL, THREAD_CREATE_FLAGS_CREATE_SUSPENDED | THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER,
0, 0, 0, NULL );
ok( status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status );
ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status );
dbg_hidden = 0xcc;
status = NtQueryInformationThread( thread, ThreadHideFromDebugger, &dbg_hidden, sizeof(dbg_hidden), NULL );
ok( status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status );
ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status );
ok( dbg_hidden == 1, "Got unexpected dbg_hidden %#x.\n", dbg_hidden );
status = NtResumeThread( thread, NULL );
ok( status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status );
ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status );
WaitForSingleObject( thread, INFINITE );
CloseHandle( thread );
@ -97,7 +98,7 @@ static void test_dbg_hidden_thread_creation(void)
status = RtlCreateProcessParametersEx( &params, &imageW, NULL, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, PROCESS_PARAMS_FLAG_NORMALIZED );
ok( status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status );
ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status );
/* NtCreateUserProcess() may return STATUS_INVALID_PARAMETER with some uninitialized data in create_info. */
memset( &create_info, 0, sizeof(create_info) );
@ -107,13 +108,13 @@ static void test_dbg_hidden_thread_creation(void)
NULL, NULL, 0, THREAD_CREATE_FLAGS_CREATE_SUSPENDED
| THREAD_CREATE_FLAGS_HIDE_FROM_DEBUGGER, params,
&create_info, &ps_attr );
ok( status == STATUS_INVALID_PARAMETER, "Got unexpected status %#x.\n", status );
ok( status == STATUS_INVALID_PARAMETER, "Got unexpected status %#lx.\n", status );
status = NtCreateUserProcess( &process, &thread, PROCESS_ALL_ACCESS, THREAD_ALL_ACCESS,
NULL, NULL, 0, THREAD_CREATE_FLAGS_CREATE_SUSPENDED, params,
&create_info, &ps_attr );
ok( status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status );
ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status );
status = NtTerminateProcess( process, 0 );
ok( status == STATUS_SUCCESS, "Got unexpected status %#x.\n", status );
ok( status == STATUS_SUCCESS, "Got unexpected status %#lx.\n", status );
CloseHandle( process );
CloseHandle( thread );
}