diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 0b07eceb386..7c87b253831 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -696,6 +696,46 @@ SetupDiCreateDeviceInfoListExW(const GUID *ClassGuid, return (HDEVINFO)list; } +/*********************************************************************** + * SetupDiCreateDeviceInfoA (SETUPAPI.@) + */ +BOOL WINAPI SetupDiCreateDeviceInfoA( + HDEVINFO DeviceInfoSet, + PCSTR DeviceName, + CONST GUID *ClassGuid, + PCSTR DeviceDescription, + HWND hwndParent, + DWORD CreationFlags, + PSP_DEVINFO_DATA DeviceInfoData) +{ + BOOL ret = FALSE; + LPWSTR DeviceNameW = NULL; + LPWSTR DeviceDescriptionW = NULL; + + if (DeviceName) + { + DeviceNameW = MultiByteToUnicode(DeviceName, CP_ACP); + if (DeviceNameW == NULL) return FALSE; + } + if (DeviceDescription) + { + DeviceDescriptionW = MultiByteToUnicode(DeviceDescription, CP_ACP); + if (DeviceDescriptionW == NULL) + { + MyFree(DeviceNameW); + return FALSE; + } + } + + ret = SetupDiCreateDeviceInfoW(DeviceInfoSet, DeviceNameW, ClassGuid, DeviceDescriptionW, + hwndParent, CreationFlags, DeviceInfoData); + + MyFree(DeviceNameW); + MyFree(DeviceDescriptionW); + + return ret; +} + /*********************************************************************** * SetupDiCreateDeviceInfoW (SETUPAPI.@) */ diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec index 7f8b2851d44..36240b891d4 100644 --- a/dlls/setupapi/setupapi.spec +++ b/dlls/setupapi/setupapi.spec @@ -282,7 +282,7 @@ @ stdcall SetupDiClassNameFromGuidW(ptr wstr long ptr) @ stub SetupDiCreateDevRegKeyA @ stub SetupDiCreateDevRegKeyW -@ stub SetupDiCreateDeviceInfoA +@ stdcall SetupDiCreateDeviceInfoA(long str ptr str long long ptr) @ stdcall SetupDiCreateDeviceInfoList(ptr ptr) @ stdcall SetupDiCreateDeviceInfoListExA(ptr long str ptr) @ stdcall SetupDiCreateDeviceInfoListExW(ptr long str ptr) diff --git a/include/setupapi.h b/include/setupapi.h index 16391e3d5a1..625f15d7f65 100644 --- a/include/setupapi.h +++ b/include/setupapi.h @@ -744,6 +744,9 @@ HDEVINFO WINAPI SetupDiCreateDeviceInfoList(const GUID *, HWND); HDEVINFO WINAPI SetupDiCreateDeviceInfoListExA(const GUID *, HWND, PCSTR, PVOID); HDEVINFO WINAPI SetupDiCreateDeviceInfoListExW(const GUID *, HWND, PCWSTR, PVOID); #define SetupDiCreateDeviceInfoListEx WINELIB_NAME_AW(SetupDiCreateDeviceInfoListEx) +BOOL WINAPI SetupDiCreateDeviceInfoA(HDEVINFO, PCSTR, CONST GUID*, PCSTR, HWND, DWORD,PSP_DEVINFO_DATA); +BOOL WINAPI SetupDiCreateDeviceInfoW(HDEVINFO, PCWSTR, CONST GUID*, PCWSTR, HWND, DWORD,PSP_DEVINFO_DATA); +#define SetupDiCreateDeviceInfo WINELIB_NAME_AW(SetupDiCreateDeviceInfo) BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO); BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO, DWORD, PSP_DEVINFO_DATA); BOOL WINAPI SetupDiEnumDeviceInterfaces(HDEVINFO, PSP_DEVINFO_DATA, const GUID *, DWORD, PSP_DEVICE_INTERFACE_DATA);