If VerQueryValueA is called with a PE resource, translate the call to

VerQueryValueW.
This commit is contained in:
Lawson Whitney 2001-02-15 21:26:29 +00:00 committed by Alexandre Julliard
parent 40a38f7f9a
commit 3437915594
1 changed files with 13 additions and 2 deletions

View File

@ -427,8 +427,19 @@ DWORD WINAPI VerQueryValueA( LPVOID pBlock, LPCSTR lpSubBlock,
VS_VERSION_INFO_STRUCT16 *info = (VS_VERSION_INFO_STRUCT16 *)pBlock;
if ( !VersionInfoIs16( info ) )
{
ERR("called on PE resource!\n" );
return FALSE;
INT len;
LPWSTR wide_str;
DWORD give;
/* <lawson_whitney@juno.com> Feb 2001 */
/* AOL 5.0 does this, expecting to get this: */
len = MultiByteToWideChar(CP_ACP, 0, lpSubBlock, -1, NULL, 0);
wide_str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, lpSubBlock, -1, wide_str, len);
give = VerQueryValueW(pBlock, wide_str, lplpBuffer, puLen);
HeapFree(GetProcessHeap(), 0, wide_str);
return give;
}
TRACE("(%p,%s,%p,%p)\n",