[WINESYNC] setupapi: Add SetupQueryInfVersionInformationA/W stub.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52616
Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id dc0aa67ce690f67ae8c12d7bed0a449c1af8c693 by Gijs Vermeulen <gijsvrm@gmail.com>

[WINESYNC] uuid: Add devguid.h.

Needed to compile Tera Term.

wine commit id e72a16b57f66b63a16bb3d1619ac4d42632cb141 by Alex Henrie <alexhenrie24@gmail.com>

[WINESYNC] setupapi/tests: Add more tests for buffer size handling in SetupDiGetDeviceInterfaceDetail().

wine commit id 60af599bb916260e8bb8a2f5d0111815f741fef4 by Zebediah Figura <zfigura@codeweavers.com>

[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>

[WINESYNC] setupapi: Fill the required size in SetupDiGetDeviceInterfaceDetail() also on success.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53387

wine commit id d15262e464ba3536567ad73f68d95e6b7f88f3aa by Zebediah Figura <zfigura@codeweavers.com>

[WINESYNC] setupapi: Use _S_I(READ|WRITE) from sys/stat.h instead of redefining them.

wine commit id a1ae33a3efb7231adf683484e9de66f84abb04d1 by Alex Henrie <alexhenrie24@gmail.com>
This commit is contained in:
winesync 2023-09-16 21:46:50 +02:00 committed by Hermès Bélusca-Maïto
parent d646fc6fc7
commit 6b280f34f5
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
6 changed files with 50 additions and 15 deletions

View file

@ -774,3 +774,21 @@ BOOL WINAPI SetupGetInfDriverStoreLocationW(
}
#endif // (_WIN32_WINNT >= _WIN32_WINNT_VISTA) || (DLL_EXPORT_VERSION >= _WIN32_WINNT_VISTA)
BOOL WINAPI SetupQueryInfVersionInformationA(SP_INF_INFORMATION *info, UINT index, const char *key, char *buff,
DWORD size, DWORD *req_size)
{
FIXME("info %p, index %d, key %s, buff %p, size %ld, req_size %p stub!\n", info, index, debugstr_a(key), buff,
size, req_size);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
BOOL WINAPI SetupQueryInfVersionInformationW(SP_INF_INFORMATION *info, UINT index, const WCHAR *key, WCHAR *buff,
DWORD size, DWORD *req_size)
{
FIXME("info %p, index %d, key %s, buff %p, size %ld, req_size %p stub!\n", info, index, debugstr_w(key), buff,
size, req_size);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}

View file

@ -477,8 +477,8 @@
@ stdcall SetupQueryInfFileInformationW(ptr long wstr long ptr)
@ stdcall SetupQueryInfOriginalFileInformationA(ptr long ptr ptr)
@ stdcall SetupQueryInfOriginalFileInformationW(ptr long ptr ptr)
@ stub SetupQueryInfVersionInformationA
@ stub SetupQueryInfVersionInformationW
@ stdcall SetupQueryInfVersionInformationA(ptr long str ptr long ptr)
@ stdcall SetupQueryInfVersionInformationW(ptr long wstr ptr long ptr)
@ stub SetupQuerySourceListA
@ stub SetupQuerySourceListW
@ stdcall SetupQuerySpaceRequiredOnDriveA(long str ptr ptr long)

View file

@ -320,10 +320,6 @@ struct callback_WtoA_context
UINT CALLBACK QUEUE_callback_WtoA( void *context, UINT notification, UINT_PTR, UINT_PTR );
/* from msvcrt/sys/stat.h */
#define _S_IWRITE 0x0080
#define _S_IREAD 0x0100
/* devinst.c */
DWORD

View file

@ -22,6 +22,8 @@
#include <fcntl.h>
#include <share.h>
#include <sys/stat.h>
#include <fdi.h>
HINSTANCE SETUPAPI_hInstance = NULL;

View file

@ -26,8 +26,8 @@
#include "wingdi.h"
#include "winuser.h"
#include "winreg.h"
#include "initguid.h"
#include "devguid.h"
#include "initguid.h"
#include "devpkey.h"
#include "setupapi.h"
#include "cfgmgr32.h"
@ -1196,7 +1196,7 @@ static void test_device_iface_detail(void)
SP_DEVICE_INTERFACE_DETAIL_DATA_A *detail;
SP_DEVICE_INTERFACE_DATA iface = {sizeof(iface)};
SP_DEVINFO_DATA device = {sizeof(device)};
DWORD size = 0, expectedsize;
DWORD size = 0, expected_size;
HDEVINFO set;
BOOL ret;
@ -1235,37 +1235,56 @@ static void test_device_iface_detail(void)
ok(!ret, "Expected failure.\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected error %#lx.\n", GetLastError());
detail = heap_alloc(size);
expectedsize = FIELD_OFFSET(SP_DEVICE_INTERFACE_DETAIL_DATA_W, DevicePath[strlen(path) + 1]);
expected_size = FIELD_OFFSET(SP_DEVICE_INTERFACE_DETAIL_DATA_A, DevicePath[strlen(path) + 1]);
ok(size == expected_size, "Expected size %lu, got %lu.\n", expected_size, size);
detail = heap_alloc(size * 2);
detail->cbSize = 0;
SetLastError(0xdeadbeef);
ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, detail, size, &size, NULL);
size = 0xdeadbeef;
ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, detail, expected_size * 2, &size, NULL);
ok(!ret, "Expected failure.\n");
ok(GetLastError() == ERROR_INVALID_USER_BUFFER, "Got unexpected error %#lx.\n", GetLastError());
ok(size == 0xdeadbeef, "Expected size %lu, got %lu.\n", expected_size, size);
detail->cbSize = size;
SetLastError(0xdeadbeef);
ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, detail, size, &size, NULL);
size = 0xdeadbeef;
ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, detail, expected_size * 2, &size, NULL);
ok(!ret, "Expected failure.\n");
ok(GetLastError() == ERROR_INVALID_USER_BUFFER, "Got unexpected error %#lx.\n", GetLastError());
ok(size == 0xdeadbeef, "Expected size %lu, got %lu.\n", expected_size, size);
detail->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA_A);
SetLastError(0xdeadbeef);
ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, detail, size, &size, NULL);
size = 0xdeadbeef;
ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, detail, expected_size, &size, NULL);
ok(ret, "Failed to get interface detail, error %#lx.\n", GetLastError());
ok(!strcasecmp(path, detail->DevicePath), "Got unexpected path %s.\n", detail->DevicePath);
ok(size == expected_size, "Expected size %lu, got %lu.\n", expected_size, size);
SetLastError(0xdeadbeef);
size = 0xdeadbeef;
ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, detail, expected_size * 2, &size, NULL);
ok(ret, "Failed to get interface detail, error %#lx.\n", GetLastError());
ok(!strcasecmp(path, detail->DevicePath), "Got unexpected path %s.\n", detail->DevicePath);
ok(size == expected_size, "Expected size %lu, got %lu.\n", expected_size, size);
expected_size = FIELD_OFFSET(SP_DEVICE_INTERFACE_DETAIL_DATA_W, DevicePath[strlen(path) + 1]);
size = 0xdeadbeef;
ret = SetupDiGetDeviceInterfaceDetailW(set, &iface, NULL, 0, &size, NULL);
ok(!ret, "Expected failure.\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected error %#lx.\n", GetLastError());
ok(size == expectedsize, "Got unexpected size %ld.\n", size);
ok(size == expected_size, "Expected size %lu, got %lu.\n", expected_size, size);
memset(&device, 0, sizeof(device));
device.cbSize = sizeof(device);
size = 0xdeadbeef;
ret = SetupDiGetDeviceInterfaceDetailW(set, &iface, NULL, 0, &size, &device);
ok(!ret, "Expected failure.\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected error %#lx.\n", GetLastError());
ok(size == expected_size, "Expected size %lu, got %lu.\n", expected_size, size);
ok(IsEqualGUID(&device.ClassGuid, &guid), "Got unexpected class %s.\n", wine_dbgstr_guid(&device.ClassGuid));
heap_free(detail);

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: b73e3102009cc7151ab58321800aeded24c1307f
wine: a1ae33a3efb7231adf683484e9de66f84abb04d1