From 6f3228a539a573cff10d8bf160a24b5e82c01c88 Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Mon, 11 Apr 2005 12:59:45 +0000 Subject: [PATCH] Implement SetupDiClassNameFromGuidExA. --- dlls/setupapi/devinst.c | 21 +++++++++++++++++++-- include/cfgmgr32.h | 4 ++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index ed4241d59e9..86f604fec65 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -34,6 +34,7 @@ #include "setupapi.h" #include "wine/debug.h" #include "wine/unicode.h" +#include "cfgmgr32.h" #include "initguid.h" #include "winioctl.h" #include "rpc.h" @@ -469,8 +470,24 @@ BOOL WINAPI SetupDiClassNameFromGuidExA( PCSTR MachineName, PVOID Reserved) { - FIXME("\n"); - return FALSE; + WCHAR ClassNameW[MAX_CLASS_NAME_LEN]; + LPWSTR MachineNameW = NULL; + BOOL ret; + + if (MachineName) + MachineNameW = MultiByteToUnicode(MachineName, CP_ACP); + ret = SetupDiClassNameFromGuidExW(ClassGuid, ClassNameW, MAX_CLASS_NAME_LEN, + NULL, MachineNameW, Reserved); + if (ret) + { + int len = WideCharToMultiByte(CP_ACP, 0, ClassNameW, -1, ClassName, + ClassNameSize, NULL, NULL); + + if (!ClassNameSize && RequiredSize) + *RequiredSize = len; + } + MyFree(MachineNameW); + return ret; } /*********************************************************************** diff --git a/include/cfgmgr32.h b/include/cfgmgr32.h index fe581bd379d..105b9cc3483 100644 --- a/include/cfgmgr32.h +++ b/include/cfgmgr32.h @@ -23,6 +23,10 @@ typedef DWORD CONFIGRET; #define CR_SUCCESS 0 +#define MAX_CLASS_NAME_LEN 32 +#define MAX_GUID_STRING_LEN 39 +#define MAX_PROFILE_LEN 80 + CONFIGRET WINAPI CM_Get_Device_ID_ListA( PCSTR, PCHAR, ULONG, ULONG ); CONFIGRET WINAPI CM_Get_Device_ID_ListW( PCWSTR, PWCHAR, ULONG, ULONG ); #define CM_Get_Device_ID_List WINELIB_NAME_AW(CM_Get_Device_ID_List)