protonscr

Add MFC42.dll "loader hack", which helps multiple games.

protonclosed
ValveSoftware/Proton#2624 · opened 2019-05-02 by HonkingGoose · updated 2026-01-28 · 7 comments · github
HHonkingGoose 2019-05-02 github

Feature Request

I confirm:

  • [x] that I haven't found another request for this feature.
  • [x] that I have checked whether there are updates for my system available that
    contain this feature already.

Description

Add "loader hack" to pretend to load mfc42:

  1. During LoadLibrarydetect if app uses mfc42.
  2. Return kernel32 handle when app requests mfc42.

This solves the pidgen.dll issue, and should allow the games to run.
Full credit goes to @aeikum for this proposal.

Games for which a stub would fix the issue:

#17 (https://github.com/ValveSoftware/Proton/issues/2624#issuecomment-562839599)

Games which seem to need a full implementation of MFC42.dll:

#1593
#1805
#2623
#2728

Related Wine bugreport:

https://bugs.winehq.org/show_bug.cgi?id=657

Ddreamer 2019-05-02 github
Aaeikum 2019-05-07 github

Actually implementing mfc42 is an enormous task.

For AOE3 and Rise of Legends, it actually just loads mfc42 and then does nothing with it. I was thinking of adding a loader hack for these games to pretend to load mfc42. Something like, during LoadLibrary, if we detect one of these games is running, just return kernel32's handle when the app requests mfc42. That should work around the pidgen failure and allow these games to run.

HHonkingGoose 2019-05-07 github

Hi @aeikum, I've rewritten this Feature Request to be in line with your proposal.
If the games don't use the mfc42 part anyways, we could just "pretend" to give them the mfc42 part. :smile:

Mmadewokherd 2019-05-09 github

If mfc42 doesn't need to actually work, wouldn't it be simpler to just make a stub for the dll?

Rromulasry 2019-05-15 github

A stub would allow this to be included.

SSbte 2019-12-07 github

I just implemented this hack, and tested all of the mentioned games. Only AoE3 actually benefits from it. The other games need an actual mfc42 implementation.

Aaeikum 2020-04-09 github

This has been in for a while.

Upstream links

DLLs