mirror of
https://github.com/reactos/reactos.git
synced 2024-07-02 02:34:53 +00:00
[KMTEST] Handle failure in KmtLoadDriver and KmtOpenDriver
This commit is contained in:
parent
53de4fd93e
commit
9e12af569f
|
@ -15,6 +15,7 @@ START_TEST(Example)
|
||||||
SYSTEM_INFO SystemInfo;
|
SYSTEM_INFO SystemInfo;
|
||||||
MY_STRUCT MyStruct[2] = { { 123, ":D" }, { 0 } };
|
MY_STRUCT MyStruct[2] = { { 123, ":D" }, { 0 } };
|
||||||
DWORD Length = sizeof MyStruct;
|
DWORD Length = sizeof MyStruct;
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
trace("Message from user-mode\n");
|
trace("Message from user-mode\n");
|
||||||
|
|
||||||
|
@ -26,9 +27,10 @@ START_TEST(Example)
|
||||||
KmtRunKernelTest("Example");
|
KmtRunKernelTest("Example");
|
||||||
|
|
||||||
/* now start the special-purpose driver */
|
/* now start the special-purpose driver */
|
||||||
KmtLoadDriver(L"Example", FALSE);
|
Error = KmtLoadAndOpenDriver(L"Example", FALSE);
|
||||||
trace("After Entry\n");
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
KmtOpenDriver();
|
if (Error)
|
||||||
|
return;
|
||||||
trace("After Create\n");
|
trace("After Create\n");
|
||||||
|
|
||||||
ok(KmtSendToDriver(IOCTL_NOTIFY) == ERROR_SUCCESS, "\n");
|
ok(KmtSendToDriver(IOCTL_NOTIFY) == ERROR_SUCCESS, "\n");
|
||||||
|
|
|
@ -22,12 +22,14 @@ START_TEST(HidPDescription)
|
||||||
KmtStartService(L"hidusb", &ServiceHandle);
|
KmtStartService(L"hidusb", &ServiceHandle);
|
||||||
CloseServiceHandle(ServiceHandle);
|
CloseServiceHandle(ServiceHandle);
|
||||||
|
|
||||||
KmtLoadDriver(L"HidP", FALSE);
|
Error = KmtLoadAndOpenDriver(L"HidP", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
Error = KmtSendToDriver(IOCTL_TEST_DESCRIPTION);
|
Error = KmtSendToDriver(IOCTL_TEST_DESCRIPTION);
|
||||||
ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
|
ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
|
||||||
|
|
||||||
KmtCloseDriver();
|
KmtCloseDriver();
|
||||||
KmtUnloadDriver();
|
KmtUnloadDriver();
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,10 +169,11 @@ VOID KmtFinishThread(IN PKTHREAD Thread OPTIONAL, IN PKEVENT Event OPTIONAL);
|
||||||
#elif defined KMT_USER_MODE
|
#elif defined KMT_USER_MODE
|
||||||
DWORD KmtRunKernelTest(IN PCSTR TestName);
|
DWORD KmtRunKernelTest(IN PCSTR TestName);
|
||||||
|
|
||||||
VOID KmtLoadDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning);
|
DWORD KmtLoadDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning);
|
||||||
VOID KmtUnloadDriver(VOID);
|
VOID KmtUnloadDriver(VOID);
|
||||||
VOID KmtOpenDriver(VOID);
|
DWORD KmtOpenDriver(VOID);
|
||||||
VOID KmtCloseDriver(VOID);
|
VOID KmtCloseDriver(VOID);
|
||||||
|
DWORD KmtLoadAndOpenDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning);
|
||||||
|
|
||||||
DWORD KmtSendToDriver(IN DWORD ControlCode);
|
DWORD KmtSendToDriver(IN DWORD ControlCode);
|
||||||
DWORD KmtSendStringToDriver(IN DWORD ControlCode, IN PCSTR String);
|
DWORD KmtSendStringToDriver(IN DWORD ControlCode, IN PCSTR String);
|
||||||
|
|
|
@ -15,9 +15,12 @@ START_TEST(FileAttributes)
|
||||||
PCWSTR FileName = L"\\\\.\\Global\\GLOBALROOT\\Device\\Kmtest-kernel32\\Somefile";
|
PCWSTR FileName = L"\\\\.\\Global\\GLOBALROOT\\Device\\Kmtest-kernel32\\Somefile";
|
||||||
BOOL Ret;
|
BOOL Ret;
|
||||||
DWORD Attributes;
|
DWORD Attributes;
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
KmtLoadDriver(L"kernel32", FALSE);
|
Error = KmtLoadAndOpenDriver(L"kernel32", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Set read-only attribute */
|
/* Set read-only attribute */
|
||||||
KmtSendUlongToDriver(IOCTL_EXPECT_SET_ATTRIBUTES, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_NORMAL);
|
KmtSendUlongToDriver(IOCTL_EXPECT_SET_ATTRIBUTES, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_NORMAL);
|
||||||
|
|
|
@ -97,9 +97,12 @@ START_TEST(FindFile)
|
||||||
const INT TestCount = sizeof(Tests) / sizeof(Tests[0]);
|
const INT TestCount = sizeof(Tests) / sizeof(Tests[0]);
|
||||||
INT i;
|
INT i;
|
||||||
WCHAR ExpressionBuffer[MAX_PATH];
|
WCHAR ExpressionBuffer[MAX_PATH];
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
KmtLoadDriver(L"kernel32", FALSE);
|
Error = KmtLoadAndOpenDriver(L"kernel32", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i = 0; i < TestCount; i++)
|
for (i = 0; i < TestCount; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -124,12 +124,11 @@ static HANDLE TestDeviceHandle;
|
||||||
* @param RestartIfRunning
|
* @param RestartIfRunning
|
||||||
* TRUE to stop and restart the service if it is already running
|
* TRUE to stop and restart the service if it is already running
|
||||||
*/
|
*/
|
||||||
VOID
|
DWORD
|
||||||
KmtLoadDriver(
|
KmtLoadDriver(
|
||||||
IN PCWSTR ServiceName,
|
IN PCWSTR ServiceName,
|
||||||
IN BOOLEAN RestartIfRunning)
|
IN BOOLEAN RestartIfRunning)
|
||||||
{
|
{
|
||||||
DWORD Error = ERROR_SUCCESS;
|
|
||||||
WCHAR ServicePath[MAX_PATH];
|
WCHAR ServicePath[MAX_PATH];
|
||||||
|
|
||||||
StringCbCopyW(ServicePath, sizeof(ServicePath), ServiceName);
|
StringCbCopyW(ServicePath, sizeof(ServicePath), ServiceName);
|
||||||
|
@ -138,13 +137,7 @@ KmtLoadDriver(
|
||||||
StringCbCopyW(TestServiceName, sizeof(TestServiceName), L"Kmtest-");
|
StringCbCopyW(TestServiceName, sizeof(TestServiceName), L"Kmtest-");
|
||||||
StringCbCatW(TestServiceName, sizeof(TestServiceName), ServiceName);
|
StringCbCatW(TestServiceName, sizeof(TestServiceName), ServiceName);
|
||||||
|
|
||||||
Error = KmtCreateAndStartService(TestServiceName, ServicePath, NULL, &TestServiceHandle, RestartIfRunning);
|
return KmtCreateAndStartService(TestServiceName, ServicePath, NULL, &TestServiceHandle, RestartIfRunning);
|
||||||
|
|
||||||
if (Error)
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
__debugbreak();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -177,7 +170,7 @@ KmtUnloadDriver(VOID)
|
||||||
*
|
*
|
||||||
* Open special-purpose driver (acquire a device handle)
|
* Open special-purpose driver (acquire a device handle)
|
||||||
*/
|
*/
|
||||||
VOID
|
DWORD
|
||||||
KmtOpenDriver(VOID)
|
KmtOpenDriver(VOID)
|
||||||
{
|
{
|
||||||
DWORD Error = ERROR_SUCCESS;
|
DWORD Error = ERROR_SUCCESS;
|
||||||
|
@ -190,12 +183,30 @@ KmtOpenDriver(VOID)
|
||||||
if (TestDeviceHandle == INVALID_HANDLE_VALUE)
|
if (TestDeviceHandle == INVALID_HANDLE_VALUE)
|
||||||
error(Error);
|
error(Error);
|
||||||
|
|
||||||
if (Error)
|
return Error;
|
||||||
{
|
}
|
||||||
// TODO
|
|
||||||
__debugbreak();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name KmtOpenDriver
|
||||||
|
*
|
||||||
|
* Load and open special-purpose driver (acquire a device handle)
|
||||||
|
*/
|
||||||
|
DWORD
|
||||||
|
KmtLoadAndOpenDriver(
|
||||||
|
IN PCWSTR ServiceName,
|
||||||
|
IN BOOLEAN RestartIfRunning)
|
||||||
|
{
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
|
Error = KmtLoadDriver(ServiceName, RestartIfRunning);
|
||||||
|
if (Error)
|
||||||
|
return Error;
|
||||||
|
|
||||||
|
Error = KmtOpenDriver();
|
||||||
|
if (Error)
|
||||||
|
return Error;
|
||||||
|
|
||||||
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -213,8 +224,7 @@ KmtCloseDriver(VOID)
|
||||||
|
|
||||||
if (Error)
|
if (Error)
|
||||||
{
|
{
|
||||||
// TODO
|
DPRINT1("CloseHandle failed: 0x%lx\n", Error);
|
||||||
__debugbreak();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,12 @@ START_TEST(CcCopyRead)
|
||||||
UNICODE_STRING ReallySmallAlignmentTest = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\ReallySmallAlignmentTest");
|
UNICODE_STRING ReallySmallAlignmentTest = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\ReallySmallAlignmentTest");
|
||||||
UNICODE_STRING FileBig = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\FileBig");
|
UNICODE_STRING FileBig = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\FileBig");
|
||||||
UNICODE_STRING BehaviourTestFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\BehaviourTestFile");
|
UNICODE_STRING BehaviourTestFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyRead\\BehaviourTestFile");
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
KmtLoadDriver(L"CcCopyRead", FALSE);
|
Error = KmtLoadAndOpenDriver(L"CcCopyRead", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &SmallAlignmentTest, OBJ_CASE_INSENSITIVE, NULL, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &SmallAlignmentTest, OBJ_CASE_INSENSITIVE, NULL, NULL);
|
||||||
Status = NtOpenFile(&Handle, FILE_ALL_ACCESS, &ObjectAttributes, &IoStatusBlock, 0, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT);
|
Status = NtOpenFile(&Handle, FILE_ALL_ACCESS, &ObjectAttributes, &IoStatusBlock, 0, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT);
|
||||||
|
|
|
@ -20,9 +20,12 @@ START_TEST(CcCopyWrite)
|
||||||
UNICODE_STRING VerySmallFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyWrite\\VerySmallFile");
|
UNICODE_STRING VerySmallFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyWrite\\VerySmallFile");
|
||||||
UNICODE_STRING NormalFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyWrite\\NormalFile");
|
UNICODE_STRING NormalFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyWrite\\NormalFile");
|
||||||
UNICODE_STRING BehaviourTestFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyWrite\\BehaviourTestFile");
|
UNICODE_STRING BehaviourTestFile = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-CcCopyWrite\\BehaviourTestFile");
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
KmtLoadDriver(L"CcCopyWrite", FALSE);
|
Error = KmtLoadAndOpenDriver(L"CcCopyWrite", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &VerySmallFile, OBJ_CASE_INSENSITIVE, NULL, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &VerySmallFile, OBJ_CASE_INSENSITIVE, NULL, NULL);
|
||||||
Status = NtOpenFile(&Handle, FILE_ALL_ACCESS, &ObjectAttributes, &IoStatusBlock, 0, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT);
|
Status = NtOpenFile(&Handle, FILE_ALL_ACCESS, &ObjectAttributes, &IoStatusBlock, 0, FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT);
|
||||||
|
|
|
@ -15,8 +15,10 @@ START_TEST(CcMapData)
|
||||||
DWORD Ret;
|
DWORD Ret;
|
||||||
ULONG TestId;
|
ULONG TestId;
|
||||||
|
|
||||||
KmtLoadDriver(L"CcMapData", FALSE);
|
Ret = KmtLoadAndOpenDriver(L"CcMapData", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Ret, ERROR_SUCCESS);
|
||||||
|
if (Ret)
|
||||||
|
return;
|
||||||
|
|
||||||
/* 3 tests for offset
|
/* 3 tests for offset
|
||||||
* 1 test for BCB
|
* 1 test for BCB
|
||||||
|
|
|
@ -15,8 +15,10 @@ START_TEST(CcPinMappedData)
|
||||||
DWORD Ret;
|
DWORD Ret;
|
||||||
ULONG TestId;
|
ULONG TestId;
|
||||||
|
|
||||||
KmtLoadDriver(L"CcPinMappedData", FALSE);
|
Ret = KmtLoadAndOpenDriver(L"CcPinMappedData", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Ret, ERROR_SUCCESS);
|
||||||
|
if (Ret)
|
||||||
|
return;
|
||||||
|
|
||||||
/* 1 basic test */
|
/* 1 basic test */
|
||||||
for (TestId = 0; TestId < 5; ++TestId)
|
for (TestId = 0; TestId < 5; ++TestId)
|
||||||
|
|
|
@ -15,8 +15,10 @@ START_TEST(CcPinRead)
|
||||||
DWORD Ret;
|
DWORD Ret;
|
||||||
ULONG TestId;
|
ULONG TestId;
|
||||||
|
|
||||||
KmtLoadDriver(L"CcPinRead", FALSE);
|
Ret = KmtLoadAndOpenDriver(L"CcPinRead", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Ret, ERROR_SUCCESS);
|
||||||
|
if (Ret)
|
||||||
|
return;
|
||||||
|
|
||||||
/* 3 tests for offset
|
/* 3 tests for offset
|
||||||
* 1 test for BCB
|
* 1 test for BCB
|
||||||
|
|
|
@ -15,8 +15,10 @@ START_TEST(CcSetFileSizes)
|
||||||
DWORD Ret;
|
DWORD Ret;
|
||||||
ULONG TestId;
|
ULONG TestId;
|
||||||
|
|
||||||
KmtLoadDriver(L"CcSetFileSizes", FALSE);
|
Ret = KmtLoadAndOpenDriver(L"CcSetFileSizes", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Ret, ERROR_SUCCESS);
|
||||||
|
if (Ret)
|
||||||
|
return;
|
||||||
|
|
||||||
/* 0: mapped data - only FS
|
/* 0: mapped data - only FS
|
||||||
* 1: copy read - only FS
|
* 1: copy read - only FS
|
||||||
|
|
|
@ -18,8 +18,10 @@ START_TEST(IoCreateFile)
|
||||||
|
|
||||||
KmtRunKernelTest("IoCreateFile");
|
KmtRunKernelTest("IoCreateFile");
|
||||||
|
|
||||||
KmtLoadDriver(L"IoCreateFile", FALSE);
|
Error = KmtLoadAndOpenDriver(L"IoCreateFile", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, NonSymlinkedFileName);
|
Error = KmtSendStringToDriver(IOCTL_CALL_CREATE, NonSymlinkedFileName);
|
||||||
ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
|
ok(Error == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lx\n", Error);
|
||||||
|
|
|
@ -9,12 +9,20 @@
|
||||||
|
|
||||||
START_TEST(IoDeviceObject)
|
START_TEST(IoDeviceObject)
|
||||||
{
|
{
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
/* make sure IoHelper has an existing service key, but is not started */
|
/* make sure IoHelper has an existing service key, but is not started */
|
||||||
KmtLoadDriver(L"IoHelper", FALSE);
|
Error = KmtLoadDriver(L"IoHelper", FALSE);
|
||||||
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
KmtUnloadDriver();
|
KmtUnloadDriver();
|
||||||
|
|
||||||
KmtLoadDriver(L"IoDeviceObject", TRUE);
|
Error = KmtLoadAndOpenDriver(L"IoDeviceObject", TRUE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
KmtCloseDriver();
|
KmtCloseDriver();
|
||||||
KmtUnloadDriver();
|
KmtUnloadDriver();
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,9 +304,12 @@ START_TEST(IoReadWrite)
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
IO_STATUS_BLOCK IoStatus;
|
IO_STATUS_BLOCK IoStatus;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
KmtLoadDriver(L"IoReadWrite", FALSE);
|
Error = KmtLoadAndOpenDriver(L"IoReadWrite", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
RtlFillMemory(&IoStatus, sizeof(IoStatus), 0x55);
|
RtlFillMemory(&IoStatus, sizeof(IoStatus), 0x55);
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
|
|
@ -86,9 +86,12 @@ START_TEST(MmMapLockedPagesSpecifyCache)
|
||||||
SYSTEM_BASIC_INFORMATION BasicInfo;
|
SYSTEM_BASIC_INFORMATION BasicInfo;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
ULONG_PTR HighestAddress;
|
ULONG_PTR HighestAddress;
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
KmtLoadDriver(L"MmMapLockedPagesSpecifyCache", FALSE);
|
Error = KmtLoadAndOpenDriver(L"MmMapLockedPagesSpecifyCache", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
// Less than a page
|
// Less than a page
|
||||||
SET_BUFFER_LENGTH(BufferLength, 2048);
|
SET_BUFFER_LENGTH(BufferLength, 2048);
|
||||||
|
|
|
@ -19,9 +19,12 @@ START_TEST(NtCreateSection)
|
||||||
UNICODE_STRING InitOnCreate = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-NtCreateSection\\InitOnCreate");
|
UNICODE_STRING InitOnCreate = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-NtCreateSection\\InitOnCreate");
|
||||||
UNICODE_STRING InitOnRW = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-NtCreateSection\\InitOnRW");
|
UNICODE_STRING InitOnRW = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-NtCreateSection\\InitOnRW");
|
||||||
UNICODE_STRING InvalidInit = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-NtCreateSection\\InvalidInit");
|
UNICODE_STRING InvalidInit = RTL_CONSTANT_STRING(L"\\Device\\Kmtest-NtCreateSection\\InvalidInit");
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
KmtLoadDriver(L"NtCreateSection", FALSE);
|
Error = KmtLoadAndOpenDriver(L"NtCreateSection", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
/* Test 0 */
|
/* Test 0 */
|
||||||
InitializeObjectAttributes(&ObjectAttributes, &InvalidInit, OBJ_CASE_INSENSITIVE, NULL, NULL);
|
InitializeObjectAttributes(&ObjectAttributes, &InvalidInit, OBJ_CASE_INSENSITIVE, NULL, NULL);
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
|
|
||||||
START_TEST(PoIrp)
|
START_TEST(PoIrp)
|
||||||
{
|
{
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
#if defined(_M_AMD64)
|
#if defined(_M_AMD64)
|
||||||
if (TRUE)
|
if (TRUE)
|
||||||
{
|
{
|
||||||
|
@ -18,8 +20,11 @@ START_TEST(PoIrp)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
KmtLoadDriver(L"PoIrp", TRUE);
|
Error = KmtLoadAndOpenDriver(L"PoIrp", TRUE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
KmtSendToDriver(IOCTL_RUN_TEST);
|
KmtSendToDriver(IOCTL_RUN_TEST);
|
||||||
KmtCloseDriver();
|
KmtCloseDriver();
|
||||||
KmtUnloadDriver();
|
KmtUnloadDriver();
|
||||||
|
|
|
@ -11,12 +11,18 @@
|
||||||
#include "tcpip.h"
|
#include "tcpip.h"
|
||||||
|
|
||||||
static
|
static
|
||||||
void
|
DWORD
|
||||||
LoadTcpIpTestDriver(void)
|
LoadTcpIpTestDriver(void)
|
||||||
{
|
{
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
/* Start the special-purpose driver */
|
/* Start the special-purpose driver */
|
||||||
KmtLoadDriver(L"TcpIp", FALSE);
|
Error = KmtLoadAndOpenDriver(L"TcpIp", FALSE);
|
||||||
KmtOpenDriver();
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
if (Error)
|
||||||
|
return Error;
|
||||||
|
|
||||||
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -32,7 +38,10 @@ START_TEST(TcpIpTdi)
|
||||||
{
|
{
|
||||||
DWORD Error;
|
DWORD Error;
|
||||||
|
|
||||||
LoadTcpIpTestDriver();
|
Error = LoadTcpIpTestDriver();
|
||||||
|
ok_eq_int(Error, 0);
|
||||||
|
if (Error)
|
||||||
|
return;
|
||||||
|
|
||||||
Error = KmtSendToDriver(IOCTL_TEST_TDI);
|
Error = KmtSendToDriver(IOCTL_TEST_TDI);
|
||||||
ok_eq_ulong(Error, ERROR_SUCCESS);
|
ok_eq_ulong(Error, ERROR_SUCCESS);
|
||||||
|
|
Loading…
Reference in a new issue