1 /* 2 * PROJECT: ReactOS kernel-mode tests 3 * LICENSE: GPLv2+ - See COPYING in the top level directory 4 * PURPOSE: Kernel-Mode Test Suite Reparse points test user-mode part 5 * PROGRAMMER: Pierre Schweitzer <pierre@reactos.org> 6 */ 7 8 #include <kmt_test.h> 9 #include "IoCreateFile.h" 10 11 static CHAR MountedPointFileName[] = "\\Device\\Kmtest-IoCreateFile\\MountedPoint"; 12 static CHAR SymlinkedFileName[] = "\\Device\\Kmtest-IoCreateFile\\Symlinked"; 13 static CHAR NonSymlinkedFileName[] = "\\Device\\Kmtest-IoCreateFile\\NonSymlinked"; 14 15 START_TEST(IoCreateFile) 16 { 17 DWORD Error; 18 19 KmtRunKernelTest("IoCreateFile"); 20 21 Error = KmtLoadAndOpenDriver(L"IoCreateFile", FALSE); 22 ok_eq_int(Error, ERROR_SUCCESS); 23 if (Error) 24 return; 25 26 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, NonSymlinkedFileName); 27 ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error); 28 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, SymlinkedFileName); 29 ok(Error == ERROR_CANT_ACCESS_FILE, "Expected ERROR_CANT_ACCESS_FILE, got %lx\n", Error); /* FIXME */ 30 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, MountedPointFileName); 31 ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error); 32 33 Error = KmtSendToDriver(IOCTL_DISABLE_SYMLINK); 34 ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error); 35 36 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, NonSymlinkedFileName); 37 ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error); 38 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, SymlinkedFileName); 39 ok(Error == ERROR_MR_MID_NOT_FOUND, "Expected ERROR_MR_MID_NOT_FOUND, got %lx\n", Error); 40 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, MountedPointFileName); 41 ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error); 42 43 KmtCloseDriver(); 44 KmtUnloadDriver(); 45 } 46