mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:33:16 +00:00
[KMTESTS:IO] Fix some failures in IoDeviceObject test. ROSTESTS-380
This commit is contained in:
parent
144e984b40
commit
04b35ecc23
5 changed files with 37 additions and 14 deletions
|
@ -170,6 +170,7 @@ VOID KmtFinishThread(IN PKTHREAD Thread OPTIONAL, IN PKEVENT Event OPTIONAL);
|
||||||
DWORD KmtRunKernelTest(IN PCSTR TestName);
|
DWORD KmtRunKernelTest(IN PCSTR TestName);
|
||||||
|
|
||||||
DWORD KmtLoadDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning);
|
DWORD KmtLoadDriver(IN PCWSTR ServiceName, IN BOOLEAN RestartIfRunning);
|
||||||
|
VOID KmtUnloadDriverKeepService(VOID);
|
||||||
VOID KmtUnloadDriver(VOID);
|
VOID KmtUnloadDriver(VOID);
|
||||||
DWORD KmtOpenDriver(VOID);
|
DWORD KmtOpenDriver(VOID);
|
||||||
VOID KmtCloseDriver(VOID);
|
VOID KmtCloseDriver(VOID);
|
||||||
|
|
|
@ -140,6 +140,24 @@ KmtLoadDriver(
|
||||||
return KmtCreateAndStartService(TestServiceName, ServicePath, NULL, &TestServiceHandle, RestartIfRunning);
|
return KmtCreateAndStartService(TestServiceName, ServicePath, NULL, &TestServiceHandle, RestartIfRunning);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @name KmtUnloadDriverKeepService
|
||||||
|
*
|
||||||
|
* Unload special-purpose driver (stop the service only)
|
||||||
|
*/
|
||||||
|
VOID
|
||||||
|
KmtUnloadDriverKeepService(VOID)
|
||||||
|
{
|
||||||
|
DWORD Error;
|
||||||
|
|
||||||
|
Error = KmtStopService(TestServiceName, &TestServiceHandle);
|
||||||
|
|
||||||
|
if (Error)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Failed to stop %ls service with error 0x%lx\n", TestServiceName, Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name KmtUnloadDriver
|
* @name KmtUnloadDriver
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* PROJECT: ReactOS kernel-mode tests
|
* PROJECT: ReactOS kernel-mode tests
|
||||||
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
||||||
* PURPOSE: Kernel-Mode Test Suite Driver Object Test Driver
|
* PURPOSE: Kernel-Mode Test Suite Device Object Test Driver
|
||||||
* PROGRAMMER: Michael Martin <martinmnet@hotmail.com>
|
* COPYRIGHT: Copyright 2009 Michael Martin (michael.martin@reactos.org)
|
||||||
* Thomas Faber <thomas.faber@reactos.org>
|
* COPYRIGHT: Copyright 2011-2023 Thomas Faber (thomas.faber@reactos.org)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <kmt_test.h>
|
#include <kmt_test.h>
|
||||||
|
@ -424,10 +424,11 @@ TestDeviceDeletion(
|
||||||
DeviceObject->DeviceType);
|
DeviceObject->DeviceType);
|
||||||
ok(DeviceObject->ActiveThreadCount == 0, "Expected ActiveThreadCount = 0, got %lu\n", DeviceObject->ActiveThreadCount);
|
ok(DeviceObject->ActiveThreadCount == 0, "Expected ActiveThreadCount = 0, got %lu\n", DeviceObject->ActiveThreadCount);
|
||||||
|
|
||||||
/*Check the extended extension */
|
/* Check the extended extension */
|
||||||
extdev = (PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension;
|
extdev = (PEXTENDED_DEVOBJ_EXTENSION)DeviceObject->DeviceObjectExtension;
|
||||||
ok(extdev->ExtensionFlags == DOE_UNLOAD_PENDING,
|
/* FIXME: Windows has the MSB set under some conditions, need to find out what this means */
|
||||||
"Expected Extended ExtensionFlags to be DOE_UNLOAD_PENDING, got %lu\n", extdev->ExtensionFlags);
|
ok((extdev->ExtensionFlags & 0x7fffffff) == DOE_UNLOAD_PENDING,
|
||||||
|
"Expected Extended ExtensionFlags to be DOE_UNLOAD_PENDING, got 0x%lx\n", extdev->ExtensionFlags);
|
||||||
ok (extdev->Type == 13, "Expected Type of 13, got %d\n", extdev->Type);
|
ok (extdev->Type == 13, "Expected Type of 13, got %d\n", extdev->Type);
|
||||||
ok (extdev->Size == 0, "Expected Size of 0, got %d\n", extdev->Size);
|
ok (extdev->Size == 0, "Expected Size of 0, got %d\n", extdev->Size);
|
||||||
ok (extdev->DeviceObject == DeviceObject, "Expected DeviceOject to match newly created device %p, got %p\n",
|
ok (extdev->DeviceObject == DeviceObject, "Expected DeviceOject to match newly created device %p, got %p\n",
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
/*
|
/*
|
||||||
* PROJECT: ReactOS kernel-mode tests
|
* PROJECT: ReactOS kernel-mode tests
|
||||||
* LICENSE: GPLv2+ - See COPYING in the top level directory
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
||||||
* PURPOSE: Kernel-Mode Test Suite Driver Object test user-mode part
|
* PURPOSE: Kernel-Mode Test Suite Device Object test user-mode part
|
||||||
* PROGRAMMER: Thomas Faber <thomas.faber@reactos.org>
|
* COPYRIGHT: Copyright 2011-2023 Thomas Faber (thomas.faber@reactos.org)
|
||||||
|
* COPYRIGHT: Copyright 2022 Timo Kreuzer (timo.kreuzer@reactos.org)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <kmt_test.h>
|
#include <kmt_test.h>
|
||||||
|
@ -16,7 +17,9 @@ START_TEST(IoDeviceObject)
|
||||||
ok_eq_int(Error, ERROR_SUCCESS);
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
if (Error)
|
if (Error)
|
||||||
return;
|
return;
|
||||||
KmtUnloadDriver();
|
/* Can't use the normal unload function here because we need the
|
||||||
|
* service to stick around. */
|
||||||
|
KmtUnloadDriverKeepService();
|
||||||
|
|
||||||
Error = KmtLoadAndOpenDriver(L"IoDeviceObject", TRUE);
|
Error = KmtLoadAndOpenDriver(L"IoDeviceObject", TRUE);
|
||||||
ok_eq_int(Error, ERROR_SUCCESS);
|
ok_eq_int(Error, ERROR_SUCCESS);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* PROJECT: ReactOS kernel-mode tests
|
* PROJECT: ReactOS kernel-mode tests
|
||||||
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
||||||
* PURPOSE: Kernel-Mode Test Suite Spin lock test
|
* PURPOSE: Kernel-Mode Test Suite Spin lock test
|
||||||
* COPYRIGHT: Copyright 2011-2023 Thomas Faber (thomas.faber@reactos.org)
|
* COPYRIGHT: Copyright 2011-2023 Thomas Faber (thomas.faber@reactos.org)
|
||||||
* COPYRIGHT: Copyright 2021 Jérôme Gardou (jerome.gardou@reactos.org)
|
* COPYRIGHT: Copyright 2021 Jérôme Gardou (jerome.gardou@reactos.org)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue