Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com --- dlls/setupapi/devinst.c | 20 ++++++++++++++++++++ dlls/setupapi/stubs.c | 11 ----------- 2 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 41d10d7e40..ab85474c7e 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -3316,6 +3316,26 @@ HKEY WINAPI SetupDiOpenClassRegKeyExW( return key; }
+/*********************************************************************** + * SetupDiOpenDeviceInfoA (SETUPAPI.@) + */ +BOOL WINAPI SetupDiOpenDeviceInfoA(HDEVINFO devinfo, PCSTR instance_id, HWND hwnd_parent, DWORD flags, + PSP_DEVINFO_DATA device_data) +{ + WCHAR instance_idW[MAX_DEVICE_ID_LEN]; + + TRACE("%p %s %p 0x%08x %p\n", devinfo, debugstr_a(instance_id), hwnd_parent, flags, device_data); + + if (!instance_id || strlen(instance_id) >= MAX_DEVICE_ID_LEN) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + MultiByteToWideChar(CP_ACP, 0, instance_id, -1, instance_idW, ARRAY_SIZE(instance_idW)); + return SetupDiOpenDeviceInfoW(devinfo, instance_idW, hwnd_parent, flags, device_data); +} + /*********************************************************************** * SetupDiOpenDeviceInfoW (SETUPAPI.@) */ diff --git a/dlls/setupapi/stubs.c b/dlls/setupapi/stubs.c index b64c1a1316..ede878f1de 100644 --- a/dlls/setupapi/stubs.c +++ b/dlls/setupapi/stubs.c @@ -311,17 +311,6 @@ BOOL WINAPI SetupDiGetClassImageIndex(PSP_CLASSIMAGELIST_DATA ClassImageListData return FALSE; }
-/*********************************************************************** - * SetupDiOpenDeviceInfoA (SETUPAPI.@) - */ -BOOL WINAPI SetupDiOpenDeviceInfoA(HDEVINFO DeviceInfoSet, PCSTR DeviceInstanceId, - HWND hwndParent, DWORD OpenFlags, PSP_DEVINFO_DATA DeviceInfoData) -{ - FIXME("%p %s %p 0x%08x %p: stub\n", DeviceInfoSet, debugstr_a(DeviceInstanceId), - hwndParent, OpenFlags, DeviceInfoData); - return FALSE; -} - /*********************************************************************** * CM_Locate_DevNodeA (SETUPAPI.@) */