From: Elizabeth Figura <zfigura@codeweavers.com> --- dlls/ntoskrnl.exe/tests/driver.c | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/dlls/ntoskrnl.exe/tests/driver.c b/dlls/ntoskrnl.exe/tests/driver.c index ece4923dd06..aea0a0bd252 100644 --- a/dlls/ntoskrnl.exe/tests/driver.c +++ b/dlls/ntoskrnl.exe/tests/driver.c @@ -2444,6 +2444,49 @@ static void test_default_security(void) FltFreeSecurityDescriptor(sd); } +static void test_device_object(void) +{ + todo_wine ok(lower_device->Type == 3, "Got type %d.\n", lower_device->Type); + todo_wine ok(lower_device->ReferenceCount == 1, "Got refcount %ld.\n", lower_device->ReferenceCount); + ok(lower_device->DriverObject == driver_obj, "Got driver %p.\n", lower_device->DriverObject); + ok(!lower_device->NextDevice, "Got next device %p.\n", lower_device->NextDevice); + ok(lower_device->AttachedDevice == upper_device, "Got attached device %p.\n", lower_device->AttachedDevice); + ok(!lower_device->CurrentIrp, "Got current IRP %p.\n", lower_device->CurrentIrp); + ok(!lower_device->Timer, "Got timer %p.\n", lower_device->Timer); + todo_wine ok(lower_device->Flags == 0x40, "Got flags %#lx.\n", lower_device->Flags); + todo_wine ok(lower_device->Characteristics == (FILE_DEVICE_SECURE_OPEN | FILE_FLOPPY_DISKETTE | FILE_PORTABLE_DEVICE), + "Got characteristics %#lx.\n", lower_device->Characteristics); + ok(!lower_device->Vpb, "Got VPB %p.\n", lower_device->Vpb); + todo_wine ok(!lower_device->DeviceExtension, "Got extension %p.\n", lower_device->DeviceExtension); + ok(lower_device->DeviceType == FILE_DEVICE_UNKNOWN, "Got device type %#lx.\n", lower_device->DeviceType); + ok(lower_device->StackSize == 1, "Got stack size %u.\n", lower_device->StackSize); + ok(!lower_device->AlignmentRequirement, "Got alignment %lu.\n", lower_device->AlignmentRequirement); + ok(!lower_device->ActiveThreadCount, "Got thread count %lu.\n", lower_device->ActiveThreadCount); + ok(!lower_device->SectorSize, "Got sector size %u.\n", lower_device->SectorSize); + todo_wine ok(lower_device->Spare1 == 0x1, "Got Spare1 %#x.\n", lower_device->Spare1); + ok(!lower_device->Reserved, "Got Reserved %p.\n", lower_device->Reserved); + + todo_wine ok(upper_device->Type == 3, "Got type %d.\n", upper_device->Type); + ok(!upper_device->ReferenceCount, "Got refcount %ld.\n", upper_device->ReferenceCount); + ok(upper_device->DriverObject == driver_obj, "Got driver %p.\n", upper_device->DriverObject); + ok(upper_device->NextDevice == lower_device, "Got next device %p.\n", upper_device->NextDevice); + ok(!upper_device->AttachedDevice, "Got attached device %p.\n", upper_device->AttachedDevice); + todo_wine ok(!upper_device->CurrentIrp, "Got current IRP %p.\n", upper_device->CurrentIrp); + ok(!upper_device->Timer, "Got timer %p.\n", upper_device->Timer); + todo_wine ok(upper_device->Flags == 0x40, "Got flags %#lx.\n", upper_device->Flags); + todo_wine ok(upper_device->Characteristics == (FILE_DEVICE_SECURE_OPEN | FILE_READ_ONLY_DEVICE), + "Got characteristics %#lx.\n", upper_device->Characteristics); + ok(!upper_device->Vpb, "Got VPB %p.\n", upper_device->Vpb); + ok(!!upper_device->DeviceExtension, "Expected extension.\n"); + ok(upper_device->DeviceType == FILE_DEVICE_UNKNOWN, "Got device type %#lx.\n", upper_device->DeviceType); + ok(upper_device->StackSize == 2, "Got stack size %u.\n", upper_device->StackSize); + ok(!upper_device->AlignmentRequirement, "Got alignment %lu.\n", upper_device->AlignmentRequirement); + ok(!upper_device->ActiveThreadCount, "Got thread count %lu.\n", upper_device->ActiveThreadCount); + ok(!upper_device->SectorSize, "Got sector size %u.\n", upper_device->SectorSize); + ok(!upper_device->Spare1, "Got Spare1 %#x.\n", upper_device->Spare1); + ok(!upper_device->Reserved, "Got Reserved %p.\n", upper_device->Reserved); +} + static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *stack) { void *buffer = irp->AssociatedIrp.SystemBuffer; @@ -2489,6 +2532,7 @@ static NTSTATUS main_test(DEVICE_OBJECT *device, IRP *irp, IO_STACK_LOCATION *st test_permanence(); test_driver_object_extension(); test_default_security(); + test_device_object(); IoMarkIrpPending(irp); IoQueueWorkItem(work_item, main_test_task, DelayedWorkQueue, irp); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9941