From: Zebediah Figura zfigura@codeweavers.com
--- dlls/ntoskrnl.exe/tests/driver_pnp.c | 9 ++++++++- dlls/ntoskrnl.exe/tests/ntoskrnl.c | 22 +++++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/dlls/ntoskrnl.exe/tests/driver_pnp.c b/dlls/ntoskrnl.exe/tests/driver_pnp.c index 9a965f584cd..629f1eda205 100644 --- a/dlls/ntoskrnl.exe/tests/driver_pnp.c +++ b/dlls/ntoskrnl.exe/tests/driver_pnp.c @@ -178,7 +178,7 @@ static NTSTATUS fdo_pnp(IRP *irp)
static NTSTATUS query_id(struct device *device, IRP *irp, BUS_QUERY_ID_TYPE type) { - static const WCHAR device_id[] = L"wine\test"; + static const WCHAR device_id[] = L"Wine\Test"; WCHAR *id = NULL;
irp->IoStatus.Information = 0; @@ -256,6 +256,7 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device_obj, IRP *irp)
case IRP_MN_START_DEVICE: { + static const WCHAR expect_symlink[] = L"\??\Wine#Test#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"; static const LARGE_INTEGER wait_time = {.QuadPart = -500 * 10000}; POWER_STATE state = {.DeviceState = PowerDeviceD0}; NTSTATUS status; @@ -267,6 +268,12 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device_obj, IRP *irp)
status = IoRegisterDeviceInterface(device_obj, &child_class, NULL, &device->child_symlink); ok(!status, "Failed to register interface, status %#lx.\n", status); + ok(device->child_symlink.Length == sizeof(expect_symlink) - sizeof(WCHAR), "Expected length %Iu, got %u.\n", + sizeof(expect_symlink) - sizeof(WCHAR), device->child_symlink.Length); + ok(device->child_symlink.MaximumLength == sizeof(expect_symlink), "Expected length %Iu, got %u.\n", + sizeof(expect_symlink), device->child_symlink.MaximumLength); + todo_wine ok(!memcmp(device->child_symlink.Buffer, expect_symlink, device->child_symlink.Length), + "Got symlink "%ls".\n", device->child_symlink.Buffer);
IoSetDeviceInterfaceState(&device->child_symlink, TRUE);
diff --git a/dlls/ntoskrnl.exe/tests/ntoskrnl.c b/dlls/ntoskrnl.exe/tests/ntoskrnl.c index c4521ed652a..c5362e3fb2b 100644 --- a/dlls/ntoskrnl.exe/tests/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/tests/ntoskrnl.c @@ -1406,7 +1406,7 @@ static LRESULT WINAPI device_notify_proc(HWND window, UINT message, WPARAM wpara else if (IsEqualGUID(&iface->dbcc_classguid, &child_class)) { ++got_child_arrival; - todo_wine ok(!strcmp(iface->dbcc_name, "\\?\wine#test#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"), + todo_wine ok(!strcmp(iface->dbcc_name, "\\?\Wine#Test#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"), "got name %s\n", debugstr_a(iface->dbcc_name)); } break; @@ -1434,7 +1434,7 @@ static LRESULT WINAPI device_notify_proc(HWND window, UINT message, WPARAM wpara else if (IsEqualGUID(&iface->dbcc_classguid, &child_class)) { ++got_child_removal; - todo_wine ok(!strcmp(iface->dbcc_name, "\\?\wine#test#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"), + todo_wine ok(!strcmp(iface->dbcc_name, "\\?\Wine#Test#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"), "got name %s\n", debugstr_a(iface->dbcc_name)); } break; @@ -1506,7 +1506,7 @@ static void test_pnp_devices(void)
ret = SetupDiGetDeviceInstanceIdA(set, &device, buffer, sizeof(buffer), NULL); ok(ret, "failed to get device ID, error %#lx\n", GetLastError()); - ok(!strcasecmp(buffer, "root\winetest\0"), "got ID %s\n", debugstr_a(buffer)); + ok(!strcmp(buffer, "ROOT\WINETEST\0"), "got ID %s\n", debugstr_a(buffer));
ret = SetupDiEnumDeviceInterfaces(set, NULL, &control_class, 0, &iface); ok(ret, "failed to get interface, error %#lx\n", GetLastError()); @@ -1517,7 +1517,7 @@ static void test_pnp_devices(void) iface_detail->cbSize = sizeof(*iface_detail); ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, iface_detail, sizeof(buffer), NULL, NULL); ok(ret, "failed to get interface path, error %#lx\n", GetLastError()); - ok(!strcasecmp(iface_detail->DevicePath, "\\?\root#winetest#0#{deadbeef-29ef-4538-a5fd-b69573a362c0}"), + ok(!strcmp(iface_detail->DevicePath, "\\?\root#winetest#0#{deadbeef-29ef-4538-a5fd-b69573a362c0}"), "wrong path %s\n", debugstr_a(iface_detail->DevicePath));
SetupDiDestroyDeviceInfoList(set); @@ -1614,7 +1614,7 @@ static void test_pnp_devices(void)
ret = SetupDiGetDeviceInstanceIdA(set, &device, buffer, sizeof(buffer), NULL); ok(ret, "failed to get device ID, error %#lx\n", GetLastError()); - ok(!strcasecmp(buffer, "wine\test\1"), "got ID %s\n", debugstr_a(buffer)); + ok(!strcmp(buffer, "WINE\TEST\1"), "got ID %s\n", debugstr_a(buffer));
ret = SetupDiGetDeviceRegistryPropertyA(set, &device, SPDRP_CAPABILITIES, &type, (BYTE *)&dword, sizeof(dword), NULL); @@ -1680,6 +1680,18 @@ static void test_pnp_devices(void) ok(!strcmp(buffer, "\Device\winetest_pnp_1"), "got PDO name %s\n", debugstr_a(buffer)); }
+ ret = SetupDiEnumDeviceInterfaces(set, NULL, &child_class, 0, &iface); + ok(ret, "failed to get interface, error %#lx\n", GetLastError()); + ok(IsEqualGUID(&iface.InterfaceClassGuid, &child_class), + "wrong class %s\n", debugstr_guid(&iface.InterfaceClassGuid)); + ok(iface.Flags == SPINT_ACTIVE, "got flags %#lx\n", iface.Flags); + + iface_detail->cbSize = sizeof(*iface_detail); + ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, iface_detail, sizeof(buffer), NULL, NULL); + ok(ret, "failed to get interface path, error %#lx\n", GetLastError()); + ok(!strcmp(iface_detail->DevicePath, "\\?\wine#test#1#{deadbeef-29ef-4538-a5fd-b69573a362c2}"), + "wrong path %s\n", debugstr_a(iface_detail->DevicePath)); + SetupDiDestroyDeviceInfoList(set);
RtlInitUnicodeString(&string, L"\Device\winetest_pnp_1");