Commit 05a1416c authored by Stefan Leichter's avatar Stefan Leichter Committed by Alexandre Julliard

setupapi: Implement SetupDiGetINFClassA on top of SetupDiGetINFClassW.

parent 803b81c1
...@@ -3988,6 +3988,37 @@ CONFIGRET WINAPI CM_Get_Device_ID_Size( PULONG pulLen, DEVINST dnDevInst, ...@@ -3988,6 +3988,37 @@ CONFIGRET WINAPI CM_Get_Device_ID_Size( PULONG pulLen, DEVINST dnDevInst,
} }
/*********************************************************************** /***********************************************************************
* SetupDiGetINFClassA (SETUPAPI.@)
*/
BOOL WINAPI SetupDiGetINFClassA(PCSTR inf, LPGUID class_guid, PSTR class_name,
DWORD size, PDWORD required_size)
{
BOOL retval;
DWORD required_sizeA, required_sizeW;
PWSTR class_nameW = NULL;
UNICODE_STRING infW;
if (inf) RtlCreateUnicodeStringFromAsciiz(&infW, inf);
else infW.Buffer = NULL;
if (class_name && size)
class_nameW = HeapAlloc(GetProcessHeap(), 0, size * sizeof(WCHAR));
retval = SetupDiGetINFClassW(infW.Buffer, class_guid, class_nameW, size, &required_sizeW);
if (retval)
{
required_sizeA = WideCharToMultiByte( CP_ACP, 0, class_nameW, required_sizeW,
class_name, size, NULL, NULL);
if(required_size) *required_size = required_sizeA;
}
else
if(required_size) *required_size = required_sizeW;
return retval;
}
/***********************************************************************
* SetupDiGetINFClassW (SETUPAPI.@) * SetupDiGetINFClassW (SETUPAPI.@)
*/ */
BOOL WINAPI SetupDiGetINFClassW(PCWSTR inf, LPGUID class_guid, PWSTR class_name, BOOL WINAPI SetupDiGetINFClassW(PCWSTR inf, LPGUID class_guid, PWSTR class_name,
......
...@@ -230,17 +230,6 @@ BOOL WINAPI SetupSetSourceListW(DWORD flags, PCWSTR *list, UINT count) ...@@ -230,17 +230,6 @@ BOOL WINAPI SetupSetSourceListW(DWORD flags, PCWSTR *list, UINT count)
} }
/*********************************************************************** /***********************************************************************
* SetupDiGetINFClassA (SETUPAPI.@)
*/
BOOL WINAPI SetupDiGetINFClassA(PCSTR inf, LPGUID class_guid, PSTR class_name,
DWORD size, PDWORD required_size)
{
FIXME("%s %p %p %d %p\n", debugstr_a(inf), class_guid, class_name, size, required_size);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
}
/***********************************************************************
* SetupDiDestroyClassImageList (SETUPAPI.@) * SetupDiDestroyClassImageList (SETUPAPI.@)
*/ */
BOOL WINAPI SetupDiDestroyClassImageList(PSP_CLASSIMAGELIST_DATA ClassListImageData) BOOL WINAPI SetupDiDestroyClassImageList(PSP_CLASSIMAGELIST_DATA ClassListImageData)
......
...@@ -1509,6 +1509,7 @@ static void testSetupDiGetINFClassA(void) ...@@ -1509,6 +1509,7 @@ static void testSetupDiGetINFClassA(void)
count = 0xdeadbeef; count = 0xdeadbeef;
retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count);
ok(retval, "expected SetupDiGetINFClassA to succeed! error %u\n", GetLastError()); ok(retval, "expected SetupDiGetINFClassA to succeed! error %u\n", GetLastError());
todo_wine
ok(count == 4, "expected count==4, got %u(%s)\n", count, cn); ok(count == 4, "expected count==4, got %u(%s)\n", count, cn);
DeleteFileA(filename); DeleteFileA(filename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment