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

Created on 2 May 2019  路  7Comments  路  Source: ValveSoftware/Proton

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

Most helpful comment

All 7 comments

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.

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:

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

A stub would allow this to be included.

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.

This has been in for a while.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

juppso picture juppso  路  3Comments

lumni1968 picture lumni1968  路  3Comments

raikirii picture raikirii  路  3Comments

lucifertdark picture lucifertdark  路  3Comments

prototype99 picture prototype99  路  3Comments