lsteamclient: Fix count in wow64 networking messages conversion.#9665
Open
viper9503 wants to merge 1 commit intoValveSoftware:proton_10.0from
Open
lsteamclient: Fix count in wow64 networking messages conversion.#9665viper9503 wants to merge 1 commit intoValveSoftware:proton_10.0from
viper9503 wants to merge 1 commit intoValveSoftware:proton_10.0from
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix count in WOW64 networking messages conversion
Problem
Multiplayer is broken for 32-bit games running on 64-bit systems (the WOW64 path). Stardew Valley is the most commonly reported case, players can't join or host multiplayer sessions on Proton 10.0, but it works fine on 9.0-4.
The WOW64 overloads of
receive_messages_utowandsend_messages_wtouinlsteamclient/unix_steam_networking_manual.cppusewhile(count--)to copyptr32<>pointer arrays into native 64-bit arrays. Sincecountisuint32_t, the post-decrement wraps it toUINT32_MAXafter the loop. The subsequent call to the actual message processing function receives this corrupted count, so networking messages are never delivered.Affected games
Any 32-bit game that uses Steam networking APIs for multiplayer, including:
ISteamNetworkingSocketsorISteamNetworkingMessages64-bit games are unaffected as they don't use the
ptr32<>code path.Fix
Replace
while(count--)withfor(i = 0; i < count; ++i)in all three WOW64 thunk functions socountis preserved for the subsequent call.