mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 08:54:40 +00:00
Implement SetupDiGetClassDescriptionExA, by calling SetupDiGetClassDescriptionExW
svn path=/trunk/; revision=16426
This commit is contained in:
parent
4a200035de
commit
9b619507af
|
@ -877,8 +877,48 @@ BOOL WINAPI SetupDiGetClassDescriptionExA(
|
|||
PCSTR MachineName,
|
||||
PVOID Reserved)
|
||||
{
|
||||
FIXME("\n");
|
||||
return FALSE;
|
||||
PWCHAR ClassDescriptionW;
|
||||
LPWSTR MachineNameW = NULL;
|
||||
BOOL ret;
|
||||
|
||||
TRACE("\n");
|
||||
if (ClassDescriptionSize > 0)
|
||||
{
|
||||
ClassDescriptionW = HeapAlloc(GetProcessHeap(), 0, ClassDescriptionSize * sizeof(WCHAR));
|
||||
if (!ClassDescriptionW)
|
||||
{
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
ret = FALSE;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (MachineName)
|
||||
{
|
||||
MachineNameW = MultiByteToUnicode(MachineName, CP_ACP);
|
||||
if (!MachineNameW)
|
||||
{
|
||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||
ret = FALSE;
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
ret = SetupDiGetClassDescriptionExW(ClassGuid, ClassDescriptionW, ClassDescriptionSize * sizeof(WCHAR),
|
||||
NULL, MachineNameW, Reserved);
|
||||
if (ret)
|
||||
{
|
||||
int len = WideCharToMultiByte(CP_ACP, 0, ClassDescriptionW, -1, ClassDescription,
|
||||
ClassDescriptionSize, NULL, NULL);
|
||||
|
||||
if (!ClassDescriptionSize && RequiredSize)
|
||||
*RequiredSize = len;
|
||||
}
|
||||
|
||||
end:
|
||||
HeapFree(GetProcessHeap(), 0, ClassDescriptionW);
|
||||
MyFree(MachineNameW);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
|
Loading…
Reference in a new issue