VerQueryValue[A|W] revisited

lawson_whitney at juno.com lawson_whitney at juno.com
Thu Feb 15 13:07:56 CST 2001


Good day!

Is this any better?  Thanks to Alexandre, James, and Huw for advice and
encouragement.

ChangeLog:
	* dlls/version/info.c:
	Lawson Whitney <lawson_whitney at juno.com>
	If VerQueryValueA is called with a PE resource, translate the
	call to VerQueryValueW.

Lawson


-------------- next part --------------
diff -urN was/dlls/version/info.c is/dlls/version/info.c
--- was/dlls/version/info.c	Tue Jan 30 13:12:20 2001
+++ is/dlls/version/info.c	Thu Feb 15 13:37:30 2001
@@ -427,8 +427,20 @@
     VS_VERSION_INFO_STRUCT16 *info = (VS_VERSION_INFO_STRUCT16 *)pBlock;
     if ( !VersionInfoIs16( info ) )
     {
+        INT len;
+        LPWSTR wide_str;
+        DWORD give;
         ERR("called on PE resource!\n" );
-        return FALSE;
+
+        /* <lawson_whitney at 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",


More information about the wine-patches mailing list