Add "loader hack" to pretend to load mfc42
:
LoadLibrary
detect if app uses mfc42
.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.
Relevant Wine bugreport: https://bugs.winehq.org/show_bug.cgi?id=657
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.
Most helpful comment
Relevant Wine bugreport: https://bugs.winehq.org/show_bug.cgi?id=657