Proton 11.0 is rebased on a newer Wine and now uses KnownDLLs like Windows1, meaning msvcrt.dll won't load from the game directory (mentioned in #45 (comment)).
I'd assume this behavior is going to stay in place so we probably have to evaluate other options. I think ucrtbase.dll could be good. There's a patch in Proton's Wine fork that excludes ucrtbase.dll from this logic2, but I also don't think ucrtbase.dll is supposed to be a KnownDLL in the first place3. The commit references "CW-Bug-Id: #22048" but as far as I can tell that is not publicly accessible. Pre-11.0 Proton versions did add ucrtbase.dll as a KnownDLL4. From testing I can observe that when switching to Proton 11.0 the process of updating the wineprefix doesn't remove ucrtbase.dll from the KnownDLLs registry entries, which is probably the reason for that patch.
So, assuming I haven't missed anything that makes ucrtbase.dll a bad candidate, I believe it should be safe to use as a hook for Proton support into the future. I've made a test version on a branch here https://github.com/Pizzabelly/SharpPluginLoader/tree/ucrtbase. I can confirm it works on Proton 11.0 and 10.0, the only downside I've noticed is that it adds ~100KB to the loader DLL.
I should be able to test the changes on Windows in a few days. Then, if no issues are raised, I can make a PR for this.
Proton 11.0 is rebased on a newer Wine and now uses KnownDLLs like Windows1, meaning msvcrt.dll won't load from the game directory (mentioned in #45 (comment)).
I'd assume this behavior is going to stay in place so we probably have to evaluate other options. I think ucrtbase.dll could be good. There's a patch in Proton's Wine fork that excludes ucrtbase.dll from this logic2, but I also don't think ucrtbase.dll is supposed to be a KnownDLL in the first place3. The commit references "CW-Bug-Id: #22048" but as far as I can tell that is not publicly accessible. Pre-11.0 Proton versions did add ucrtbase.dll as a KnownDLL4. From testing I can observe that when switching to Proton 11.0 the process of updating the wineprefix doesn't remove ucrtbase.dll from the KnownDLLs registry entries, which is probably the reason for that patch.
So, assuming I haven't missed anything that makes ucrtbase.dll a bad candidate, I believe it should be safe to use as a hook for Proton support into the future. I've made a test version on a branch here https://github.com/Pizzabelly/SharpPluginLoader/tree/ucrtbase. I can confirm it works on Proton 11.0 and 10.0, the only downside I've noticed is that it adds ~100KB to the loader DLL.
I should be able to test the changes on Windows in a few days. Then, if no issues are raised, I can make a PR for this.
Footnotes
https://gitlab.winehq.org/wine/wine/-/commit/4220e6805aa0711302a05e55a227bd08b079e68c ↩
https://github.com/ValveSoftware/wine/commit/d9e1c67bc93c8af2247cab1d0c17e491127a5a1b ↩
https://devblogs.microsoft.com/cppblog/introducing-the-universal-crt/ ("note-worthy changes" 6.) ↩
https://github.com/ValveSoftware/wine/commit/88ade93c0569d9b564ebb60f559fe1027851eade#diff-97c2d8b2f430e9e2314010269ec88b08d148408ee81bf4cbc1a6d9e89b00deb3R559 ↩