http://bugs.winehq.org/show_bug.cgi?id=6393
------- Additional Comments From focht@gmx.net 2007-11-05 13:12 ------- Created an attachment (id=6230) --> (http://bugs.winehq.org/attachment.cgi?id=6230&action=view) Fix VerQueryValueA/W to match windows behaviour with subblock null string
Hello,
another random pick ... Crash is due to VerQueryValueA() not handling subblock with null string correctly (the way windows does).
--- snip --- trace:ver:GetFileVersionInfoW (L"C:\Program Files\OCAD 9.3 Demo\ocad.exe",0,size=1572,data=0x1052400) trace:ver:VERSION_GetFileVersionInfo_PE L"C:\Program Files\OCAD 9.3 Demo\ocad.exe" trace:ver:print_vffi_debug structversion=1.0, fileversion=9.3.8.323, productversion=9.3.8.323 trace:ver:print_vffi_debug flagmask=0x3f, flags=0x0 trace:ver:print_vffi_debug (OS=0x0.0x4 UNKNOWN(0x0),WIN32) trace:ver:print_vffi_debug filetype=APP trace:ver:print_vffi_debug filedate=0x0.0x0 trace:ver:VerQueryValueA (0x1052400,"",0x34fd90,0x34fd8c) trace:ver:VersionInfo32_QueryValue lpSubBlock : (L"") wine: Unhandled page fault on read access to 0x00f80ad0 at address 0x0000:0x00404722 (thread 0014), starting debugger... First chance exception: page fault on read access to 0x00f80ad0 in 32-bit code (0x00404722). --- snip ---
Although MSDN (http://msdn2.microsoft.com/en-us/library/ms647464.aspx) doesnt mention this case (subblock = null string), windows actually tolerates it. Windows xp returns valid VS_FIXEDFILEINFO info data (same like root subblock "\" case).
Attached is a patch which fixes dlls/version/info.c VerQueryValueA and VerQueryValueW to match windows behaviour. To make as little code changes as possible, the root path is assigned on null string case. This allows clean processing as if the client has passed in "\" subblock. The version info is now correctly read and evaluated.
The app crashes later in main window due to other issues (might be user32/gdi32 related, needs further inspection -> file new bug reports).
Regards