Fix up CGameID param on more old Steam interface versions #8375
+106
−91
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.
This addresses most or all of #2249, applying the same fix for lsteamclient's InitiateGameConnection in 008 of ISteamUser to the 005, 006, 007, and 009 versions of the interface. Disassembly shows the same compiler optimization is present on these as well, which is consistent with the issues reported. Newer versions of this interface dropped the CGameID parameter and are implicitly unaffected. Version 004 has a CGameID parameter, but it doesn't appear to perform the same dereferencing. Without the fix, calls to
ISteamUser::InitiateGameConnection
on the affected interface versions most frequently lead to a crash, or at best, authentication will just fail, quickly leading to a disconnect. In testing with the fix, a crash no longer occurred on server connection in NEOTOKYO (Steam app 244630), a Source SDK 2006 mod. The crash is reproducible on Proton 9.0-4.Edit: Per my findings on that same issue, here - The same fix is also applied to all of the ISteamUsersStats001 and 002 interface functions. I admit that I didn't manually check every function on every version of those two very old (pre-1.00) interface versions, but they all have a first parameter of CGameID, and the 12 or so function versions I didn't at did have the dereferencing issue present. In testing, this fixed the startup crash reported in that issue with the mod version of Black Mesa on Source SDK 2007. I also confirmed that the achievements panel opened and displayed properly.
This is my first contribution to this repo, so please let me know if I missed anything required. I didn't see any contributing guidelines.
For reference, #2249 (comment)