Fix callbacks for pre-1.02x SDKs#447
Merged
Detanup01 merged 1 commit intoDetanup01:devfrom Mar 8, 2026
Merged
Conversation
884cb95 to
897a245
Compare
897a245 to
a52e511
Compare
Owner
|
Lmao, ms.. |
|
Don't do that, instead rename the functions in the way they are in memory layout. So you don't have an overload or wrapper. |
Contributor
Author
|
Tell that to Valve, not us. :P We're stuck with their mess. |
|
There was a reason why I said it here and not to Valve but, ok, then just ignore my comment. |
Owner
|
Propose the change then I dont know much C++ to do anything either so |
Contributor
Author
|
The issue isn't that our vtable order doesn't match Valve's, the issue is that Valve's own vtable order is inconsistent between old and new SDKs on Windows because they added an overload. Renaming the overload on our end wouldn't solve anything. Like I said, this is Valve's mess that we're stuck with. |
universal963
approved these changes
Mar 8, 2026
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.
SDK version 1.02x added an overload for
CCallbackBase::Run. Because of how MSVC handles virtual function overloads, this changed the order of functions in vtable from 1.02, which breaks old games. This PR adds a workaround for this issue that uses a wrapper for the oldCCallbackBasevariant.Note that this only affects steam_api.dll replacement, loader + steamclient.dll setup already works fine as is.
More about this problem with vtables and overloads:
https://stackoverflow.com/questions/61542063/inversion-of-generated-vtable-functions-order-for-functions-with-the-same-name
https://stackoverflow.com/questions/22059092/visual-c-methods-in-vfptr-in-reverse-order