diff --git a/rostests/apitests/ntdll/CMakeLists.txt b/rostests/apitests/ntdll/CMakeLists.txt index 4fa5026dd84..582b54d8fd0 100644 --- a/rostests/apitests/ntdll/CMakeLists.txt +++ b/rostests/apitests/ntdll/CMakeLists.txt @@ -2,6 +2,7 @@ list(APPEND SOURCE LdrEnumResources.c NtAllocateVirtualMemory.c + NtCreateThread.c NtFreeVirtualMemory.c NtMapViewOfSection.c NtProtectVirtualMemory.c diff --git a/rostests/apitests/ntdll/NtCreateThread.c b/rostests/apitests/ntdll/NtCreateThread.c new file mode 100644 index 00000000000..dcb19215721 --- /dev/null +++ b/rostests/apitests/ntdll/NtCreateThread.c @@ -0,0 +1,33 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: See COPYING in the top level directory + * PURPOSE: Test for NtCreateThread + * PROGRAMMER: Aleksandar Andrejevic + */ + +#define WIN32_NO_STATUS +#include +#include +#include + +START_TEST(NtCreateThread) +{ + NTSTATUS Status; + INITIAL_TEB InitialTeb; + HANDLE ThreadHandle; + OBJECT_ATTRIBUTES Attributes; + + InitializeObjectAttributes(&Attributes, NULL, 0, NULL, NULL); + ZeroMemory(&InitialTeb, sizeof(INITIAL_TEB)); + + Status = NtCreateThread(&ThreadHandle, + 0, + &Attributes, + NtCurrentProcess(), + NULL, + (PCONTEXT)0x70000000, /* Aligned usermode address */ + &InitialTeb, + FALSE); + + ok_hex(Status, STATUS_ACCESS_VIOLATION); +} diff --git a/rostests/apitests/ntdll/testlist.c b/rostests/apitests/ntdll/testlist.c index 3c1d2fd250e..ecf997d45db 100644 --- a/rostests/apitests/ntdll/testlist.c +++ b/rostests/apitests/ntdll/testlist.c @@ -5,6 +5,7 @@ extern void func_LdrEnumResources(void); extern void func_NtAllocateVirtualMemory(void); +extern void func_NtCreateThread(void); extern void func_NtFreeVirtualMemory(void); extern void func_NtMapViewOfSection(void); extern void func_NtProtectVirtualMemory(void); @@ -28,6 +29,7 @@ const struct test winetest_testlist[] = { { "LdrEnumResources", func_LdrEnumResources }, { "NtAllocateVirtualMemory", func_NtAllocateVirtualMemory }, + { "NtCreateThread", func_NtCreateThread }, { "NtFreeVirtualMemory", func_NtFreeVirtualMemory }, { "NtMapViewOfSection", func_NtMapViewOfSection }, { "NtProtectVirtualMemory", func_NtProtectVirtualMemory },