diff --git a/lsteamclient/cppISteamClient_SteamClient007.cpp b/lsteamclient/cppISteamClient_SteamClient007.cpp index ced40905..846b4967 100644 --- a/lsteamclient/cppISteamClient_SteamClient007.cpp +++ b/lsteamclient/cppISteamClient_SteamClient007.cpp @@ -112,6 +112,7 @@ void *cppISteamClient_SteamClient007_GetISteamNetworking(void *linux_side, HStea void cppISteamClient_SteamClient007_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient008.cpp b/lsteamclient/cppISteamClient_SteamClient008.cpp index 499d8056..8c24b7fb 100644 --- a/lsteamclient/cppISteamClient_SteamClient008.cpp +++ b/lsteamclient/cppISteamClient_SteamClient008.cpp @@ -112,6 +112,7 @@ uint32 cppISteamClient_SteamClient008_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient008_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient009.cpp b/lsteamclient/cppISteamClient_SteamClient009.cpp index d399f605..1fa46c04 100644 --- a/lsteamclient/cppISteamClient_SteamClient009.cpp +++ b/lsteamclient/cppISteamClient_SteamClient009.cpp @@ -117,6 +117,7 @@ uint32 cppISteamClient_SteamClient009_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient009_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient010.cpp b/lsteamclient/cppISteamClient_SteamClient010.cpp index 61969703..ff611afa 100644 --- a/lsteamclient/cppISteamClient_SteamClient010.cpp +++ b/lsteamclient/cppISteamClient_SteamClient010.cpp @@ -117,6 +117,7 @@ uint32 cppISteamClient_SteamClient010_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient010_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient011.cpp b/lsteamclient/cppISteamClient_SteamClient011.cpp index d9f513f2..1cc25eda 100644 --- a/lsteamclient/cppISteamClient_SteamClient011.cpp +++ b/lsteamclient/cppISteamClient_SteamClient011.cpp @@ -122,6 +122,7 @@ uint32 cppISteamClient_SteamClient011_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient011_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient012.cpp b/lsteamclient/cppISteamClient_SteamClient012.cpp index 5bd294e8..422dfb59 100644 --- a/lsteamclient/cppISteamClient_SteamClient012.cpp +++ b/lsteamclient/cppISteamClient_SteamClient012.cpp @@ -117,6 +117,7 @@ uint32 cppISteamClient_SteamClient012_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient012_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient013.cpp b/lsteamclient/cppISteamClient_SteamClient013.cpp index fe84eb68..401d93df 100644 --- a/lsteamclient/cppISteamClient_SteamClient013.cpp +++ b/lsteamclient/cppISteamClient_SteamClient013.cpp @@ -117,6 +117,7 @@ uint32 cppISteamClient_SteamClient013_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient013_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient014.cpp b/lsteamclient/cppISteamClient_SteamClient014.cpp index 820d9d80..83847a00 100644 --- a/lsteamclient/cppISteamClient_SteamClient014.cpp +++ b/lsteamclient/cppISteamClient_SteamClient014.cpp @@ -117,6 +117,7 @@ uint32 cppISteamClient_SteamClient014_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient014_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient015.cpp b/lsteamclient/cppISteamClient_SteamClient015.cpp index b79fb6e1..1c0d59a0 100644 --- a/lsteamclient/cppISteamClient_SteamClient015.cpp +++ b/lsteamclient/cppISteamClient_SteamClient015.cpp @@ -117,6 +117,7 @@ uint32 cppISteamClient_SteamClient015_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient015_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient016.cpp b/lsteamclient/cppISteamClient_SteamClient016.cpp index 929b5a9d..636e323f 100644 --- a/lsteamclient/cppISteamClient_SteamClient016.cpp +++ b/lsteamclient/cppISteamClient_SteamClient016.cpp @@ -117,6 +117,7 @@ uint32 cppISteamClient_SteamClient016_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient016_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient017.cpp b/lsteamclient/cppISteamClient_SteamClient017.cpp index 5003ff8d..ddc292b7 100644 --- a/lsteamclient/cppISteamClient_SteamClient017.cpp +++ b/lsteamclient/cppISteamClient_SteamClient017.cpp @@ -117,6 +117,7 @@ uint32 cppISteamClient_SteamClient017_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient017_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient018.cpp b/lsteamclient/cppISteamClient_SteamClient018.cpp index ee779088..70aa6628 100644 --- a/lsteamclient/cppISteamClient_SteamClient018.cpp +++ b/lsteamclient/cppISteamClient_SteamClient018.cpp @@ -123,6 +123,7 @@ uint32 cppISteamClient_SteamClient018_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient018_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient019.cpp b/lsteamclient/cppISteamClient_SteamClient019.cpp index 6fb8f855..82a3b8e6 100644 --- a/lsteamclient/cppISteamClient_SteamClient019.cpp +++ b/lsteamclient/cppISteamClient_SteamClient019.cpp @@ -123,6 +123,7 @@ uint32 cppISteamClient_SteamClient019_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient019_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamClient_SteamClient020.cpp b/lsteamclient/cppISteamClient_SteamClient020.cpp index 65b81b98..4c87a239 100644 --- a/lsteamclient/cppISteamClient_SteamClient020.cpp +++ b/lsteamclient/cppISteamClient_SteamClient020.cpp @@ -123,6 +123,7 @@ uint32 cppISteamClient_SteamClient020_GetIPCCallCount(void *linux_side) void cppISteamClient_SteamClient020_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamClient*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamUtils_SteamUtils004.cpp b/lsteamclient/cppISteamUtils_SteamUtils004.cpp index 6f2a4706..4c01cd90 100644 --- a/lsteamclient/cppISteamUtils_SteamUtils004.cpp +++ b/lsteamclient/cppISteamUtils_SteamUtils004.cpp @@ -92,6 +92,7 @@ uint32 cppISteamUtils_SteamUtils004_GetIPCCallCount(void *linux_side) void cppISteamUtils_SteamUtils004_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamUtils*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamUtils_SteamUtils005.cpp b/lsteamclient/cppISteamUtils_SteamUtils005.cpp index d4faf857..fa64c145 100644 --- a/lsteamclient/cppISteamUtils_SteamUtils005.cpp +++ b/lsteamclient/cppISteamUtils_SteamUtils005.cpp @@ -92,6 +92,7 @@ uint32 cppISteamUtils_SteamUtils005_GetIPCCallCount(void *linux_side) void cppISteamUtils_SteamUtils005_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamUtils*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamUtils_SteamUtils006.cpp b/lsteamclient/cppISteamUtils_SteamUtils006.cpp index 483a303a..cf78566f 100644 --- a/lsteamclient/cppISteamUtils_SteamUtils006.cpp +++ b/lsteamclient/cppISteamUtils_SteamUtils006.cpp @@ -92,6 +92,7 @@ uint32 cppISteamUtils_SteamUtils006_GetIPCCallCount(void *linux_side) void cppISteamUtils_SteamUtils006_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamUtils*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamUtils_SteamUtils007.cpp b/lsteamclient/cppISteamUtils_SteamUtils007.cpp index 233d0a72..ba45950d 100644 --- a/lsteamclient/cppISteamUtils_SteamUtils007.cpp +++ b/lsteamclient/cppISteamUtils_SteamUtils007.cpp @@ -92,6 +92,7 @@ uint32 cppISteamUtils_SteamUtils007_GetIPCCallCount(void *linux_side) void cppISteamUtils_SteamUtils007_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamUtils*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamUtils_SteamUtils008.cpp b/lsteamclient/cppISteamUtils_SteamUtils008.cpp index c43ba3b8..87ab0ba4 100644 --- a/lsteamclient/cppISteamUtils_SteamUtils008.cpp +++ b/lsteamclient/cppISteamUtils_SteamUtils008.cpp @@ -92,6 +92,7 @@ uint32 cppISteamUtils_SteamUtils008_GetIPCCallCount(void *linux_side) void cppISteamUtils_SteamUtils008_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamUtils*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamUtils_SteamUtils009.cpp b/lsteamclient/cppISteamUtils_SteamUtils009.cpp index 8f0cf187..0af46f8b 100644 --- a/lsteamclient/cppISteamUtils_SteamUtils009.cpp +++ b/lsteamclient/cppISteamUtils_SteamUtils009.cpp @@ -93,6 +93,7 @@ uint32 cppISteamUtils_SteamUtils009_GetIPCCallCount(void *linux_side) void cppISteamUtils_SteamUtils009_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamUtils*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/cppISteamUtils_SteamUtils010.cpp b/lsteamclient/cppISteamUtils_SteamUtils010.cpp index 4840406c..78554abf 100644 --- a/lsteamclient/cppISteamUtils_SteamUtils010.cpp +++ b/lsteamclient/cppISteamUtils_SteamUtils010.cpp @@ -93,6 +93,7 @@ uint32 cppISteamUtils_SteamUtils010_GetIPCCallCount(void *linux_side) void cppISteamUtils_SteamUtils010_SetWarningMessageHook(void *linux_side, SteamAPIWarningMessageHook_t pFunction) { + pFunction = (SteamAPIWarningMessageHook_t)manual_convert_SteamAPIWarningMessageHook_t((void*)pFunction); ((ISteamUtils*)linux_side)->SetWarningMessageHook((SteamAPIWarningMessageHook_t)pFunction); } diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index b3f48899..caa164f9 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -245,6 +245,7 @@ def method_needs_manual_handling(interface_with_version, method_name): # manual converters for simple types (function pointers) manual_type_converters = [ "FSteamNetworkingSocketsDebugOutput", + "SteamAPIWarningMessageHook_t", "SteamAPI_CheckCallbackRegistered_t" ] diff --git a/lsteamclient/steam_defs.h b/lsteamclient/steam_defs.h index cc98181a..def82462 100644 --- a/lsteamclient/steam_defs.h +++ b/lsteamclient/steam_defs.h @@ -235,7 +235,7 @@ typedef struct SteamNetConnectionRealTimeLaneStatus_t SteamNetConnectionRealTime typedef struct SteamNetworkingFakeIPResult_t SteamNetworkingFakeIPResult_t; typedef uint32 (*SteamAPI_CheckCallbackRegistered_t)(int cb); -typedef void *SteamAPIWarningMessageHook_t; //already cdecl, no need for conversion(?) +typedef void *SteamAPIWarningMessageHook_t; typedef void *SteamAPI_PostAPIResultInProcess_t; //unused typedef void (*FSteamNetworkingSocketsDebugOutput)(ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg); diff --git a/lsteamclient/steamclient_main.c b/lsteamclient/steamclient_main.c index 88dbab3b..b64db0f2 100644 --- a/lsteamclient/steamclient_main.c +++ b/lsteamclient/steamclient_main.c @@ -692,6 +692,7 @@ static void callback_complete(UINT64 cookie) typedef void (WINAPI *win_FSteamNetworkingSocketsDebugOutput)(ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg); +typedef void (CDECL *win_SteamAPIWarningMessageHook_t)(int, const char *pszMsg); static DWORD WINAPI callback_thread(void *dummy) { @@ -710,6 +711,15 @@ static DWORD WINAPI callback_thread(void *dummy) cb_data.sockets_debug_output.msg); callback_complete(cookie); break; + case STEAM_API_WARNING_HOOK: + TRACE("STEAM_API_WARNING_HOOK func %p, type %u, msg %s.\n", + cb_data.func, cb_data.steam_api_warning_hook.severity, + wine_dbgstr_a(cb_data.steam_api_warning_hook.msg)); + ((win_SteamAPIWarningMessageHook_t)cb_data.func)(cb_data.steam_api_warning_hook.severity, + cb_data.steam_api_warning_hook.msg); + callback_complete(cookie); + break; + default: ERR("Unexpected callback type %u.\n", cb_data.type); break; diff --git a/lsteamclient/steamclient_private.h b/lsteamclient/steamclient_private.h index 2dc5799e..e383bfcc 100644 --- a/lsteamclient/steamclient_private.h +++ b/lsteamclient/steamclient_private.h @@ -59,6 +59,7 @@ void *create_LinuxISteamMatchmakingServerListResponse(void *win, const char *ver void *create_LinuxISteamMatchmakingPingResponse(void *win, const char *version); void *create_LinuxISteamMatchmakingPlayersResponse(void *win, const char *version); void *create_LinuxISteamMatchmakingRulesResponse(void *win, const char *version); +void *manual_convert_SteamAPIWarningMessageHook_t(void *win_func); void *manual_convert_FSteamNetworkingSocketsDebugOutput(void *win_func); void *manual_convert_SteamAPI_CheckCallbackRegistered_t(void *win_func); @@ -73,6 +74,7 @@ void *alloc_vtable(void *vtable, unsigned int method_count, const char *iface_ve enum callback_type { SOCKET_DEBUG_OUTPUT = 1, + STEAM_API_WARNING_HOOK, }; struct callback_data @@ -88,6 +90,12 @@ struct callback_data const char *msg; } sockets_debug_output; + struct + { + int severity; + const char *msg; + } + steam_api_warning_hook; }; }; diff --git a/lsteamclient/steamclient_wrappers.c b/lsteamclient/steamclient_wrappers.c index adb35391..f840752a 100644 --- a/lsteamclient/steamclient_wrappers.c +++ b/lsteamclient/steamclient_wrappers.c @@ -315,6 +315,29 @@ void *manual_convert_FSteamNetworkingSocketsDebugOutput(void *win_func) } +static void *stored_SteamAPIWarningMessageHook_t; + +static void lin_SteamAPIWarningMessageHook_t(int severity, const char *msg) +{ + struct callback_data cb_data = { 0 }; + /* Only Unix native calls from here (not even TRACE): + * this is native Unix thread which is not initialized by Wine. */ + cb_data.type = STEAM_API_WARNING_HOOK; + cb_data.func = stored_SteamAPIWarningMessageHook_t; + cb_data.steam_api_warning_hook.severity = severity; + cb_data.steam_api_warning_hook.msg = msg; + execute_callback(&cb_data); +} + +void *manual_convert_SteamAPIWarningMessageHook_t(void *win_func) +{ + TRACE("win_func %p, returning %p.\n", win_func, lin_SteamAPIWarningMessageHook_t); + + stored_SteamAPIWarningMessageHook_t = win_func; + + return &lin_SteamAPIWarningMessageHook_t; +} + /***** SteamAPI_CheckCallbackRegistered_t *****/ static uint32 (__attribute__((ms_abi)) *stored_SteamAPI_CheckCallbackRegistered_t)(int cb);