From c9dda0d5b79e1055ce6802f1dbaab05338752546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 11 Sep 2023 20:10:46 +0200 Subject: [PATCH] lsteamclient: Reorder do_cb_wrap first parameters. CW-Bug-Id: #22729 --- lsteamclient/gen_wrapper.py | 2 +- lsteamclient/steamclient_main.c | 6 +++--- lsteamclient/steamclient_private.h | 4 +++- lsteamclient/winISteamUtils.c | 16 ++++++++-------- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index 8f57a8d1..68827185 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -877,7 +877,7 @@ def handle_method(used_name, cfile, classname, winclassname, cppname, method, cp used_name.startswith("GetISteamGenericInterface")) if should_do_cb_wrap: - cfile.write(f"do_cb_wrap(0, _this->linux_side, &{cppname}_{used_name}") + cfile.write(f"do_cb_wrap(0, &{cppname}_{used_name}, _this->linux_side") else: if should_gen_wrapper: cfile.write("create_win_interface(pchVersion,\n ") diff --git a/lsteamclient/steamclient_main.c b/lsteamclient/steamclient_main.c index 7c03159b..026cad45 100644 --- a/lsteamclient/steamclient_main.c +++ b/lsteamclient/steamclient_main.c @@ -999,9 +999,9 @@ static int get_callback_len(int cb) return 0; } -bool do_cb_wrap(HSteamPipe pipe, void *linux_side, - bool (*cpp_func)(void *, SteamAPICall_t, void *, int, int, bool *), - SteamAPICall_t call, void *callback, int callback_len, int cb_expected, bool *failed) +bool do_cb_wrap( HSteamPipe pipe, bool (*cpp_func)( void *, SteamAPICall_t, void *, int, int, bool * ), + void *linux_side, SteamAPICall_t call, void *callback, int callback_len, + int cb_expected, bool *failed ) { void *lin_callback = NULL; int lin_callback_len; diff --git a/lsteamclient/steamclient_private.h b/lsteamclient/steamclient_private.h index 20de7730..06369f29 100644 --- a/lsteamclient/steamclient_private.h +++ b/lsteamclient/steamclient_private.h @@ -66,7 +66,9 @@ void *manual_convert_SteamAPI_CheckCallbackRegistered_t(void *win_func); extern char g_tmppath[PATH_MAX]; typedef uint64 SteamAPICall_t; //for ancient SDKs -bool do_cb_wrap(HSteamPipe pipe, void *linux_side, bool (*cpp_func)(void *, SteamAPICall_t, void *, int, int, bool *), SteamAPICall_t call, void *callback, int callback_len, int cb_expected, bool *failed); +bool do_cb_wrap( HSteamPipe pipe, bool (*cpp_func)( void *, SteamAPICall_t, void *, int, int, bool * ), + void *linux_side, SteamAPICall_t call, void *callback, int callback_len, + int cb_expected, bool *failed ); void *alloc_mem_for_iface(size_t size, const char *iface_version); void *alloc_vtable(void *vtable, unsigned int method_count, const char *iface_version); diff --git a/lsteamclient/winISteamUtils.c b/lsteamclient/winISteamUtils.c index 08d1eec7..353b82a8 100644 --- a/lsteamclient/winISteamUtils.c +++ b/lsteamclient/winISteamUtils.c @@ -117,7 +117,7 @@ DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils002_GetAPICallResult, 28) bool __thiscall winISteamUtils_SteamUtils002_GetAPICallResult(winISteamUtils_SteamUtils002 *_this, SteamAPICall_t hSteamAPICall, void * pCallback, int cubCallback, int iCallbackExpected, bool * pbFailed) { TRACE("%p\n", _this); - return do_cb_wrap(0, _this->linux_side, &cppISteamUtils_SteamUtils002_GetAPICallResult, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); + return do_cb_wrap(0, &cppISteamUtils_SteamUtils002_GetAPICallResult, _this->linux_side, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); } extern vtable_ptr winISteamUtils_SteamUtils002_vtable; @@ -256,7 +256,7 @@ DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils004_GetAPICallResult, 28) bool __thiscall winISteamUtils_SteamUtils004_GetAPICallResult(winISteamUtils_SteamUtils004 *_this, SteamAPICall_t hSteamAPICall, void * pCallback, int cubCallback, int iCallbackExpected, bool * pbFailed) { TRACE("%p\n", _this); - return do_cb_wrap(0, _this->linux_side, &cppISteamUtils_SteamUtils004_GetAPICallResult, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); + return do_cb_wrap(0, &cppISteamUtils_SteamUtils004_GetAPICallResult, _this->linux_side, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); } DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils004_RunFrame, 4) @@ -427,7 +427,7 @@ DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils005_GetAPICallResult, 28) bool __thiscall winISteamUtils_SteamUtils005_GetAPICallResult(winISteamUtils_SteamUtils005 *_this, SteamAPICall_t hSteamAPICall, void * pCallback, int cubCallback, int iCallbackExpected, bool * pbFailed) { TRACE("%p\n", _this); - return do_cb_wrap(0, _this->linux_side, &cppISteamUtils_SteamUtils005_GetAPICallResult, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); + return do_cb_wrap(0, &cppISteamUtils_SteamUtils005_GetAPICallResult, _this->linux_side, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); } DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils005_RunFrame, 4) @@ -640,7 +640,7 @@ DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils006_GetAPICallResult, 28) bool __thiscall winISteamUtils_SteamUtils006_GetAPICallResult(winISteamUtils_SteamUtils006 *_this, SteamAPICall_t hSteamAPICall, void * pCallback, int cubCallback, int iCallbackExpected, bool * pbFailed) { TRACE("%p\n", _this); - return do_cb_wrap(0, _this->linux_side, &cppISteamUtils_SteamUtils006_GetAPICallResult, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); + return do_cb_wrap(0, &cppISteamUtils_SteamUtils006_GetAPICallResult, _this->linux_side, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); } DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils006_RunFrame, 4) @@ -869,7 +869,7 @@ DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils007_GetAPICallResult, 28) bool __thiscall winISteamUtils_SteamUtils007_GetAPICallResult(winISteamUtils_SteamUtils007 *_this, SteamAPICall_t hSteamAPICall, void * pCallback, int cubCallback, int iCallbackExpected, bool * pbFailed) { TRACE("%p\n", _this); - return do_cb_wrap(0, _this->linux_side, &cppISteamUtils_SteamUtils007_GetAPICallResult, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); + return do_cb_wrap(0, &cppISteamUtils_SteamUtils007_GetAPICallResult, _this->linux_side, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); } DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils007_RunFrame, 4) @@ -1106,7 +1106,7 @@ DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils008_GetAPICallResult, 28) bool __thiscall winISteamUtils_SteamUtils008_GetAPICallResult(winISteamUtils_SteamUtils008 *_this, SteamAPICall_t hSteamAPICall, void * pCallback, int cubCallback, int iCallbackExpected, bool * pbFailed) { TRACE("%p\n", _this); - return do_cb_wrap(0, _this->linux_side, &cppISteamUtils_SteamUtils008_GetAPICallResult, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); + return do_cb_wrap(0, &cppISteamUtils_SteamUtils008_GetAPICallResult, _this->linux_side, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); } DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils008_RunFrame, 4) @@ -1359,7 +1359,7 @@ DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils009_GetAPICallResult, 28) bool __thiscall winISteamUtils_SteamUtils009_GetAPICallResult(winISteamUtils_SteamUtils009 *_this, SteamAPICall_t hSteamAPICall, void * pCallback, int cubCallback, int iCallbackExpected, bool * pbFailed) { TRACE("%p\n", _this); - return do_cb_wrap(0, _this->linux_side, &cppISteamUtils_SteamUtils009_GetAPICallResult, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); + return do_cb_wrap(0, &cppISteamUtils_SteamUtils009_GetAPICallResult, _this->linux_side, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); } DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils009_RunFrame, 4) @@ -1660,7 +1660,7 @@ DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils010_GetAPICallResult, 28) bool __thiscall winISteamUtils_SteamUtils010_GetAPICallResult(winISteamUtils_SteamUtils010 *_this, SteamAPICall_t hSteamAPICall, void * pCallback, int cubCallback, int iCallbackExpected, bool * pbFailed) { TRACE("%p\n", _this); - return do_cb_wrap(0, _this->linux_side, &cppISteamUtils_SteamUtils010_GetAPICallResult, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); + return do_cb_wrap(0, &cppISteamUtils_SteamUtils010_GetAPICallResult, _this->linux_side, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, pbFailed); } DEFINE_THISCALL_WRAPPER(winISteamUtils_SteamUtils010_RunFrame, 4)