mirror of
https://github.com/reactos/reactos.git
synced 2024-11-03 05:18:55 +00:00
f44942d42f
- Properly free handles in driver (spotted by Thomas) - Remove dead code in driver (spotted by Thomas) - Send an IOCTL to stop on symlinks to allow more precise tests svn path=/trunk/; revision=69336
44 lines
1.8 KiB
C
44 lines
1.8 KiB
C
/*
|
|
* PROJECT: ReactOS kernel-mode tests
|
|
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
|
* PURPOSE: Kernel-Mode Test Suite Reparse points test user-mode part
|
|
* PROGRAMMER: Pierre Schweitzer <pierre@reactos.org>
|
|
*/
|
|
|
|
#include <kmt_test.h>
|
|
#include "IoCreateFile.h"
|
|
|
|
static CHAR MountedPointFileName[] = "\\Device\\Kmtest-IoCreateFile\\MountedPoint";
|
|
static CHAR SymlinkedFileName[] = "\\Device\\Kmtest-IoCreateFile\\Symlinked";
|
|
static CHAR NonSymlinkedFileName[] = "\\Device\\Kmtest-IoCreateFile\\NonSymlinked";
|
|
|
|
START_TEST(IoCreateFile)
|
|
{
|
|
DWORD Error;
|
|
|
|
KmtRunKernelTest("IoCreateFile");
|
|
|
|
KmtLoadDriver(L"IoCreateFile", FALSE);
|
|
KmtOpenDriver();
|
|
|
|
Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, NonSymlinkedFileName);
|
|
ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
|
|
Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, SymlinkedFileName);
|
|
ok(Error == ERROR_CANT_ACCESS_FILE, "Expected ERROR_CANT_ACCESS_FILE, got %lx\n", Error); /* FIXME */
|
|
Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, MountedPointFileName);
|
|
ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
|
|
|
|
Error = KmtSendToDriver(IOCTL_DISABLE_SYMLINK);
|
|
ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
|
|
|
|
Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, NonSymlinkedFileName);
|
|
ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
|
|
Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, SymlinkedFileName);
|
|
ok(Error == ERROR_MR_MID_NOT_FOUND, "Expected ERROR_MR_MID_NOT_FOUND, got %lx\n", Error);
|
|
Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, MountedPointFileName);
|
|
ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
|
|
|
|
KmtCloseDriver();
|
|
KmtUnloadDriver();
|
|
}
|