Author: tfaber Date: Sat Sep 28 08:38:33 2013 New Revision: 60402
URL: http://svn.reactos.org/svn/reactos?rev=60402&view=rev Log: [NTDLL_APITEST] - Add test for NtCreateThread with invalid ThreadContext parameter. Patch by Aleksander Andrejevic. CORE-7252
Added: trunk/rostests/apitests/ntdll/NtCreateThread.c (with props) Modified: trunk/rostests/apitests/ntdll/CMakeLists.txt trunk/rostests/apitests/ntdll/testlist.c
Modified: trunk/rostests/apitests/ntdll/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/CMakeLists.... ============================================================================== --- trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/CMakeLists.txt [iso-8859-1] Sat Sep 28 08:38:33 2013 @@ -2,6 +2,7 @@ list(APPEND SOURCE LdrEnumResources.c NtAllocateVirtualMemory.c + NtCreateThread.c NtFreeVirtualMemory.c NtMapViewOfSection.c NtProtectVirtualMemory.c
Added: trunk/rostests/apitests/ntdll/NtCreateThread.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/NtCreateThr... ============================================================================== --- trunk/rostests/apitests/ntdll/NtCreateThread.c (added) +++ trunk/rostests/apitests/ntdll/NtCreateThread.c [iso-8859-1] Sat Sep 28 08:38:33 2013 @@ -0,0 +1,33 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: See COPYING in the top level directory + * PURPOSE: Test for NtCreateThread + * PROGRAMMER: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + */ + +#define WIN32_NO_STATUS +#include <wine/test.h> +#include <ndk/pstypes.h> +#include <ndk/psfuncs.h> + +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); +}
Propchange: trunk/rostests/apitests/ntdll/NtCreateThread.c ------------------------------------------------------------------------------ svn:eol-style = native
Modified: trunk/rostests/apitests/ntdll/testlist.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/testlist.c?... ============================================================================== --- trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] (original) +++ trunk/rostests/apitests/ntdll/testlist.c [iso-8859-1] Sat Sep 28 08:38:33 2013 @@ -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 @@ { { "LdrEnumResources", func_LdrEnumResources }, { "NtAllocateVirtualMemory", func_NtAllocateVirtualMemory }, + { "NtCreateThread", func_NtCreateThread }, { "NtFreeVirtualMemory", func_NtFreeVirtualMemory }, { "NtMapViewOfSection", func_NtMapViewOfSection }, { "NtProtectVirtualMemory", func_NtProtectVirtualMemory },