setupapi: Fix string conversion in SetupGetInfInformationA().

This commit is contained in:
Pierre Schweitzer 2015-02-08 19:57:18 +01:00 committed by Alexandre Julliard
parent 90aab41ce2
commit fe41140664
1 changed files with 6 additions and 1 deletions

View File

@ -125,8 +125,13 @@ BOOL WINAPI SetupGetInfInformationA(LPCVOID InfSpec, DWORD SearchControl,
if (InfSpec && SearchControl >= INFINFO_INF_NAME_IS_ABSOLUTE)
{
len = lstrlenA(InfSpec) + 1;
len = MultiByteToWideChar(CP_ACP, 0, InfSpec, -1, NULL, 0);
inf = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
if (!inf)
{
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
return FALSE;
}
MultiByteToWideChar(CP_ACP, 0, InfSpec, -1, inf, len);
}