[WINESYNC] setupapi: Correctly calculate the required size in SetupDiGetDeviceInterfaceDetailA().

Don't include the null terminator twice.

wine commit id 5711f03e8479936ac5e3bc71ba7987f6b7cb5586 by Zebediah Figura <zfigura@codeweavers.com>
This commit is contained in:
winesync 2023-09-14 22:04:48 +02:00 committed by Hermès Bélusca-Maïto
parent fef704dfdf
commit 060d6f2482
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 4 additions and 5 deletions

View file

@ -1236,7 +1236,7 @@ static void test_device_iface_detail(void)
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected error %#lx.\n", GetLastError());
expected_size = FIELD_OFFSET(SP_DEVICE_INTERFACE_DETAIL_DATA_A, DevicePath[strlen(path) + 1]);
todo_wine ok(size == expected_size, "Expected size %lu, got %lu.\n", expected_size, size);
ok(size == expected_size, "Expected size %lu, got %lu.\n", expected_size, size);
detail = heap_alloc(size * 2);
detail->cbSize = 0;
@ -1259,9 +1259,8 @@ static void test_device_iface_detail(void)
SetLastError(0xdeadbeef);
size = 0xdeadbeef;
ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, detail, expected_size, &size, NULL);
todo_wine ok(ret, "Failed to get interface detail, error %#lx.\n", GetLastError());
if (ret)
ok(!strcasecmp(path, detail->DevicePath), "Got unexpected path %s.\n", detail->DevicePath);
ok(ret, "Failed to get interface detail, error %#lx.\n", GetLastError());
ok(!strcasecmp(path, detail->DevicePath), "Got unexpected path %s.\n", detail->DevicePath);
todo_wine ok(size == expected_size, "Expected size %lu, got %lu.\n", expected_size, size);
SetLastError(0xdeadbeef);

View file

@ -10,4 +10,4 @@ files:
dlls/setupapi/setupcab.c: dll/win32/setupapi/setupcab.c
dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable_wine.c
tags:
wine: 60af599bb916260e8bb8a2f5d0111815f741fef4
wine: 5711f03e8479936ac5e3bc71ba7987f6b7cb5586