#include "setupapi_private.h"
-WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
-
static const WCHAR source_disks_names[] =
{'S','o','u','r','c','e','D','i','s','k','s','N','a','m','e','s',0};
static const WCHAR source_disks_files[] =
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);
}
/***********************************************************************
* SetupGetInfInformationW (SETUPAPI.@)
- *
+ *
* BUGS
* Only handles the case when InfSpec is an INF handle.
*/
*/
BOOL WINAPI SetupQueryInfFileInformationW(PSP_INF_INFORMATION InfInformation,
UINT InfIndex, PWSTR ReturnBuffer,
- DWORD ReturnBufferSize, PDWORD RequiredSize)
+ DWORD ReturnBufferSize, PDWORD RequiredSize)
{
DWORD len;
LPWSTR ptr;
if (InfIndex != 0)
FIXME("Appended INF files are not handled\n");
- ptr = (LPWSTR)&InfInformation->VersionData[0];
+ ptr = (LPWSTR)InfInformation->VersionData;
len = lstrlenW(ptr);
if (RequiredSize)
else
{
SetLastError( ERROR_INSUFFICIENT_BUFFER );
- HeapFree( GetProcessHeap(), 0, dir );
+ if (dir != systemdir) HeapFree( GetProcessHeap(), 0, dir );
return FALSE;
}
}
return FALSE;
}
- inf_path = (LPWSTR)&InfInformation->VersionData[0];
+ inf_path = (LPWSTR)InfInformation->VersionData;
/* FIXME: we should get OriginalCatalogName from CatalogFile line in
* the original inf file and cache it, but that would require building a