http://bugs.winehq.org/show_bug.cgi?id=23768
Summary: winhelp: Some images not shown in certain 16-bit Help files Product: Wine Version: 1.2 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: trivial Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: markk@clara.co.uk
Created an attachment (id=29793) --> (http://bugs.winehq.org/attachment.cgi?id=29793) 4aces.hlp.bz2
With some 16-bit Help files, some images are not shown. See the attached files.
Load 4aces.hlp into Wine winhlp32. This console output appears: err:winhelp:HLPFILE_DoReadHlpFile buf[0x14] = 0
Click the author's name popup link at the bottom. The popup is tiny, maybe 6x15 pixels, and empty. It's supposed to be a picture of the author. The other popup links appear as they should (albeit not the correct size, see bug 23008).
Load 6pack.hlp into Wine winhlp32. With this file (created by the same author) there is no initial console output, and clicking the author's name popup link does correctly show the picture. Maybe this file was authored using a later version of the help compiler?
http://bugs.winehq.org/show_bug.cgi?id=23768
--- Comment #1 from markk@clara.co.uk 2010-07-23 15:05:09 --- Created an attachment (id=29794) --> (http://bugs.winehq.org/attachment.cgi?id=29794) 6pack.hlp.bz2
http://bugs.winehq.org/show_bug.cgi?id=23768
Kirill K. Smirnov lich@math.spbu.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lich@math.spbu.ru
--- Comment #2 from Kirill K. Smirnov lich@math.spbu.ru 2010-08-21 15:48:12 --- winhlp32 being run with WINEDEBUG=winhelp provides some hints:
$ WINEDEBUG=winhelp wine winhlp32 4aces.hlp trace:winhelp:comp_FindSubFile Comparing 'bm0' with '|bm0' trace:winhelp:comp_FindSubFile Comparing '|CTXOMAP' with '|bm0' ...
This file is broken. The image has got internal name '|bm0', but the internal file table refers to this as 'bm0'.
Really, hexdump shows us: $ xxd 4aces.hlp | grep -2 bm0 00022c0: 2902 0400 047a 3400 6361 7469 6f6e 206e )....z4.cation n 00022d0: 756d 6265 7200 0000 0000 00ff ff01 0001 umber........... 00022e0: 000b 0000 0078 030b 00ff ffff ff62 6d30 .....x.......bm0 00022f0: 0010 0000 007c 4354 584f 4d41 5000 7961 .....|CTXOMAP.ya 0002300: 0000 7c46 4f4e 5400 3361 0000 7c4b 5742 ..|FONT.3a..|KWB
'bm0' is corrupted while other entries are correct.
http://bugs.winehq.org/show_bug.cgi?id=23768
Jice wine@cardot.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |wine@cardot.net
--- Comment #3 from Jice wine@cardot.net 2011-03-12 21:02:05 CST --- Tried to display both of the hlp files with winhlp32 from last wine (wine-1.3.15). No image at all display, in any of the 2 files. Is it only me? Did it work before?
http://bugs.winehq.org/show_bug.cgi?id=23768
--- Comment #4 from Kirill K. Smirnov lich@math.spbu.ru 2011-03-13 04:58:11 CDT --- 4aces.hlp is broken.
wine-1.3.14 displays all images in 6pack.hlp correctly: Philip B Cook's photo and a magnifying glass at the bottom.
riched20.dll library is set to be builtin (wine). When I override this to be native (windows), I get no images.
http://bugs.winehq.org/show_bug.cgi?id=23768
--- Comment #5 from Jice wine@cardot.net 2011-03-15 11:49:10 CDT --- sorry for the noise: newbie error (works with a fresh new bottle)
http://bugs.winehq.org/show_bug.cgi?id=23768
Mark K markk@clara.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |markk@clara.co.uk
--- Comment #6 from Mark K markk@clara.co.uk 2011-12-09 09:41:54 CST --- The popup image in 4aces.hlp does display correctly in winhlp32.exe from Windows XP (both in Wine and Windows).
http://bugs.winehq.org/show_bug.cgi?id=23768
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #7 from Austin English austinenglish@gmail.com 2013-12-05 17:11:29 CST --- (In reply to comment #6)
The popup image in 4aces.hlp does display correctly in winhlp32.exe from Windows XP (both in Wine and Windows).
It doesn't for me in wine-1.7.7-199-g608b1e1. the 6pack.hlp picture works though.
only one line of output: austin@aw25 ~ $ wine winhlp32 4aces.hlp err:winhelp:HLPFILE_DoReadHlpFile buf[0x14] = 0
http://bugs.winehq.org/show_bug.cgi?id=23768
--- Comment #8 from Mark K markk@clara.co.uk 2013-12-06 05:51:14 CST --- To clarify comment 6, the image in 4aces.hlp displays correctly in the *Windows* version of WinHlp32.exe, not Wine winhlp32.exe.
It displays correctly when you use WinHlp32.exe taken from a Windows XP installation and run that in Wine. I just checked in a Windows 7 VM with the Windows 7 WinHlp32 download from http://www.microsoft.com/en-US/download/details.aspx?id=91 and it displays correctly there too.
I'm not sure that 4aces.hlp could be considered broken since it works with Windows WinHlp32. Maybe some undocumented feature?
https://bugs.winehq.org/show_bug.cgi?id=23768
--- Comment #9 from Jice wine@cardot.net --- Here is a patch to wine winhlp32 so that it behaves like MS one:
@@ -507,6 +514,16 @@ static BOOL HLPFILE_FindSubFile(HLPFILE* hlpfile, LPCSTR name, BYTE **subbuf, BY WINE_TRACE("looking for file '%s'\n", name); ptr = HLPFILE_BPTreeSearch(hlpfile->file_buffer + GET_UINT(hlpfile->file_buffer, 4), name, comp_FindSubFile); + if (!ptr) + { // BUG 23768 + CHAR c = *name++; + if (c == 124) + { + WINE_TRACE("not found. try '%s'\n", name); + ptr = HLPFILE_BPTreeSearch(hlpfile->file_buffer + GET_UINT(hlpfile->file_buffer, 4), + name, comp_FindSubFile); + } + } if (!ptr) return FALSE; *subbuf = hlpfile->file_buffer + GET_UINT(ptr, strlen(name)+1); if (*subbuf >= hlpfile->file_buffer + hlpfile->file_buffer_size)
please comment on the patch.
https://bugs.winehq.org/show_bug.cgi?id=23768
--- Comment #10 from Kirill K. Smirnov lich@math.spbu.ru --- The patch looks OK, just a couple of comments:
- { // BUG 23768
This comment is rather uninformative. I believe the following is much more descriptive:
"Sometimes files with bitmap images are prefixes with '|' and sometimes not. Unfortunately, there is no consensus among different pieces of unofficial documentation. So remove leading '|' and try again."
+ if (c == 124) "if (c == '|')" looks better to me.
https://bugs.winehq.org/show_bug.cgi?id=23768
--- Comment #11 from Kirill K. Smirnov lich@math.spbu.ru --- (In reply to Kirill K. Smirnov from comment #2)
This file is broken. The image has got internal name '|bm0', but the internal file table refers to this as 'bm0'.
This is wrong - file is not broken. Prefix '|' may be missing. Sorry for blaming an innocent :-(
https://bugs.winehq.org/show_bug.cgi?id=23768
--- Comment #12 from Jice wine@cardot.net --- thanks Kiril for the comments :) so here is the new version:
@@ -507,6 +514,18 @@ static BOOL HLPFILE_FindSubFile(HLPFILE* hlpfile, LPCSTR name, BYTE **subbuf, BY WINE_TRACE("looking for file '%s'\n", name); ptr = HLPFILE_BPTreeSearch(hlpfile->file_buffer + GET_UINT(hlpfile->file_buffer, 4), name, comp_FindSubFile); + if (!ptr) + { // Sometimes files with bitmap images are prefixes with '|' and sometimes not. + // Unfortunately, there is no consensus among different pieces of unofficial documentation. + // So remove leading '|' and try again. + CHAR c = *name++; + if (c == '|') + { + WINE_TRACE("not found. try '%s'\n", name); + ptr = HLPFILE_BPTreeSearch(hlpfile->file_buffer + GET_UINT(hlpfile->file_buffer, 4), + name, comp_FindSubFile); + } + } if (!ptr) return FALSE; *subbuf = hlpfile->file_buffer + GET_UINT(ptr, strlen(name)+1); if (*subbuf >= hlpfile->file_buffer + hlpfile->file_buffer_size)
PS: are C++ style comments allowed in the wine source code? Browsing the source code I cannot see a clear consensus either ;)
https://bugs.winehq.org/show_bug.cgi?id=23768
--- Comment #13 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Jice from comment #12)
PS: are C++ style comments allowed in the wine source code? Browsing the source code I cannot see a clear consensus either ;)
No, only /**/.
https://bugs.winehq.org/show_bug.cgi?id=23768
super_man@post.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |super_man@post.com
--- Comment #14 from super_man@post.com --- Consider sending into wine-patches to get merged.
https://bugs.winehq.org/show_bug.cgi?id=23768
--- Comment #15 from Jice wine@cardot.net --- done. let's see if it get commited or commented.
https://bugs.winehq.org/show_bug.cgi?id=23768
--- Comment #16 from Jice wine@cardot.net --- The patch has just been committed :)
https://bugs.winehq.org/show_bug.cgi?id=23768
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED Fixed by SHA1| |91f89b4f96674024b3436423ddb | |188e838d1ca54
--- Comment #17 from Bruno Jesus 00cpxxx@gmail.com --- (In reply to Jice from comment #16)
The patch has just been committed :)
Thanks. Confirming fixed by the file in comment 0.
http://source.winehq.org/git/wine.git/commitdiff/91f89b4f96674024b3436423ddb...
https://bugs.winehq.org/show_bug.cgi?id=23768
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #18 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.9.9.
https://bugs.winehq.org/show_bug.cgi?id=23768
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |1.8.x CC| |mstefani@redhat.com
https://bugs.winehq.org/show_bug.cgi?id=23768
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|1.8.x |---
--- Comment #19 from Michael Stefaniuc mstefani@redhat.com --- Removing 1.8.x milestone from bugs included in 1.8.3.