-- v2: ntoskrnl.exe/tests: Add Driver Object Extension Tests.
From: Etaash Mathamsetty etaash.mathamsetty@gmail.com
--- dlls/ntoskrnl.exe/tests/driver.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index d293889c823..967e6c214b0 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -2293,6 +2293,32 @@ static void test_permanence(void) ok(status == STATUS_OBJECT_NAME_NOT_FOUND, "got %#lx\n", status); }
+static void test_driver_object_extension(void) +{ + NTSTATUS status; + void *driver_obj_ext = NULL; + void *get_obj_ext = NULL; + + status = IoAllocateDriverObjectExtension(NULL, NULL, 0, NULL); + todo_wine ok(status == STATUS_INVALID_PARAMETER, "got %#lx\n", status); + + status = IoAllocateDriverObjectExtension(driver_obj, NULL, 100, NULL); + todo_wine ok(status == STATUS_INVALID_PARAMETER, "got %#lx\n", status); + + status = IoAllocateDriverObjectExtension(driver_obj, NULL, 100, &driver_obj_ext); + todo_wine ok(status == STATUS_SUCCESS, "got %#lx\n", status); + todo_wine ok(driver_obj_ext != NULL, "got NULL\n"); + + status = IoAllocateDriverObjectExtension(driver_obj, NULL, 100, &driver_obj_ext); + todo_wine ok(status == STATUS_OBJECT_NAME_COLLISION, "got %#lx\n", status); + + get_obj_ext = IoGetDriverObjectExtension(driver_obj, NULL); + todo_wine ok(get_obj_ext == driver_obj_ext && get_obj_ext != NULL, "got %p\n", get_obj_ext); + + get_obj_ext = IoGetDriverObjectExtension(driver_obj, (void *)0xdead); + ok(get_obj_ext == NULL, "got %p\n", get_obj_ext); +} + static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *stack) { void *buffer = irp->AssociatedIrp.SystemBuffer; @@ -2336,6 +2362,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st test_dpc(); test_process_memory(test_input); test_permanence(); + test_driver_object_extension();
IoMarkIrpPending(irp); IoQueueWorkItem(work_item, main_test_task, DelayedWorkQueue, irp);
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=128067
Your paranoid android.
=== w7u_2qxl (testbot log) ===
WineRunTask.pl:error: An error occurred while waiting for the test to complete: the 1376 process does not exist or is not a child process WineRunTask.pl:error: The test VM has crashed, rebooted or lost connectivity (or the TestAgent server died)
=== w7u_el (testbot log) ===
WineRunTask.pl:error: An error occurred while waiting for the test to complete: network read got a premature EOF (wait2/connect:AgentVersion.h:0/9) WineRunTask.pl:error: The test VM has crashed, rebooted or lost connectivity (or the TestAgent server died)
=== w8 (testbot log) ===
WineRunTask.pl:error: An error occurred while waiting for the test to complete: the 2656 process does not exist or is not a child process WineRunTask.pl:error: The test VM has crashed, rebooted or lost connectivity (or the TestAgent server died)
=== w1064_tsign (testbot log) ===
WineRunTask.pl:error: An error occurred while waiting for the test to complete: the 468 process does not exist or is not a child process WineRunTask.pl:error: The test VM has crashed, rebooted or lost connectivity (or the TestAgent server died)