Native WinXP help (winhlp32.exe) doesn't work

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Post Reply
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

Clicking on any Windows program's "help" button or menu, on all (older) Windows programs I have, just triggers a "Failed to launch Help" error message. It looks like Windows help is somehow broken. :(

Is there anything I can do about it?

(Running Ubuntu 22.04 Jammy. Wine is configured to mimic WinXP, since my Windows programs are from that time.)

I checked ~/.wine/drive_c/windows, and I do see the two expected "winhlp32.exe" files (although they have wildly different sizes than those in the WinXP VM I have access to).

Thanks in advance!
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by jkfloris »

The built-in programs winhlp32.exe and hh.exe allow you to open help files (.hlp or .chm).
What format are the Help files you are trying to open?
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

Thanks for replying!

Since my initial post I managed to better understand the problem: Windows Help actually works, until I use the "Heroes of Might and Magic III" map editor (not the game, the editor).

This map editor ("h3maped.exe") is a standard Windows program from 1999, and uses Windows Help to display useful information: When you right click an object in the editor, a small window pops up with extra info on it, and this uses the old WinXP help system (I know this because Microsoft changed the Help system around Windows 8, and thus broke that map editor).

In Wine, when I call "Help" in this editor, I get the little "Failed to launch Help" error message, and after that, all help, on all (old) Windows programs, is broken until I restart Wine. Something about how that editor (mis)uses the Help system to display popup information seems to crash Wine's "winhlp32.exe".

Not being a developer, I'd be hard-pressed to say what format the HoMM3 map editor's help files are, or what exactly they do to crash the Help system. All I know is that the editor's help seems to be a file called "H3MAPED.HLP" (331.4 kB)...


Now as I said, I have access to a WinXP VM, and could potentially copy the original XP "winhlp32.exe" files and replace Wine's, in a hope they are more resilient, or have the feature the editor tries to use. Do you think it might help, or will it just create a worse mess? :shock:
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by jkfloris »

Can the built-in version of winhlp32 open the help file?

Code: Select all

wine winhelp.exe H3MAPED.HLP
# or
wine winhlp32.exe H3MAPED.HLP
# or
wine start H3MAPED.HLP
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

Yes, that works just fine, all three command lines start the standard program help, as expected.

And yet, if I start the editor program, and than inside this editor click on "Help Summary" (to get the exact same help), I get the "Failed to launch Help" error message, and any Windows Help is dead, for all programs, until I restart Wine. :?

Something the program does at start wreaks havoc on Wine's winhlp32.exe.


(Sorry for those long delays answering, as a newbie/potential spammer my posts need to be approved by a moderator, which takes some time...)
Last edited by kr751 on Fri Dec 22, 2023 3:25 am, edited 1 time in total.
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by jkfloris »

if I start the editor program, and than inside this editor click on "Help Summary" (to get the exact same help), I get the "Failed to launch Help" error message, and any Windows Help is dead, for all programs, until I restart Wine.
That's very strange

A few questions:
- Does the terminal output indicate what is going wrong?

Code: Select all

WINEDEBUG=fixme+all wine h3maped.exe
- What version of Wine are you using?

Code: Select all

wine --version
- Do you have any other programs or Winetricks installed besides Heroes3?
(Can you reproduce the problem in a clean wine prefix?)

Code: Select all

# create a new prefix:
WINEPREFIX=~/heroes3 wineboot

# copy and paste the "Heroes3" directory to ~/heroes/drive_c/

# start the editor:
cd ~/heroes3/drive_c/Heroes3
WINEPREFIX=~/heroes3 wine h3maped.exe
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

jkfloris wrote: Sat Dec 23, 2023 11:11 am "WINEDEBUG=fixme+all wine h3maped.exe"
Replied:

Code: Select all

0400:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0400:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0400:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0400:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0400:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0400:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
jkfloris wrote: Sat Dec 23, 2023 11:11 am "wine --version"
wine-6.0.3 (Ubuntu 6.0.3~repack-1)

jkfloris wrote: Sat Dec 23, 2023 11:11 am - Do you have any other programs or Winetricks installed besides Heroes3?
No Winetricks. It's the vanilla default distro Wine installation. Yes, there are three other games installed in there, of about the same age, but I guess as long as don't launch them they're inert.

Creating a new prefix said this:

Code: Select all

wine: created the configuration directory '/home/kr751/heroes3'
0048:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0048:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0048:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0050:err:ole:StdMarshalImpl_MarshalInterface Failed to create ifstub, hr 0x80004002
0050:err:ole:CoMarshalInterface Failed to marshal the interface {6d5140c1-7436-11ce-8034-00aa006009fa}, hr 0x80004002
0050:err:ole:apartment_get_local_server_stream Failed: 0x80004002
0050:err:ole:start_rpcss Failed to open RpcSs service
0040:err:setupapi:SetupDefaultQueueCallbackW copy error 1812 L"@wineusb.sys,-1" -> L"C:\\windows\\inf\\wineusb.inf"
Could not find Wine Gecko. HTML rendering will be disabled.
Could not find Wine Gecko. HTML rendering will be disabled.
wine: configuration in L"/home/kr751/heroes3" has been updated.
Didn't understand much, as for the last part, the game doesn't use HTML (1999...).

Now running a copy of the editor in the new prefix (with "WINEDEBUG=fixme+all wine h3maped.exe") gave:

Code: Select all

0110:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0110:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0110:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0110:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0110:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0110:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
Does this tell you anything useful? :)


------- Edit:
Hey Mr. Moderator, how many posts do I have to make to be considered "safe"? This is my fourth (despite what the counter says, just count them, they're all in this thread...). :roll:
Last edited by kr751 on Sat Dec 23, 2023 12:05 pm, edited 1 time in total.
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by jkfloris »

Unfortunately, there is nothing special in the output.
The HTML warning is that no Wine Gecko package was found and therefore nothing will be installed. So you can ignore it in your case.
wine-6.0.3 (Ubuntu 6.0.3~repack-1)
Can you try to use a newer version of Wine?
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

jkfloris wrote: Sun Dec 24, 2023 9:09 am Can you try to use a newer version of Wine?
I'll try, even if I'm a fan of "if it isn't broken, don't fix it"... :mrgreen:
I'm just afraid it won't help much, the issue is about a 1999 Win2k-WinXP program, it would be expected to already work on an older Wine.
Anyway.

I installed the sources, now which Wine branch do I want?
I read the FAQ and it terminally confused me... :lol:
As far as I understood "devel" is the latest, "staging" is experimental, and "stable" is stagnating and old. :?:
I want something as hassle-free as possible. I only use a couple old programs (games) from my Windows times, which ended with WinXP...
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by jkfloris »

Wine-devel releases a new version every two weeks, which may contain regressions. But you have the latest version.
Wine-stable only has 2 or 3 releases a year, and they only contain updates that don't break anything, so in your case I'll go with wine-stable. You get version 8.0.2 now, and in January it will be updated to version 9.0.
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

Thanks! Will try it later today.
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

:(
I tried "sudo apt install --install-recommends winehq-stable" and got:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
winehq-stable : Depends: wine-stable (= 8.0.2~jammy-1)
E: Unable to correct problems, you have held broken packages.
I fail to understand the "unmet dependencies" part: I am trying to install 8.0.2, so it's quite normal 8.0.2 isn't installed... :shock:
I followed (quite blindly) the instructions on the Ubuntu WineHQ Repo page. What did I miss?
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by jkfloris »

Wine consists of 4 packages:
- winehq-stable
This package ensures, among other things, that the wine command exists
- wine-stable
This package takes care of the wineserver and all non-architecture-specific programs.
- wine-stable-amd6
All 64-bit components of Wine.
- wine-stable-i386
All 32-bit components of Wine.

If there are problems with the installation, the problem is often with the last package.
Try to install wine-stable-i386 first.

Code: Select all

sudo apt install --install-recommends wine-stable-i386:i386
If that fails, post the output and the output of:

Code: Select all

apt policy
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

jkfloris wrote: Wed Dec 27, 2023 6:25 am Wine consists of 4 packages:
:shock:

jkfloris wrote: Wed Dec 27, 2023 6:25 am Try to install wine-stable-i386 first.
That did it! After that I was able to install "winehq-stable"! :D
Version now states "wine-8.0.2"!
Thanks!

The unexpected consequence was that all my Windows program menu items are now dead. :(
None of my Windows program menu items work anymore, but I'm able to launch them from the terminal, so it's clearly a problem with the old menu command lines. Example of one of those:

Code: Select all

env WINEPREFIX="/home/kr751/.wine" wine-stable C:\\windows\\command\\start.exe /Unix /home/kr751/.wine/dosdevices/c:/ProgramData/Microsoft/Windows/Start\ Menu/Programs/GOG.com/Heroes\ of\ Might\ and\ Magic\ 3\ Complete/Heroes\ of\ Might\ and\ Magic\ 3\ Complete.lnk
So, what has changed in that? I would assume it's still "wine-stable" and the rest hasn't changed either, or did it? :?:

I need a strong drink. Oh my, working with Wine will make me an alcoholic... :lol:
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by jkfloris »

Replace wine-stable with wine or /opt/wine-stable/bin/wine

Code: Select all

env WINEPREFIX="/home/kr751/.wine" wine C:\\windows\\command\\start.exe /Unix /home/kr751/.wine/dosdevices/c:/ProgramData/Microsoft/Windows/Start\ Menu/Programs/GOG.com/Heroes\ of\ Might\ and\ Magic\ 3\ Complete/Heroes\ of\ Might\ and\ Magic\ 3\ Complete.lnk

# or

env WINEPREFIX="/home/kr751/.wine" /opt/wine-stable/bin/wine C:\\windows\\command\\start.exe /Unix /home/kr751/.wine/dosdevices/c:/ProgramData/Microsoft/Windows/Start\ Menu/Programs/GOG.com/Heroes\ of\ Might\ and\ Magic\ 3\ Complete/Heroes\ of\ Might\ and\ Magic\ 3\ Complete.lnk

# And probably this works as well:
wine start c:\\ProgramData\\Microsoft\\Windows\\Start\ Menu\\Programs\\GOG.com\\Heroes\ of\ Might\ and\ Magic\ 3\ Complete\\Heroes\ of\ Might\ and\ Magic\ 3\ Complete.lnk
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

Ok, thanks.
Yes, using "wine" alone does work, I did have two shortcuts (I made myself) like that, and those still work. I was just surprised that the new wine doesn't recognize the old command.
Oh well, I'll change them all.

Now, the HoMM3 map editor help doesn't work any better in Wine 8.0.2: I still get the exact same little "Failed to launch Help" error message... :(

I tried launching it with "WINEDEBUG=fixme+all", and after a short reflection it offered to install Mono, which I (reluctantly) agreed to. Unsurprisingly this didn't help, I still get the "Failed to launch Help" error.
Here is what Wine 8.0.2 specifically says:

Code: Select all

 WINEDEBUG=fixme+all wine h3maped.exe
0244:fixme:imm:ImeSetActiveContext (000103DA, 1): stub
0244:fixme:imm:ImmReleaseContext (000103D8, 000103DA): stub
0244:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0244:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0244:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0244:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0244:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0244:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
Pretty much the same its grandma already said about the same issue... :(
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by jkfloris »

It remains strange.
Although "right click -> What's This" doesn't seem to do anything for me, I don't get the "Failed to launch Help" message.
Does the winhelp debug channel give more information?

Code: Select all

WINEDEBUG=+winhelp wine h3maped.exe
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

jkfloris wrote: Thu Dec 28, 2023 8:42 am Although "right click -> What's This" doesn't seem to do anything for me, I don't get the "Failed to launch Help" message.
In the HoMM3 editor? That's strange.
Try switching to one of the Object lists (Tools/Objects/Dirt Objects, for instance), then right-click on one of the objects in the vertical list on the right side.
Normally you'd get a little yellow pop-up window with a detailed explanation, now I get the little error message, and then Windows help is wonky until I restart Wine (meaning requesting any Windows help in any Windows program triggers the error message).

jkfloris wrote: Thu Dec 28, 2023 8:42 am

Code: Select all

WINEDEBUG=+winhelp wine h3maped.exe
It gave the exact same answer as the "WINEDEBUG=fixme+all" above, except the random start numbers were 027c instead of 0244... :mrgreen:
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by jkfloris »

Even with the object list, I don't get the error message. I only get the message when I disable or remove winhlp32.exe.
Is the Map Editor looking for winhlp32.exe in the right places?

Start the editor with the process debug channel:

Code: Select all

WINEDEBUG=+process wine h3maped.exe
A lot of text will scroll by, but this will stop when the program starts.
Right-click an object to trigger the error.

I get the following locations where the editor is looking for winhlp32:

Code: Select all

...
00e4:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
00e4:trace:process:CreateProcessInternalW app (null) cmdline L"winhlp32.exe -x"

00e4:trace:process:find_exe_file looking for L"winhlp32.exe" in L"C:\\GOG Games\\HoMM 3 Complete;.;C:\\windows\\system32;C:\\windows\\system;C:\\windows;C:\\windows\\system32;C:\\windows;C:\\windows\\system32\\wbem;C:\\windows\\system32\\WindowsPowershell\\v1.0"

00e4:trace:process:NtCreateUserProcess L"\\??\\C:\\windows\\system32\\winhlp32.exe" image L"C:\\windows\\system32\\winhlp32.exe" cmdline L"winhlp32.exe -x" parent (nil)
00e4:trace:process:NtCreateUserProcess L"\\??\\C:\\windows\\system32\\winhlp32.exe" pid 0128 tid 012c handles 0xbc/0xc0
...
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

That was useful! I found what caused the error message, at some point in the past I had copied a WinXP winhlp32.exe inside the HoMM3 folder, and the editor tried to use that one... :oops:
After removing it I get no error (but no information popup either), just like you.

Here what she said:

Code: Select all

...
0114:fixme:toolbar:TOOLBAR_SetRows Separators unhandled
0114:trace:process:CreateProcessInternalW app (null) cmdline L"winhlp32.exe -x"
0114:trace:process:find_exe_file looking for L"winhlp32.exe" in L"C:\\Z\\HoMM3Complete;.;C:\\windows\\system32;C:\\windows\\system;C:\\windows;C:\\windows\\system32;C:\\windows;C:\\windows\\system32\\wbem;C:\\windows\\system32\\WindowsPowershell\\v1.0"
0114:trace:process:NtCreateUserProcess L"\\??\\C:\\windows\\system32\\winhlp32.exe" image L"C:\\windows\\system32\\winhlp32.exe" cmdline L"winhlp32.exe -x" parent (nil)
0114:trace:process:NtCreateUserProcess L"\\??\\C:\\windows\\system32\\winhlp32.exe" pid 0128 tid 012c handles 0xc0/0xc4
0114:trace:process:CreateProcessInternalW started process pid 0128 tid 012c
012c:trace:process:NtQueryInformationProcess (0xffffffff,0x00000025,0x6afcc0,0x00000030,(nil))
012c:trace:process:NtQueryInformationProcess (0xffffffff,0x0000001a,0x6af9ac,0x00000004,(nil))
012c:trace:process:GetEnvironmentVariableW (L"WINEUNIXCP" 006AF63A 85)
012c:trace:process:ExpandEnvironmentStringsW (L"@tzres.dll,-4896" 00000000 0)
012c:trace:process:ExpandEnvironmentStringsW (L"@tzres.dll,-4896" 007B4EE0 17)
012c:trace:process:ExpandEnvironmentStringsW (L"@tzres.dll,-4897" 00000000 0)
012c:trace:process:ExpandEnvironmentStringsW (L"@tzres.dll,-4897" 007B4F10 17)
012c:trace:process:set_entry_point setting FT_Thunk at 7B63F638 to 00000000
012c:trace:process:NtQueryInformationProcess (0xffffffff,0x00000007,0x6afbd4,0x00000004,(nil))
012c:trace:process:GetEnvironmentVariableW (L"oanocache" 00000000 0)
012c:fixme:winhelp:MACRO_PopupContext ("C:\\Z\\HoMM3Complete\\h3maped.HLP", 196743)
At least we've achieved consistency. :roll:
jkfloris
Level 12
Level 12
Posts: 3141
Joined: Thu Aug 14, 2014 10:10 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by jkfloris »

Glad you found the problem.
Unfortunately, this is the only thing Wine can do (at this time). Displaying the pop-up help is not yet available in Wine. If you want the popup help text to be visible as well, you can file a bug.
kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

jkfloris wrote: Sat Dec 30, 2023 7:37 am you can file a bug.
Uh-oh. That's probably a bridge too far for me, I have no clue how to do that (properly)...

Besides, how many people use the HoMM3 map editor, to warrant somebody spending time on fixing this missing "winhlp32.exe" feature?... :mrgreen:

Anyway: Thank you a lot for your time and effort!
dacha
Level 1
Level 1
Posts: 8
Joined: Sun May 24, 2020 3:22 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by dacha »

kr751 wrote: Fri Dec 29, 2023 10:30 am After removing it I get no error (but no information popup either), just like you.

Here what she said:

Code: Select all

...
012c:fixme:winhelp:MACRO_PopupContext ("C:\\Z\\HoMM3Complete\\h3maped.HLP", 196743)
On the contrary: "fixme" can be an error, and that particular message does point to the problem:

Code: Select all

void CALLBACK MACRO_PopupContext(LPCSTR str, LONG u)
{
    WINE_FIXME("(%s, %lu)\n", debugstr_a(str), u);
}
The function MACRO_PopupContext is just a stub: it has no code, it just logs the FIXME. It needs to be implemented for the HOMM3 map editor to work.

Well done, you discovered a real bug!
dacha
Level 1
Level 1
Posts: 8
Joined: Sun May 24, 2020 3:22 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by dacha »

kr751
Level 2
Level 2
Posts: 13
Joined: Mon Dec 18, 2023 4:31 am

Re: Native WinXP help (winhlp32.exe) doesn't work

Post by kr751 »

Thanks guys! :D
Post Reply