Module: wine Branch: refs/heads/master Commit: 51cd07c37e56da960ab2c51b0391befeea0b6688 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=51cd07c37e56da960ab2c51b...
Author: Christian Gmeiner christian.gmeiner@students.fhv.at Date: Thu Jul 20 16:08:43 2006 +0200
setupapi: Implemented SetupDiCreateDeviceInfoA.
---
dlls/setupapi/devinst.c | 40 ++++++++++++++++++++++++++++++++++++++++ dlls/setupapi/setupapi.spec | 2 +- include/setupapi.h | 3 +++ 3 files changed, 44 insertions(+), 1 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 0b07ece..7c87b25 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -697,6 +697,46 @@ SetupDiCreateDeviceInfoListExW(const GUI }
/*********************************************************************** + * 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.@) */ BOOL WINAPI SetupDiCreateDeviceInfoW( diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec index 7f8b285..36240b8 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 16391e3..625f15d 100644 --- a/include/setupapi.h +++ b/include/setupapi.h @@ -744,6 +744,9 @@ HDEVINFO WINAPI SetupDiCreateDeviceInfoL 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);