From b56d6aa766fc383e358b727f20937cfb9dcd8518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 2 Oct 2023 10:51:14 +0200 Subject: [PATCH] lsteamclient: Rewrite SteamNetworkingMessage_t_144 unix thunks. CW-Bug-Id: #22729 --- lsteamclient/Makefile.in | 3 +- lsteamclient/gen_wrapper.py | 4 +- lsteamclient/steam_networking_manual.c | 185 ++++++++++++++++++ lsteamclient/steamclient_manual_144.cpp | 27 --- lsteamclient/steamclient_manual_146.cpp | 27 --- lsteamclient/unix_steam_networking_manual.cpp | 78 ++++++++ lsteamclient/unixlib.h | 19 ++ lsteamclient/winISteamNetworkingSockets.c | 56 ------ 8 files changed, 285 insertions(+), 114 deletions(-) delete mode 100644 lsteamclient/steamclient_manual_144.cpp delete mode 100644 lsteamclient/steamclient_manual_146.cpp create mode 100644 lsteamclient/unix_steam_networking_manual.cpp diff --git a/lsteamclient/Makefile.in b/lsteamclient/Makefile.in index 75d2ff95..844a62d6 100644 --- a/lsteamclient/Makefile.in +++ b/lsteamclient/Makefile.in @@ -215,8 +215,6 @@ SOURCES = \ cppISteamUserStats_STEAMUSERSTATS_INTERFACE_VERSION012.cpp \ cppISteamVideo_STEAMVIDEO_INTERFACE_V001.cpp \ cppISteamVideo_STEAMVIDEO_INTERFACE_V002.cpp \ - steamclient_manual_144.cpp \ - steamclient_manual_146.cpp \ steamclient_manual_147.cpp \ steamclient_manual_148a.cpp \ steamclient_manual_150.cpp \ @@ -289,5 +287,6 @@ SOURCES = \ struct_converters_158.cpp \ unix_steam_client_manual.cpp \ unix_steam_input_manual.cpp \ + unix_steam_networking_manual.cpp \ unix_steam_utils_manual.cpp \ unixlib_generated.cpp \ diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index daf38917..53c30011 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -204,8 +204,8 @@ MANUAL_STRUCTS = [ MANUAL_METHODS = { #TODO: 001 005 007 #NOTE: 003 never appeared in a public SDK, but is an alias for 002 (the version in SDK 1.45 is actually 004 but incorrectly versioned as 003) - "ISteamNetworkingSockets_ReceiveMessagesOnConnection": lambda ver, abi: abi == 'u', - "ISteamNetworkingSockets_ReceiveMessagesOnListenSocket": lambda ver, abi: abi == 'u', + "ISteamNetworkingSockets_ReceiveMessagesOnConnection": lambda ver, abi: abi == 'u' or ver <= 4, + "ISteamNetworkingSockets_ReceiveMessagesOnListenSocket": lambda ver, abi: abi == 'u' or ver <= 4, "ISteamNetworkingSockets_ReceiveMessagesOnPollGroup": lambda ver, abi: abi == 'u', "ISteamNetworkingSockets_SendMessages": lambda ver, abi: abi == 'u', diff --git a/lsteamclient/steam_networking_manual.c b/lsteamclient/steam_networking_manual.c index 07ccbeff..5ba0cf79 100644 --- a/lsteamclient/steam_networking_manual.c +++ b/lsteamclient/steam_networking_manual.c @@ -1,9 +1,194 @@ #include "steamclient_private.h" #include "cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.h" +#include "cppISteamNetworkingSockets_SteamNetworkingSockets002.h" +#include "cppISteamNetworkingSockets_SteamNetworkingSockets004.h" WINE_DEFAULT_DEBUG_CHANNEL(steamclient); +struct networking_message_pool +{ + LONG ref; + void *message_data; + struct networking_message messages[]; +}; + +C_ASSERT( sizeof(struct networking_message_pool) == offsetof( struct networking_message_pool, messages[0] ) ); + +static void networking_message_pool_release( struct networking_message_pool *pool ) +{ + if (!InterlockedDecrement( &pool->ref )) + { + HeapFree( GetProcessHeap(), 0, pool->message_data ); + HeapFree( GetProcessHeap(), 0, pool ); + } +} + +static bool networking_message_pool_alloc_data( uint32_t count, struct networking_message_pool *pool ) +{ + uint32_t i, size; + char *ptr; + + for (i = 0, size = 0; i < count; i++) size += *pool->messages[i].p_size; + if (!(pool->message_data = HeapAlloc( GetProcessHeap(), 0, size ))) + { + ERR( "Failed to allocate memory for networking messages\n" ); + return false; + } + + for (i = 0, ptr = pool->message_data; i < count; i++) + { + *pool->messages[i].p_data = ptr; + ptr += *pool->messages[i].p_size; + } + + return true; +} + +static void W_STDCALL w_SteamNetworkingMessage_t_144_FreeData( w_SteamNetworkingMessage_t_144 *msg ) +{ + if (msg->m_pData) SecureZeroMemory( msg->m_pData, msg->m_cbSize ); +} + +static void W_STDCALL w_SteamNetworkingMessage_t_144_Release( w_SteamNetworkingMessage_t_144 *msg ) +{ + struct networking_message *message = CONTAINING_RECORD( msg, struct networking_message, w_msg_144 ); + + if (msg->m_pfnFreeData) msg->m_pfnFreeData( msg ); + SecureZeroMemory( msg, sizeof(*msg) ); + + networking_message_pool_release( message->pool ); +} + +static w_SteamNetworkingMessage_t_144 *networking_message_init_144( struct networking_message *message, + struct networking_message_pool *pool ) +{ + message->pool = pool; + message->p_data = &message->w_msg_144.m_pData; + message->p_size = &message->w_msg_144.m_cbSize; + message->w_msg_144.m_pfnFreeData = w_SteamNetworkingMessage_t_144_FreeData; + message->w_msg_144.m_pfnRelease = w_SteamNetworkingMessage_t_144_Release; + return &message->w_msg_144; +} + +static bool networking_message_pool_create_144( uint32_t count, w_SteamNetworkingMessage_t_144 **messages ) +{ + uint32_t size = offsetof( struct networking_message_pool, messages[count] ); + struct networking_message_pool *pool; + + if (!(pool = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size ))) + { + ERR( "Failed to allocate memory for networking messages\n" ); + return false; + } + pool->ref = count; + + while (count--) messages[count] = networking_message_init_144( &pool->messages[count], pool ); + return true; +} + +static bool networking_message_pool_receive_144( int32_t capacity, int32_t count, w_SteamNetworkingMessage_t_144 **messages ) +{ + struct networking_message_pool *pool = CONTAINING_RECORD( messages[0], struct networking_message, w_msg_144 )->pool; + int32_t i; + + for (i = count; i < capacity; i++) messages[i]->m_pfnRelease( messages[i] ); + + if (count > 0) + { + if (!networking_message_pool_alloc_data( count, pool )) return false; + unix_networking_messages_receive_144( count, messages ); + } + + return true; +} + +/* ISteamNetworkingSockets_SteamNetworkingSockets002 */ + +int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection( struct w_steam_iface *_this, + uint32_t hConn, w_SteamNetworkingMessage_t_144 **ppOutMessages, + int32_t nMaxMessages ) +{ + struct cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection_params params = + { + .linux_side = _this->u_iface, + .hConn = hConn, + .ppOutMessages = ppOutMessages, + .nMaxMessages = nMaxMessages, + }; + + TRACE( "%p\n", _this ); + + if (!networking_message_pool_create_144( nMaxMessages, params.ppOutMessages )) return 0; + cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection( ¶ms ); + if (!networking_message_pool_receive_144( nMaxMessages, params._ret, params.ppOutMessages )) return 0; + + return params._ret; +} + +int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket( struct w_steam_iface *_this, uint32_t hSocket, + w_SteamNetworkingMessage_t_144 **ppOutMessages, int32_t nMaxMessages ) +{ + struct cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket_params params = + { + .linux_side = _this->u_iface, + .hSocket = hSocket, + .ppOutMessages = ppOutMessages, + .nMaxMessages = nMaxMessages, + }; + + TRACE( "%p\n", _this ); + + if (!networking_message_pool_create_144( nMaxMessages, params.ppOutMessages )) return 0; + cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket( ¶ms ); + if (!networking_message_pool_receive_144( nMaxMessages, params._ret, params.ppOutMessages )) return 0; + + return params._ret; +} + +/* ISteamNetworkingSockets_SteamNetworkingSockets004 */ + +int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection( struct w_steam_iface *_this, + uint32_t hConn, w_SteamNetworkingMessage_t_144 **ppOutMessages, + int32_t nMaxMessages ) +{ + struct cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection_params params = + { + .linux_side = _this->u_iface, + .hConn = hConn, + .ppOutMessages = ppOutMessages, + .nMaxMessages = nMaxMessages, + }; + + TRACE( "%p\n", _this ); + + if (!networking_message_pool_create_144( nMaxMessages, params.ppOutMessages )) return 0; + cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection( ¶ms ); + if (!networking_message_pool_receive_144( nMaxMessages, params._ret, params.ppOutMessages )) return 0; + + return params._ret; +} + +int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket( struct w_steam_iface *_this, uint32_t hSocket, + w_SteamNetworkingMessage_t_144 **ppOutMessages, int32_t nMaxMessages ) +{ + struct cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket_params params = + { + .linux_side = _this->u_iface, + .hSocket = hSocket, + .ppOutMessages = ppOutMessages, + .nMaxMessages = nMaxMessages, + }; + + TRACE( "%p\n", _this ); + + if (!networking_message_pool_create_144( nMaxMessages, params.ppOutMessages )) return 0; + cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket( ¶ms ); + if (!networking_message_pool_receive_144( nMaxMessages, params._ret, params.ppOutMessages )) return 0; + + return params._ret; +} + /* ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 */ void __thiscall winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort( struct w_steam_iface *_this ) diff --git a/lsteamclient/steamclient_manual_144.cpp b/lsteamclient/steamclient_manual_144.cpp deleted file mode 100644 index 816697df..00000000 --- a/lsteamclient/steamclient_manual_144.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "unix_private.h" - -extern "C" -{ -#define SDK_VERSION 1440 -#include "steamclient_manual_common.h" -} - -#include "cppISteamNetworkingSockets_SteamNetworkingSockets002.hpp" - -void cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection_params *params ) -{ - struct u_ISteamNetworkingSockets_SteamNetworkingSockets002 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets002 *)params->linux_side; - u_SteamNetworkingMessage_t_144 *u_ppOutMessages[params->nMaxMessages]; - params->_ret = iface->ReceiveMessagesOnConnection( params->hConn, u_ppOutMessages, params->nMaxMessages ); - lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, u_ppOutMessages, - params->ppOutMessages, params->nMaxMessages ); -} - -void cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket( struct cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket_params *params ) -{ - struct u_ISteamNetworkingSockets_SteamNetworkingSockets002 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets002 *)params->linux_side; - u_SteamNetworkingMessage_t_144 *u_ppOutMessages[params->nMaxMessages]; - params->_ret = iface->ReceiveMessagesOnListenSocket( params->hSocket, u_ppOutMessages, params->nMaxMessages ); - lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, u_ppOutMessages, - params->ppOutMessages, params->nMaxMessages ); -} diff --git a/lsteamclient/steamclient_manual_146.cpp b/lsteamclient/steamclient_manual_146.cpp deleted file mode 100644 index 29da0fb9..00000000 --- a/lsteamclient/steamclient_manual_146.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "unix_private.h" - -extern "C" -{ -#define SDK_VERSION 1460 -#include "steamclient_manual_common.h" -} - -#include "cppISteamNetworkingSockets_SteamNetworkingSockets004.hpp" - -void cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection_params *params ) -{ - struct u_ISteamNetworkingSockets_SteamNetworkingSockets004 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets004 *)params->linux_side; - u_SteamNetworkingMessage_t_144 *u_ppOutMessages[params->nMaxMessages]; - params->_ret = iface->ReceiveMessagesOnConnection( params->hConn, u_ppOutMessages, params->nMaxMessages ); - lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, u_ppOutMessages, - params->ppOutMessages, params->nMaxMessages ); -} - -void cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket( struct cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket_params *params ) -{ - struct u_ISteamNetworkingSockets_SteamNetworkingSockets004 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets004 *)params->linux_side; - u_SteamNetworkingMessage_t_144 *u_ppOutMessages[params->nMaxMessages]; - params->_ret = iface->ReceiveMessagesOnListenSocket( params->hSocket, u_ppOutMessages, params->nMaxMessages ); - lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, u_ppOutMessages, - params->ppOutMessages, params->nMaxMessages ); -} diff --git a/lsteamclient/unix_steam_networking_manual.cpp b/lsteamclient/unix_steam_networking_manual.cpp new file mode 100644 index 00000000..ead5eade --- /dev/null +++ b/lsteamclient/unix_steam_networking_manual.cpp @@ -0,0 +1,78 @@ +#include "steamclient_structs.h" + +#include "cppISteamNetworkingSockets_SteamNetworkingSockets002.hpp" +#include "cppISteamNetworkingSockets_SteamNetworkingSockets004.hpp" + +static void receive_messages_utow_144( uint32_t count, u_SteamNetworkingMessage_t_144 **u_msgs, + w_SteamNetworkingMessage_t_144 **w_msgs ) +{ + uint32_t i; + + for (i = 0; i < count; i++) + { + struct networking_message *message = CONTAINING_RECORD( w_msgs[i], struct networking_message, w_msg_144 ); + w_SteamNetworkingMessage_t_144 *w_msg = &message->w_msg_144; + u_SteamNetworkingMessage_t_144 *u_msg = u_msgs[i]; + message->u_msg_144 = u_msg; + + w_msg->m_cbSize = u_msg->m_cbSize; + w_msg->m_conn = u_msg->m_conn; + w_msg->m_sender = u_msg->m_sender; + w_msg->m_nConnUserData = u_msg->m_nConnUserData; + w_msg->m_usecTimeReceived = u_msg->m_usecTimeReceived; + w_msg->m_nMessageNumber = u_msg->m_nMessageNumber; + w_msg->m_nChannel = u_msg->m_nChannel; + } +} + +void unix_networking_messages_receive_144( uint32_t count, w_SteamNetworkingMessage_t_144 **w_msgs ) +{ + uint32_t i; + + for (i = 0; i < count; i++) + { + struct networking_message *message = CONTAINING_RECORD( w_msgs[i], struct networking_message, w_msg_144 ); + w_SteamNetworkingMessage_t_144 *w_msg = &message->w_msg_144; + u_SteamNetworkingMessage_t_144 *u_msg = message->u_msg_144; + + memcpy( w_msg->m_pData, u_msg->m_pData, u_msg->m_cbSize ); + u_msg->m_pfnRelease( u_msg ); + message->u_msg_144 = NULL; + } +} + +/* ISteamNetworkingSockets_SteamNetworkingSockets002 */ + +void cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection_params *params ) +{ + struct u_ISteamNetworkingSockets_SteamNetworkingSockets002 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets002 *)params->linux_side; + u_SteamNetworkingMessage_t_144 *u_msgs[params->nMaxMessages]; + params->_ret = iface->ReceiveMessagesOnConnection( params->hConn, u_msgs, params->nMaxMessages ); + if (params->_ret > 0) receive_messages_utow_144( params->_ret, u_msgs, params->ppOutMessages ); +} + +void cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket( struct cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket_params *params ) +{ + struct u_ISteamNetworkingSockets_SteamNetworkingSockets002 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets002 *)params->linux_side; + u_SteamNetworkingMessage_t_144 *u_msgs[params->nMaxMessages]; + params->_ret = iface->ReceiveMessagesOnListenSocket( params->hSocket, u_msgs, params->nMaxMessages ); + if (params->_ret > 0) receive_messages_utow_144( params->_ret, u_msgs, params->ppOutMessages ); +} + +/* ISteamNetworkingSockets_SteamNetworkingSockets004 */ + +void cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection_params *params ) +{ + struct u_ISteamNetworkingSockets_SteamNetworkingSockets004 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets004 *)params->linux_side; + u_SteamNetworkingMessage_t_144 *u_msgs[params->nMaxMessages]; + params->_ret = iface->ReceiveMessagesOnConnection( params->hConn, u_msgs, params->nMaxMessages ); + if (params->_ret > 0) receive_messages_utow_144( params->_ret, u_msgs, params->ppOutMessages ); +} + +void cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket( struct cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket_params *params ) +{ + struct u_ISteamNetworkingSockets_SteamNetworkingSockets004 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets004 *)params->linux_side; + u_SteamNetworkingMessage_t_144 *u_msgs[params->nMaxMessages]; + params->_ret = iface->ReceiveMessagesOnListenSocket( params->hSocket, u_msgs, params->nMaxMessages ); + if (params->_ret > 0) receive_messages_utow_144( params->_ret, u_msgs, params->ppOutMessages ); +} diff --git a/lsteamclient/unixlib.h b/lsteamclient/unixlib.h index 600d9122..f839c00a 100644 --- a/lsteamclient/unixlib.h +++ b/lsteamclient/unixlib.h @@ -9,6 +9,10 @@ #include #include +#ifndef STEAM_API_H +#include "steamclient_structs.h" +#endif + #ifdef __cplusplus extern "C" { @@ -62,6 +66,21 @@ struct callback_data void execute_callback(struct callback_data *cb_data); bool is_native_thread(void); +#ifndef STEAM_API_H +struct networking_message_pool; +struct networking_message +{ + struct networking_message_pool *pool; + void **p_data; + uint32_t *p_size; + + u_SteamNetworkingMessage_t_144 *u_msg_144; + w_SteamNetworkingMessage_t_144 w_msg_144; +}; + +extern void unix_networking_messages_receive_144( uint32_t count, w_SteamNetworkingMessage_t_144 **w_msgs ); +#endif + #ifdef __cplusplus } /* extern "C" */ #endif /* __cplusplus */ diff --git a/lsteamclient/winISteamNetworkingSockets.c b/lsteamclient/winISteamNetworkingSockets.c index b7552aca..e9fb6dca 100644 --- a/lsteamclient/winISteamNetworkingSockets.c +++ b/lsteamclient/winISteamNetworkingSockets.c @@ -201,34 +201,6 @@ uint32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets002_FlushMe return params._ret; } -int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection(struct w_steam_iface *_this, uint32_t hConn, w_SteamNetworkingMessage_t_144 **ppOutMessages, int32_t nMaxMessages) -{ - struct cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection_params params = - { - .linux_side = _this->u_iface, - .hConn = hConn, - .ppOutMessages = ppOutMessages, - .nMaxMessages = nMaxMessages, - }; - TRACE("%p\n", _this); - cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection( ¶ms ); - return params._ret; -} - -int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket(struct w_steam_iface *_this, uint32_t hSocket, w_SteamNetworkingMessage_t_144 **ppOutMessages, int32_t nMaxMessages) -{ - struct cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket_params params = - { - .linux_side = _this->u_iface, - .hSocket = hSocket, - .ppOutMessages = ppOutMessages, - .nMaxMessages = nMaxMessages, - }; - TRACE("%p\n", _this); - cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket( ¶ms ); - return params._ret; -} - bool __thiscall winISteamNetworkingSockets_SteamNetworkingSockets002_GetConnectionInfo(struct w_steam_iface *_this, uint32_t hConn, SteamNetConnectionInfo_t_144 *pInfo) { struct cppISteamNetworkingSockets_SteamNetworkingSockets002_GetConnectionInfo_params params = @@ -650,34 +622,6 @@ uint32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets004_FlushMe return params._ret; } -int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection(struct w_steam_iface *_this, uint32_t hConn, w_SteamNetworkingMessage_t_144 **ppOutMessages, int32_t nMaxMessages) -{ - struct cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection_params params = - { - .linux_side = _this->u_iface, - .hConn = hConn, - .ppOutMessages = ppOutMessages, - .nMaxMessages = nMaxMessages, - }; - TRACE("%p\n", _this); - cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection( ¶ms ); - return params._ret; -} - -int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket(struct w_steam_iface *_this, uint32_t hSocket, w_SteamNetworkingMessage_t_144 **ppOutMessages, int32_t nMaxMessages) -{ - struct cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket_params params = - { - .linux_side = _this->u_iface, - .hSocket = hSocket, - .ppOutMessages = ppOutMessages, - .nMaxMessages = nMaxMessages, - }; - TRACE("%p\n", _this); - cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket( ¶ms ); - return params._ret; -} - bool __thiscall winISteamNetworkingSockets_SteamNetworkingSockets004_GetConnectionInfo(struct w_steam_iface *_this, uint32_t hConn, SteamNetConnectionInfo_t_144 *pInfo) { struct cppISteamNetworkingSockets_SteamNetworkingSockets004_GetConnectionInfo_params params =