Author: tfaber
Date: Thu Jun 29 15:30:23 2017
New Revision: 75235
URL:
http://svn.reactos.org/svn/reactos?rev=75235&view=rev
Log:
[KMTESTS:KERNEL32]
- Rename FindFile_drv to kernel32_drv (and perform some other appropriate renames), since
it can be used for multiple tests, not just FindFile
- Change license to LGPL (this is okay since nobody but me has touched these files)
CORE-13495
Added:
trunk/rostests/kmtests/kernel32/kernel32_drv.c
- copied, changed from r75234, trunk/rostests/kmtests/kernel32/FindFile_drv.c
trunk/rostests/kmtests/kernel32/kernel32_test.h
- copied, changed from r75234, trunk/rostests/kmtests/kernel32/FindFile.h
Removed:
trunk/rostests/kmtests/kernel32/FindFile.h
trunk/rostests/kmtests/kernel32/FindFile_drv.c
Modified:
trunk/rostests/kmtests/CMakeLists.txt
trunk/rostests/kmtests/kernel32/CMakeLists.txt
trunk/rostests/kmtests/kernel32/FindFile_user.c
Modified: trunk/rostests/kmtests/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/CMakeLists.txt?re…
==============================================================================
--- trunk/rostests/kmtests/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/kmtests/CMakeLists.txt [iso-8859-1] Thu Jun 29 15:30:23 2017
@@ -155,12 +155,12 @@
add_dependencies(kmtest_drivers
kmtest_drv
example_drv
- findfile_drv
hidp_drv
iocreatefile_drv
iodeviceobject_drv
iohelper_drv
ioreadwrite_drv
+ kernel32_drv
mmmaplockedpagesspecifycache_drv
ntcreatesection_drv
poirp_drv
Modified: trunk/rostests/kmtests/kernel32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/kernel32/CMakeLis…
==============================================================================
--- trunk/rostests/kmtests/kernel32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/kmtests/kernel32/CMakeLists.txt [iso-8859-1] Thu Jun 29 15:30:23 2017
@@ -1,14 +1,14 @@
include_directories(../include)
-list(APPEND FINDFILE_DRV_SOURCE
+list(APPEND KERNEL32_DRV_SOURCE
../kmtest_drv/kmtest_standalone.c
- FindFile_drv.c)
+ kernel32_drv.c)
-add_library(findfile_drv SHARED ${FINDFILE_DRV_SOURCE})
-set_module_type(findfile_drv kernelmodedriver)
-target_link_libraries(findfile_drv kmtest_printf ${PSEH_LIB})
-add_importlibs(findfile_drv ntoskrnl hal)
-add_target_compile_definitions(findfile_drv KMT_STANDALONE_DRIVER)
-#add_pch(findfile_drv ../include/kmt_test.h)
-add_rostests_file(TARGET findfile_drv)
+add_library(kernel32_drv SHARED ${KERNEL32_DRV_SOURCE})
+set_module_type(kernel32_drv kernelmodedriver)
+target_link_libraries(kernel32_drv kmtest_printf ${PSEH_LIB})
+add_importlibs(kernel32_drv ntoskrnl hal)
+add_target_compile_definitions(kernel32_drv KMT_STANDALONE_DRIVER)
+#add_pch(kernel32_drv ../include/kmt_test.h)
+add_rostests_file(TARGET kernel32_drv)
Removed: trunk/rostests/kmtests/kernel32/FindFile.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/kernel32/FindFile…
==============================================================================
--- trunk/rostests/kmtests/kernel32/FindFile.h [iso-8859-1] (original)
+++ trunk/rostests/kmtests/kernel32/FindFile.h (removed)
@@ -1,13 +0,0 @@
-/*
- * PROJECT: ReactOS kernel-mode tests
- * LICENSE: GPLv2+ - See COPYING in the top level directory
- * PURPOSE: FindFirstFile wildcard substitution test declarations
- * PROGRAMMER: Thomas Faber <thomas.faber(a)reactos.org>
- */
-
-#ifndef _KMTEST_FINDFILE_H_
-#define _KMTEST_FINDFILE_H_
-
-#define IOCTL_EXPECT 1
-
-#endif /* !defined _KMTEST_FINDFILE_H_ */
Removed: trunk/rostests/kmtests/kernel32/FindFile_drv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/kernel32/FindFile…
==============================================================================
--- trunk/rostests/kmtests/kernel32/FindFile_drv.c [iso-8859-1] (original)
+++ trunk/rostests/kmtests/kernel32/FindFile_drv.c (removed)
@@ -1,123 +0,0 @@
-/*
- * PROJECT: ReactOS kernel-mode tests
- * LICENSE: GPLv2+ - See COPYING in the top level directory
- * PURPOSE: Test driver for FindFirstFile's wildcard substitution
- * PROGRAMMER: Thomas Faber <thomas.faber(a)reactos.org>
- */
-
-#include <kmt_test.h>
-
-#define NDEBUG
-#include <debug.h>
-
-#include "FindFile.h"
-
-static KMT_MESSAGE_HANDLER TestMessageHandler;
-static KMT_IRP_HANDLER TestIrpHandler;
-
-static UNICODE_STRING ExpectedExpression = RTL_CONSTANT_STRING(L"<not
set>");
-static WCHAR ExpressionBuffer[MAX_PATH];
-
-NTSTATUS
-TestEntry(
- IN PDRIVER_OBJECT DriverObject,
- IN PCUNICODE_STRING RegistryPath,
- OUT PCWSTR *DeviceName,
- IN OUT INT *Flags)
-{
- NTSTATUS Status = STATUS_SUCCESS;
-
- PAGED_CODE();
-
- UNREFERENCED_PARAMETER(RegistryPath);
-
- *DeviceName = L"FindFile";
- *Flags = TESTENTRY_NO_EXCLUSIVE_DEVICE;
-
- KmtRegisterIrpHandler(IRP_MJ_DIRECTORY_CONTROL, NULL, TestIrpHandler);
- KmtRegisterMessageHandler(0, NULL, TestMessageHandler);
-
- return Status;
-}
-
-VOID
-TestUnload(
- IN PDRIVER_OBJECT DriverObject)
-{
- PAGED_CODE();
-}
-
-static
-NTSTATUS
-TestMessageHandler(
- IN PDEVICE_OBJECT DeviceObject,
- IN ULONG ControlCode,
- IN PVOID Buffer OPTIONAL,
- IN SIZE_T InLength,
- IN OUT PSIZE_T OutLength)
-{
- NTSTATUS Status = STATUS_SUCCESS;
-
- PAGED_CODE();
-
- switch (ControlCode)
- {
- case IOCTL_EXPECT:
- {
- C_ASSERT(sizeof(ExpressionBuffer) <= UNICODE_STRING_MAX_BYTES);
- DPRINT("IOCTL_EXPECT, InLength = %lu\n", InLength);
- if (InLength > sizeof(ExpressionBuffer))
- return STATUS_BUFFER_OVERFLOW;
-
- if (InLength % sizeof(WCHAR) != 0)
- return STATUS_INVALID_PARAMETER;
-
- RtlInitEmptyUnicodeString(&ExpectedExpression, ExpressionBuffer,
sizeof(ExpressionBuffer));
- RtlCopyMemory(ExpressionBuffer, Buffer, InLength);
- ExpectedExpression.Length = (USHORT)InLength;
- DPRINT("IOCTL_EXPECT: %wZ\n", &ExpectedExpression);
-
- break;
- }
- default:
- return STATUS_NOT_SUPPORTED;
- }
-
- return Status;
-}
-
-static
-NTSTATUS
-TestIrpHandler(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
- IN PIO_STACK_LOCATION IoStackLocation)
-{
- NTSTATUS Status = STATUS_NOT_SUPPORTED;
-
- PAGED_CODE();
-
- DPRINT("IRP %x/%x\n", IoStackLocation->MajorFunction,
IoStackLocation->MinorFunction);
- ASSERT(IoStackLocation->MajorFunction == IRP_MJ_DIRECTORY_CONTROL);
-
- ok(IoStackLocation->MinorFunction == IRP_MN_QUERY_DIRECTORY, "Minor function:
%u\n", IoStackLocation->MinorFunction);
- if (IoStackLocation->MinorFunction == IRP_MN_QUERY_DIRECTORY)
- {
- ok(IoStackLocation->Parameters.QueryDirectory.FileInformationClass ==
FileBothDirectoryInformation,
- "FileInformationClass: %d\n",
IoStackLocation->Parameters.QueryDirectory.FileInformationClass);
- if (IoStackLocation->Parameters.QueryDirectory.FileInformationClass ==
FileBothDirectoryInformation)
- {
-
ok(RtlEqualUnicodeString(IoStackLocation->Parameters.QueryDirectory.FileName,
&ExpectedExpression, FALSE),
- "Expression is '%wZ', expected '%wZ'\n",
IoStackLocation->Parameters.QueryDirectory.FileName, &ExpectedExpression);
- RtlZeroMemory(Irp->UserBuffer,
IoStackLocation->Parameters.QueryDirectory.Length);
- Status = STATUS_SUCCESS;
- }
- }
-
- Irp->IoStatus.Status = Status;
- Irp->IoStatus.Information = 0;
-
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
-
- return Status;
-}
Modified: trunk/rostests/kmtests/kernel32/FindFile_user.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/kernel32/FindFile…
==============================================================================
--- trunk/rostests/kmtests/kernel32/FindFile_user.c [iso-8859-1] (original)
+++ trunk/rostests/kmtests/kernel32/FindFile_user.c [iso-8859-1] Thu Jun 29 15:30:23 2017
@@ -1,13 +1,13 @@
/*
* PROJECT: ReactOS kernel-mode tests
- * LICENSE: GPLv2+ - See COPYING in the top level directory
+ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
* PURPOSE: Test for FindFirstFile's wildcard substitution
* PROGRAMMER: Thomas Faber <thomas.faber(a)reactos.org>
*/
#include <kmt_test.h>
-#include "FindFile.h"
+#include "kernel32_test.h"
START_TEST(FindFile)
{
@@ -98,14 +98,14 @@
INT i;
WCHAR ExpressionBuffer[MAX_PATH];
- KmtLoadDriver(L"FindFile", FALSE);
+ KmtLoadDriver(L"kernel32", FALSE);
KmtOpenDriver();
for (i = 0; i < TestCount; i++)
{
trace("[%d] '%ls', '%ls'\n", i, Tests[i].Expression,
Tests[i].ExpectedExpression);
- KmtSendWStringToDriver(IOCTL_EXPECT, Tests[i].ExpectedExpression);
- wcscpy(ExpressionBuffer,
L"\\\\.\\Global\\GLOBALROOT\\Device\\Kmtest-FindFile\\");
+ KmtSendWStringToDriver(IOCTL_EXPECT_EXPRESSION, Tests[i].ExpectedExpression);
+ wcscpy(ExpressionBuffer,
L"\\\\.\\Global\\GLOBALROOT\\Device\\Kmtest-kernel32\\");
wcscat(ExpressionBuffer, Tests[i].Expression);
FindHandle = FindFirstFileW(ExpressionBuffer, &FindData);
ok(FindHandle != NULL && FindHandle != INVALID_HANDLE_VALUE,
"Handle: %p, error=%lu\n", (PVOID)FindHandle, GetLastError());
Copied: trunk/rostests/kmtests/kernel32/kernel32_drv.c (from r75234,
trunk/rostests/kmtests/kernel32/FindFile_drv.c)
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/kernel32/kernel32…
==============================================================================
--- trunk/rostests/kmtests/kernel32/FindFile_drv.c [iso-8859-1] (original)
+++ trunk/rostests/kmtests/kernel32/kernel32_drv.c [iso-8859-1] Thu Jun 29 15:30:23 2017
@@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS kernel-mode tests
- * LICENSE: GPLv2+ - See COPYING in the top level directory
- * PURPOSE: Test driver for FindFirstFile's wildcard substitution
+ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
+ * PURPOSE: Test driver for kernel32 filesystem tests
* PROGRAMMER: Thomas Faber <thomas.faber(a)reactos.org>
*/
@@ -10,10 +10,10 @@
#define NDEBUG
#include <debug.h>
-#include "FindFile.h"
+#include "kernel32_test.h"
static KMT_MESSAGE_HANDLER TestMessageHandler;
-static KMT_IRP_HANDLER TestIrpHandler;
+static KMT_IRP_HANDLER TestDirectoryControl;
static UNICODE_STRING ExpectedExpression = RTL_CONSTANT_STRING(L"<not
set>");
static WCHAR ExpressionBuffer[MAX_PATH];
@@ -31,10 +31,10 @@
UNREFERENCED_PARAMETER(RegistryPath);
- *DeviceName = L"FindFile";
+ *DeviceName = L"kernel32";
*Flags = TESTENTRY_NO_EXCLUSIVE_DEVICE;
- KmtRegisterIrpHandler(IRP_MJ_DIRECTORY_CONTROL, NULL, TestIrpHandler);
+ KmtRegisterIrpHandler(IRP_MJ_DIRECTORY_CONTROL, NULL, TestDirectoryControl);
KmtRegisterMessageHandler(0, NULL, TestMessageHandler);
return Status;
@@ -62,10 +62,10 @@
switch (ControlCode)
{
- case IOCTL_EXPECT:
+ case IOCTL_EXPECT_EXPRESSION:
{
C_ASSERT(sizeof(ExpressionBuffer) <= UNICODE_STRING_MAX_BYTES);
- DPRINT("IOCTL_EXPECT, InLength = %lu\n", InLength);
+ DPRINT("IOCTL_EXPECT_EXPRESSION, InLength = %lu\n", InLength);
if (InLength > sizeof(ExpressionBuffer))
return STATUS_BUFFER_OVERFLOW;
@@ -75,7 +75,7 @@
RtlInitEmptyUnicodeString(&ExpectedExpression, ExpressionBuffer,
sizeof(ExpressionBuffer));
RtlCopyMemory(ExpressionBuffer, Buffer, InLength);
ExpectedExpression.Length = (USHORT)InLength;
- DPRINT("IOCTL_EXPECT: %wZ\n", &ExpectedExpression);
+ DPRINT("IOCTL_EXPECT_EXPRESSION: %wZ\n", &ExpectedExpression);
break;
}
@@ -88,7 +88,7 @@
static
NTSTATUS
-TestIrpHandler(
+TestDirectoryControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PIO_STACK_LOCATION IoStackLocation)
Copied: trunk/rostests/kmtests/kernel32/kernel32_test.h (from r75234,
trunk/rostests/kmtests/kernel32/FindFile.h)
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/kmtests/kernel32/kernel32…
==============================================================================
--- trunk/rostests/kmtests/kernel32/FindFile.h [iso-8859-1] (original)
+++ trunk/rostests/kmtests/kernel32/kernel32_test.h [iso-8859-1] Thu Jun 29 15:30:23 2017
@@ -1,13 +1,13 @@
/*
* PROJECT: ReactOS kernel-mode tests
- * LICENSE: GPLv2+ - See COPYING in the top level directory
- * PURPOSE: FindFirstFile wildcard substitution test declarations
+ * LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
+ * PURPOSE: Kernel32 filesystem test declarations
* PROGRAMMER: Thomas Faber <thomas.faber(a)reactos.org>
*/
#ifndef _KMTEST_FINDFILE_H_
#define _KMTEST_FINDFILE_H_
-#define IOCTL_EXPECT 1
+#define IOCTL_EXPECT_EXPRESSION 1
#endif /* !defined _KMTEST_FINDFILE_H_ */