Problem with user32.dll

Questions about Wine on Linux
Locked
thingkcp
Level 1
Level 1
Posts: 5
Joined: Mon Jul 15, 2013 11:31 am

Problem with user32.dll

Post by thingkcp »

I'm trying to run a proprietary program called Snap in Wine. I am running Ubuntu 12.04 with KDE.

I have a number of versions of this program. Version 9 works fine in Wine as long as I set the Wine version to 1.1.15 or earlier. If I try to use a later version the program does not crash but will not function: if I try to do anything that involves opening a MDI window it just says 'Cannot open window'.

After much digging I have established the following:

1. The program works ok with Wine versions up to 1.1.15 but fails for 1.1.16 and higher.
2. The problem lies with user32.dll: if I copy user32.dll from Wine 1.1.15 to 1.1.16 the program works ok.
3. The problem is not with Snap's installation: I can change user32.dll after installing Snap and the program will work ok.

The difficulty for me is that Snap9 is out of date - they are up to Snap11 now - and later versions need features of Windows that cannot be installed in Wine 1.1.15.

I'm using PlayOnLinux, which makes it easy for me to have multiple Wine prefixes and tinker with them.

I know that it is not possible to override user32.dll, so I am a bit stuck. I'm posting here on the off chance that someone might know more about this topic than I do (which would not be difficult):
  • Is there any information anywhere on what changed in user32.dll from Wine 1.1.15 to 1.1.16?
  • Given the fact that Snap does not crash, is there any way I can get it to tell me exactly what it is not happy with?
  • If I could somehow locate the problem, would I be able to compile my own version of user32.dll?
Just for the record, Snap9 works fine in Windows (I have version 7 but it also runs in earlier versions).

Any ideas would be most welcome.
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Problem with user32.dll

Post by dimesio »

The versions of Wine you are talking about are over 4 years old and have not been supported in a long time.

Have you even tested the latest development release? If you haven't, you need to do so using plain Wine (no POL).

If this is still an issue in current Wine, please file a bug. As for finding out what caused the regression, usually I'd tell you to run a regression test, but versions that old may not build on a current system. If you want to try, follow these instructions: http://wiki.winehq.org/RegressionTesting. Otherwise, you could browse the patches committed between 1.1.15 and 1.1.16; there were several changes to user32.dll. http://source.winehq.org/git/wine.git/s ... 9e36aec542
thingkcp
Level 1
Level 1
Posts: 5
Joined: Mon Jul 15, 2013 11:31 am

Re: Problem with user32.dll

Post by thingkcp »

Thanks for the advice. The reason I am working with these old versions is because I have identified that that is where the problem first occurs. Previously all I knew was that Snap worked in wine-0.9.61 and did not work in the latest version I had available (1.4). I have now narrowed down the issue to the changes in user32.dll between 1.1.15 and 1.1.16.

I have now cloned the git repository and am attempting to compile the latest version and/or run a regression test. However, there is a problem with the latest version and Ubuntu 12.04. I need to resolve that before I can go any further.
thingkcp
Level 1
Level 1
Posts: 5
Joined: Mon Jul 15, 2013 11:31 am

Re: Problem with user32.dll [SOLVED]

Post by thingkcp »

I have now tracked down the source of the problem with Snap.

I managed, with some patching, to get Wine to compile right back to wine-1.1.15. Getting that to work is a tale in its own right.

Once I had done that I was able to establish that the commit where the problem started was this one:

http://source.winehq.org/git/wine.git/c ... de67ae0b80

Code: Select all

user32/resources: Remove the "switch to... <Ctrl+Esc>" item from the system menu.
For some reason removing this item renders Snap unable to open client windows.

This commit is the subject of a bug report (http://bugs.winehq.org/show_bug.cgi?id=21879) which is still open - so I think it is fair to regard it as a current bug rather than an old issue. As the bug is reported as affecting only Word95 I suppose it's not a high priority.

I can reverse this commit in versions of Wine up to 1.3.11, and get Snap9 running (in plain Wine, not POL, as you suggested). After that the file structure changes and I need to find another way to fix the problem.

Many thanks for your help on this. Should I file a separate bug report for this or add a comment to the existing bug report?
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Problem with user32.dll

Post by dimesio »

There's a patch in the bug report that was written for 1.5.4. Try that (if it doesn't apply to 1.6, test it with 1.5.4), and if the patch fixes your problem, add a comment to that bug report. If it doesn't fix it, file a new bug and mention that you tried that patch and it didn't work.
thingkcp
Level 1
Level 1
Posts: 5
Joined: Mon Jul 15, 2013 11:31 am

Re: Problem with user32.dll

Post by thingkcp »

I have tried that patch and it doesn't work for me - it alters SYSMENU and I need to fix SYSMENUMDI. However, applying the equivalent change to SYSMENUMDI does work in 1.6, and it can be applied on top of the patch given for 1.5.4. This means that I now have a working version of the latest stable Wine, which is quite exciting.

I'll file a new bug referring to the existing one, and leave it to the powers that be to decide whether to treat the two bugs as the same.
thingkcp
Level 1
Level 1
Posts: 5
Joined: Mon Jul 15, 2013 11:31 am

Re: Problem with user32.dll

Post by thingkcp »

I have more information on the bug. I'll post a bug report when I have learnt how to do that properly, but in the meantime this is FYI.

I ran Snap with and without a patch, using WINEDEBUG=+menu, and looked at the difference in output. The crucial point, where the output diverges, is this:

trace:menu:do_debug_print_menuitem SetMenuItemInfo_common from: { ID=0xf130, Text=L"&Switch to...\tCtrl-Esc" }
trace:menu:do_debug_print_menuitem SetMenuItemInfo_common to : { ID=0xf040, Text=L"Nex&t\tCtrl+F6" }

It seems that either Wine or Snap wants to convert the MDI menu item from "Switch to..." to "Next". If it can't find the menu item it wants to change then it fails. Once I alter user32.rc so that it can find that menu item it runs fine.
Locked