From 3437915594591d0b0b16d30f872b7862cf85e6ff Mon Sep 17 00:00:00 2001 From: Lawson Whitney Date: Thu, 15 Feb 2001 21:26:29 +0000 Subject: [PATCH] If VerQueryValueA is called with a PE resource, translate the call to VerQueryValueW. --- dlls/version/info.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dlls/version/info.c b/dlls/version/info.c index 7be2d13dfd4..e77ca718dae 100644 --- a/dlls/version/info.c +++ b/dlls/version/info.c @@ -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; + + /* 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",