[USP10_WINETEST] Sync with Wine Staging 2.9. CORE-13362
[reactos.git] / rostests / kmtests / ntos_io / IoCreateFile_user.c
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 KmtLoadDriver(L"IoCreateFile", FALSE);
22 KmtOpenDriver();
23
24 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, NonSymlinkedFileName);
25 ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
26 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, SymlinkedFileName);
27 ok(Error == ERROR_CANT_ACCESS_FILE, "Expected ERROR_CANT_ACCESS_FILE, got %lx\n", Error); /* FIXME */
28 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, MountedPointFileName);
29 ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
30
31 Error = KmtSendToDriver(IOCTL_DISABLE_SYMLINK);
32 ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
33
34 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, NonSymlinkedFileName);
35 ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
36 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, SymlinkedFileName);
37 ok(Error == ERROR_MR_MID_NOT_FOUND, "Expected ERROR_MR_MID_NOT_FOUND, got %lx\n", Error);
38 Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, MountedPointFileName);
39 ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
40
41 KmtCloseDriver();
42 KmtUnloadDriver();
43 }