Author: tfaber Date: Sat Sep 28 11:39:51 2013 New Revision: 60408
URL: http://svn.reactos.org/svn/reactos?rev=60408&view=rev Log: [NTDLL_APITEST] - Add a test for NtCreateFile with invalid ObjectAttributes. Patch by Aleksandar Andrejevic. CORE-7167
Added: trunk/rostests/apitests/ntdll/NtCreateFile.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 11:39:51 2013 @@ -3,6 +3,7 @@ LdrEnumResources.c NtAllocateVirtualMemory.c NtContinue.c + NtCreateFile.c NtCreateThread.c NtFreeVirtualMemory.c NtMapViewOfSection.c
Added: trunk/rostests/apitests/ntdll/NtCreateFile.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/ntdll/NtCreateFil... ============================================================================== --- trunk/rostests/apitests/ntdll/NtCreateFile.c (added) +++ trunk/rostests/apitests/ntdll/NtCreateFile.c [iso-8859-1] Sat Sep 28 11:39:51 2013 @@ -0,0 +1,34 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: See COPYING in the top level directory + * PURPOSE: Test for NtCreateFile + * PROGRAMMER: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + */ + +#define WIN32_NO_STATUS +#include <wine/test.h> +//#include <ndk/iotypes.h> +#include <ndk/iofuncs.h> +//#include <ndk/obtypes.h> +//#include <ndk/obfuncs.h> + +START_TEST(NtCreateFile) +{ + NTSTATUS Status; + HANDLE FileHandle; + IO_STATUS_BLOCK StatusBlock; + + Status = NtCreateFile(&FileHandle, + FILE_READ_DATA, + (POBJECT_ATTRIBUTES)0xCCCCCCCC, + &StatusBlock, + NULL, + FILE_ATTRIBUTE_NORMAL, + FILE_SHARE_READ, + FILE_OPEN_IF, + FILE_NON_DIRECTORY_FILE, + NULL, + 0); + + ok_hex(Status, STATUS_ACCESS_VIOLATION); +}
Propchange: trunk/rostests/apitests/ntdll/NtCreateFile.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 11:39:51 2013 @@ -6,6 +6,7 @@ extern void func_LdrEnumResources(void); extern void func_NtAllocateVirtualMemory(void); extern void func_NtContinue(void); +extern void func_NtCreateFile(void); extern void func_NtCreateThread(void); extern void func_NtFreeVirtualMemory(void); extern void func_NtMapViewOfSection(void); @@ -31,6 +32,7 @@ { "LdrEnumResources", func_LdrEnumResources }, { "NtAllocateVirtualMemory", func_NtAllocateVirtualMemory }, { "NtContinue", func_NtContinue }, + { "NtCreateFile", func_NtCreateFile }, { "NtCreateThread", func_NtCreateThread }, { "NtFreeVirtualMemory", func_NtFreeVirtualMemory }, { "NtMapViewOfSection", func_NtMapViewOfSection },