From 05f84c8595bc3593bf30c36022f7ee08e908c374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Mon, 2 Oct 2023 14:50:49 +0200 Subject: [PATCH] lsteamclient: Rewrite SteamNetworkingMessage_t_153a unix thunks. CW-Bug-Id: #22729 --- lsteamclient/Makefile.in | 2 - lsteamclient/gen_wrapper.py | 14 +- lsteamclient/steam_networking_manual.c | 201 +++++++++++++++++ lsteamclient/steamclient_manual_150.cpp | 18 -- lsteamclient/steamclient_manual_153a.cpp | 158 ------------- lsteamclient/unix_steam_networking_manual.cpp | 209 ++++++++++++++++++ lsteamclient/unixlib.h | 4 + lsteamclient/winISteamNetworkingFakeUDPPort.c | 13 -- lsteamclient/winISteamNetworkingMessages.c | 14 -- lsteamclient/winISteamNetworkingSockets.c | 41 ---- lsteamclient/winISteamNetworkingUtils.c | 12 - 11 files changed, 421 insertions(+), 265 deletions(-) delete mode 100644 lsteamclient/steamclient_manual_150.cpp delete mode 100644 lsteamclient/steamclient_manual_153a.cpp diff --git a/lsteamclient/Makefile.in b/lsteamclient/Makefile.in index 67a187ea..adc5f95c 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_150.cpp \ - steamclient_manual_153a.cpp \ steamclient_manual_common.cpp \ struct_converters_111x.cpp \ struct_converters_112.cpp \ diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index 798b358d..1e7d4a8e 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -204,15 +204,15 @@ 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' or ver <= 9, - "ISteamNetworkingSockets_ReceiveMessagesOnListenSocket": lambda ver, abi: abi == 'u' or ver <= 9, - "ISteamNetworkingSockets_ReceiveMessagesOnPollGroup": lambda ver, abi: abi == 'u' or ver <= 9, - "ISteamNetworkingSockets_SendMessages": lambda ver, abi: abi == 'u' or ver <= 9, + "ISteamNetworkingSockets_ReceiveMessagesOnConnection": True, + "ISteamNetworkingSockets_ReceiveMessagesOnListenSocket": True, + "ISteamNetworkingSockets_ReceiveMessagesOnPollGroup": True, + "ISteamNetworkingSockets_SendMessages": True, - "ISteamNetworkingUtils_AllocateMessage": lambda ver, abi: abi == 'u' or ver <= 3, + "ISteamNetworkingUtils_AllocateMessage": True, "ISteamNetworkingUtils_SetConfigValue": lambda ver, abi: abi == 'u' and ver >= 3, - "ISteamNetworkingMessages_ReceiveMessagesOnChannel": lambda ver, abi: abi == 'u', + "ISteamNetworkingMessages_ReceiveMessagesOnChannel": True, "ISteamInput_EnableActionEventCallbacks": lambda ver, abi: abi == 'u', "ISteamInput_GetGlyphForActionOrigin": True, @@ -225,7 +225,7 @@ MANUAL_METHODS = { "ISteamController_GetGlyphForXboxOrigin": True, "ISteamNetworkingFakeUDPPort_DestroyFakeUDPPort": lambda ver, abi: abi == 'w', - "ISteamNetworkingFakeUDPPort_ReceiveMessages": lambda ver, abi: abi == 'u', + "ISteamNetworkingFakeUDPPort_ReceiveMessages": True, "ISteamClient_BShutdownIfAllPipesClosed": lambda ver, abi: abi == 'w', "ISteamClient_CreateSteamPipe": lambda ver, abi: abi == 'w', diff --git a/lsteamclient/steam_networking_manual.c b/lsteamclient/steam_networking_manual.c index 57b2da21..46386298 100644 --- a/lsteamclient/steam_networking_manual.c +++ b/lsteamclient/steam_networking_manual.c @@ -1,12 +1,15 @@ #include "steamclient_private.h" #include "cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.h" +#include "cppISteamNetworkingMessages_SteamNetworkingMessages002.h" #include "cppISteamNetworkingSockets_SteamNetworkingSockets002.h" #include "cppISteamNetworkingSockets_SteamNetworkingSockets004.h" #include "cppISteamNetworkingSockets_SteamNetworkingSockets006.h" #include "cppISteamNetworkingSockets_SteamNetworkingSockets008.h" #include "cppISteamNetworkingSockets_SteamNetworkingSockets009.h" +#include "cppISteamNetworkingSockets_SteamNetworkingSockets012.h" #include "cppISteamNetworkingUtils_SteamNetworkingUtils003.h" +#include "cppISteamNetworkingUtils_SteamNetworkingUtils004.h" WINE_DEFAULT_DEBUG_CHANNEL(steamclient); @@ -173,6 +176,72 @@ static bool networking_message_pool_receive_147( uint32_t capacity, uint32_t cou return true; } +static void W_STDCALL w_SteamNetworkingMessage_t_153a_FreeData( w_SteamNetworkingMessage_t_153a *msg ) +{ + struct networking_message *message = CONTAINING_RECORD( msg, struct networking_message, w_msg_153a ); + + if (msg->m_pData) SecureZeroMemory( msg->m_pData, msg->m_cbSize ); + if (!message->pool) HeapFree( GetProcessHeap(), 0, msg->m_pData ); +} + +static void W_STDCALL w_SteamNetworkingMessage_t_153a_Release( w_SteamNetworkingMessage_t_153a *msg ) +{ + struct networking_message *message = CONTAINING_RECORD( msg, struct networking_message, w_msg_153a ); + + if (msg->m_pfnFreeData) msg->m_pfnFreeData( msg ); + SecureZeroMemory( msg, sizeof(*msg) ); + + if (message->pool) networking_message_pool_release( message->pool ); + else + { + unix_networking_message_release_153a( msg ); + HeapFree( GetProcessHeap(), 0, message ); + } +} + +static w_SteamNetworkingMessage_t_153a *networking_message_init_153a( struct networking_message *message, + struct networking_message_pool *pool ) +{ + message->pool = pool; + message->p_data = &message->w_msg_153a.m_pData; + message->p_size = (uint32_t *)&message->w_msg_153a.m_cbSize; + message->w_msg_153a.m_pfnFreeData = w_SteamNetworkingMessage_t_153a_FreeData; + message->w_msg_153a.m_pfnRelease = w_SteamNetworkingMessage_t_153a_Release; + return &message->w_msg_153a; +} + +static bool networking_message_pool_create_153a( uint32_t count, w_SteamNetworkingMessage_t_153a **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_153a( &pool->messages[count], pool ); + return true; +} + +static bool networking_message_pool_receive_153a( uint32_t capacity, uint32_t count, w_SteamNetworkingMessage_t_153a **messages ) +{ + struct networking_message_pool *pool = CONTAINING_RECORD( messages[0], struct networking_message, w_msg_153a )->pool; + uint32_t i; + + for (i = count; i < capacity; i++) messages[i]->m_pfnRelease( messages[i] ); + + if (count) + { + if (!networking_message_pool_alloc_data( count, pool )) return false; + unix_networking_messages_receive_153a( count, messages ); + } + + return true; +} + /* ISteamNetworkingSockets_SteamNetworkingSockets002 */ int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection( struct w_steam_iface *_this, @@ -479,3 +548,135 @@ void __thiscall winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_Des cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort( ¶ms ); HeapFree( GetProcessHeap(), 0, _this ); } + +int32_t __thiscall winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages( struct w_steam_iface *_this, + w_SteamNetworkingMessage_t_153a **ppOutMessages, + int32_t nMaxMessages ) +{ + struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages_params params = + { + .linux_side = _this->u_iface, + .ppOutMessages = ppOutMessages, + .nMaxMessages = nMaxMessages, + }; + + TRACE( "%p\n", _this ); + + if (!networking_message_pool_create_153a( nMaxMessages, params.ppOutMessages )) return 0; + cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages( ¶ms ); + if (!networking_message_pool_receive_153a( nMaxMessages, params._ret, params.ppOutMessages )) return 0; + + return params._ret; +} + +/* ISteamNetworkingMessages_SteamNetworkingMessages002 */ + +int32_t __thiscall winISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel( struct w_steam_iface *_this, int32_t nLocalChannel, + w_SteamNetworkingMessage_t_153a **ppOutMessages, + int32_t nMaxMessages ) +{ + struct cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel_params params = + { + .linux_side = _this->u_iface, + .nLocalChannel = nLocalChannel, + .ppOutMessages = ppOutMessages, + .nMaxMessages = nMaxMessages, + }; + + TRACE( "%p\n", _this ); + + if (!networking_message_pool_create_153a( nMaxMessages, params.ppOutMessages )) return 0; + cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel( ¶ms ); + if (!networking_message_pool_receive_153a( nMaxMessages, params._ret, params.ppOutMessages )) return 0; + + return params._ret; +} + +/* ISteamNetworkingSockets_SteamNetworkingSockets012 */ + +int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection( struct w_steam_iface *_this, + uint32_t hConn, w_SteamNetworkingMessage_t_153a **ppOutMessages, + int32_t nMaxMessages ) +{ + struct cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection_params params = + { + .linux_side = _this->u_iface, + .hConn = hConn, + .ppOutMessages = ppOutMessages, + .nMaxMessages = nMaxMessages, + }; + + TRACE( "%p\n", _this ); + + if (!networking_message_pool_create_153a( nMaxMessages, params.ppOutMessages )) return 0; + cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection( ¶ms ); + if (!networking_message_pool_receive_153a( nMaxMessages, params._ret, params.ppOutMessages )) return 0; + + return params._ret; +} + +int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup( struct w_steam_iface *_this, uint32_t hPollGroup, + w_SteamNetworkingMessage_t_153a **ppOutMessages, + int32_t nMaxMessages ) +{ + struct cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup_params params = + { + .linux_side = _this->u_iface, + .hPollGroup = hPollGroup, + .ppOutMessages = ppOutMessages, + .nMaxMessages = nMaxMessages, + }; + + TRACE( "%p\n", _this ); + + if (!networking_message_pool_create_153a( nMaxMessages, params.ppOutMessages )) return 0; + cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup( ¶ms ); + if (!networking_message_pool_receive_153a( nMaxMessages, params._ret, params.ppOutMessages )) return 0; + + return params._ret; +} + +/* ISteamNetworkingUtils_SteamNetworkingUtils004 */ + +void __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages(struct w_steam_iface *_this, int32_t nMessages, w_SteamNetworkingMessage_t_153a *const *pMessages, int64_t *pOutMessageNumberOrResult) +{ + struct cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages_params params = + { + .linux_side = _this->u_iface, + .nMessages = nMessages, + .pMessages = pMessages, + .pOutMessageNumberOrResult = pOutMessageNumberOrResult, + }; + int64_t i; + + TRACE("%p\n", _this); + + cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages( ¶ms ); + for (i = 0; i < nMessages; i++) pMessages[i]->m_pfnRelease( pMessages[i] ); +} + +w_SteamNetworkingMessage_t_153a *__thiscall winISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage( struct w_steam_iface *_this, int32_t cbAllocateBuffer ) +{ + struct cppISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage_params params = + { + .linux_side = _this->u_iface, + .cbAllocateBuffer = cbAllocateBuffer, + }; + struct networking_message *message; + + TRACE( "%p\n", _this ); + + if (!(message = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*message) ))) return NULL; + if ((message->w_msg_153a.m_cbSize = cbAllocateBuffer) && + !(message->w_msg_153a.m_pData = HeapAlloc( GetProcessHeap(), 0, cbAllocateBuffer ))) + { + HeapFree( GetProcessHeap(), 0, message ); + return NULL; + } + message->w_msg_153a.m_pfnFreeData = w_SteamNetworkingMessage_t_153a_FreeData; + message->w_msg_153a.m_pfnRelease = w_SteamNetworkingMessage_t_153a_Release; + params._ret = &message->w_msg_153a; + + cppISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage( ¶ms ); + return params._ret; +} diff --git a/lsteamclient/steamclient_manual_150.cpp b/lsteamclient/steamclient_manual_150.cpp deleted file mode 100644 index 72299ed6..00000000 --- a/lsteamclient/steamclient_manual_150.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "unix_private.h" - -extern "C" { -#define SDKVER_157 -#define SDK_VERSION 1500 -#include "steamclient_manual_common.h" -} - -#include "cppISteamNetworkingMessages_SteamNetworkingMessages002.hpp" - -void cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel( struct cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel_params *params ) -{ - struct u_ISteamNetworkingMessages_SteamNetworkingMessages002 *iface = (struct u_ISteamNetworkingMessages_SteamNetworkingMessages002 *)params->linux_side; - u_SteamNetworkingMessage_t_153a *u_ppOutMessages[params->nMaxMessages]; - params->_ret = iface->ReceiveMessagesOnChannel( params->nLocalChannel, u_ppOutMessages, params->nMaxMessages ); - lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, u_ppOutMessages, - params->ppOutMessages, params->nMaxMessages ); -} diff --git a/lsteamclient/steamclient_manual_153a.cpp b/lsteamclient/steamclient_manual_153a.cpp deleted file mode 100644 index 370265d0..00000000 --- a/lsteamclient/steamclient_manual_153a.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include "unix_private.h" - -extern "C" { -#include "win_constructors.h" - -#define SDK_VERSION 1531 -#include "steamclient_manual_common.h" -} - -#include "cppISteamNetworkingUtils_SteamNetworkingUtils004.hpp" -#include "cppISteamNetworkingSockets_SteamNetworkingSockets012.hpp" -#include "cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.hpp" - -WINE_DEFAULT_DEBUG_CHANNEL(steamclient); - -void cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection_params *params ) -{ - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; - u_SteamNetworkingMessage_t_153a *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_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup_params *params ) -{ - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; - u_SteamNetworkingMessage_t_153a *u_ppOutMessages[params->nMaxMessages]; - params->_ret = iface->ReceiveMessagesOnPollGroup( params->hPollGroup, u_ppOutMessages, params->nMaxMessages ); - lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, u_ppOutMessages, - params->ppOutMessages, params->nMaxMessages ); -} - -void cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages_params *params ) -{ -#define MAX_SEND_MESSAGES 64 - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; - /* use the stack to avoid heap allocation */ - u_SteamNetworkingMessage_t_153a *u_msgs[MAX_SEND_MESSAGES]; - int i; - - if (params->nMessages > MAX_SEND_MESSAGES) - { - /* if we ever hit this, increase MAX_SEND_MESSAGES appropriately */ - FIXME( "Trying to send %u messages, which is more than %u! Will break up into pieces.\n", - params->nMessages, MAX_SEND_MESSAGES ); - } - - while (params->nMessages) - { - for (i = 0; i < params->nMessages && i < MAX_SEND_MESSAGES; ++i) - u_msgs[i] = (u_SteamNetworkingMessage_t_153a *)network_message_win_to_lin( params->pMessages[i] ); - - iface->SendMessages( i, u_msgs, params->pOutMessageNumberOrResult ); - - params->nMessages -= i; - params->pMessages += i; - if (params->pOutMessageNumberOrResult) params->pOutMessageNumberOrResult += i; - } -} - -void cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages( struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages_params *params ) -{ - struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *iface = (struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *)params->linux_side; - u_SteamNetworkingMessage_t_153a *u_ppOutMessages[params->nMaxMessages]; - params->_ret = iface->ReceiveMessages( u_ppOutMessages, params->nMaxMessages ); - lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, u_ppOutMessages, - params->ppOutMessages, params->nMaxMessages ); -} - -typedef void (*CDECL win_FnSteamNetConnectionStatusChanged)( w_SteamNetConnectionStatusChangedCallback_t_153a * ); -static win_FnSteamNetConnectionStatusChanged win_SteamNetConnectionStatusChanged; -static void lin_SteamNetConnectionStatusChanged( u_SteamNetConnectionStatusChangedCallback_t_153a *u_dat ) -{ - win_FnSteamNetConnectionStatusChanged fn = win_SteamNetConnectionStatusChanged; - if (fn) - { - w_SteamNetConnectionStatusChangedCallback_t_153a w_dat = *u_dat; - fn(&w_dat); - } -} - -typedef void (*CDECL win_FnSteamNetAuthenticationStatusChanged)( SteamNetAuthenticationStatus_t * ); -static win_FnSteamNetAuthenticationStatusChanged win_SteamNetAuthenticationStatusChanged; -static void lin_SteamNetAuthenticationStatusChanged( SteamNetAuthenticationStatus_t *dat ) -{ - win_FnSteamNetAuthenticationStatusChanged fn = win_SteamNetAuthenticationStatusChanged; - if (fn) fn( dat ); -} - -typedef void (*CDECL win_FnSteamRelayNetworkStatusChanged)( SteamRelayNetworkStatus_t * ); -static win_FnSteamRelayNetworkStatusChanged win_SteamRelayNetworkStatusChanged; -static void lin_SteamRelayNetworkStatusChanged( SteamRelayNetworkStatus_t *dat ) -{ - win_FnSteamRelayNetworkStatusChanged fn = win_SteamRelayNetworkStatusChanged; - if (fn) fn( dat ); -} - -typedef void (*CDECL win_FnSteamNetworkingMessagesSessionRequest)( SteamNetworkingMessagesSessionRequest_t_151 * ); -static win_FnSteamNetworkingMessagesSessionRequest win_SteamNetworkingMessagesSessionRequest; -static void lin_SteamNetworkingMessagesSessionRequest( SteamNetworkingMessagesSessionRequest_t_151 *dat ) -{ - win_FnSteamNetworkingMessagesSessionRequest fn = win_SteamNetworkingMessagesSessionRequest; - if (fn) fn( dat ); -} - -typedef void (*CDECL win_FnSteamNetworkingMessagesSessionFailed)( SteamNetworkingMessagesSessionFailed_t_153a * ); -static win_FnSteamNetworkingMessagesSessionFailed win_SteamNetworkingMessagesSessionFailed; -static void lin_SteamNetworkingMessagesSessionFailed( SteamNetworkingMessagesSessionFailed_t_153a *dat ) -{ - win_FnSteamNetworkingMessagesSessionFailed fn = win_SteamNetworkingMessagesSessionFailed; - if (fn) fn( dat ); -} - -void cppISteamNetworkingUtils_SteamNetworkingUtils004_SetConfigValue( struct cppISteamNetworkingUtils_SteamNetworkingUtils004_SetConfigValue_params *params ) -{ - struct u_ISteamNetworkingUtils_SteamNetworkingUtils004 *iface = (struct u_ISteamNetworkingUtils_SteamNetworkingUtils004 *)params->linux_side; - bool ret; - void *lin_fn; /* api requires passing pointer-to-pointer */ - - switch (params->eValue) - { - -#define CASE( y ) \ - if (!params->pArg) \ - { \ - params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, \ - params->scopeObj, params->eDataType, NULL ); \ - } \ - else \ - { \ - if (*(void **)params->pArg == NULL) lin_fn = NULL; \ - else lin_fn = (void *)&lin_##y; \ - params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, \ - params->scopeObj, params->eDataType, &lin_fn ); \ - if (params->_ret) win_##y = *(win_Fn##y *)params->pArg; \ - } - - case 201 /*ConnectionStatusChanged*/: CASE( SteamNetConnectionStatusChanged ) - case 202 /*AuthStatusChanged*/: CASE( SteamNetAuthenticationStatusChanged ) - case 203 /*RelayNetworkStatusChanged*/: CASE( SteamRelayNetworkStatusChanged ) - case 204 /*MessagesSessionRequest*/: CASE( SteamNetworkingMessagesSessionRequest ) - case 205 /*MessagesSessionFailed*/: CASE( SteamNetworkingMessagesSessionFailed ) - -#undef CASE - - default: - params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, params->scopeObj, - params->eDataType, params->pArg ); - } -} - -void cppISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage( struct cppISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage_params *params ) -{ - struct u_ISteamNetworkingUtils_SteamNetworkingUtils004 *iface = (struct u_ISteamNetworkingUtils_SteamNetworkingUtils004 *)params->linux_side; - u_SteamNetworkingMessage_t_153a *u_ret = iface->AllocateMessage( params->cbAllocateBuffer ); - params->_ret = (w_SteamNetworkingMessage_t_153a *)network_message_lin_to_win( u_ret ); -} diff --git a/lsteamclient/unix_steam_networking_manual.cpp b/lsteamclient/unix_steam_networking_manual.cpp index 56ddf37f..2d5b5ff9 100644 --- a/lsteamclient/unix_steam_networking_manual.cpp +++ b/lsteamclient/unix_steam_networking_manual.cpp @@ -2,12 +2,16 @@ #include +#include "cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.hpp" +#include "cppISteamNetworkingMessages_SteamNetworkingMessages002.hpp" #include "cppISteamNetworkingSockets_SteamNetworkingSockets002.hpp" #include "cppISteamNetworkingSockets_SteamNetworkingSockets004.hpp" #include "cppISteamNetworkingSockets_SteamNetworkingSockets006.hpp" #include "cppISteamNetworkingSockets_SteamNetworkingSockets008.hpp" #include "cppISteamNetworkingSockets_SteamNetworkingSockets009.hpp" +#include "cppISteamNetworkingSockets_SteamNetworkingSockets012.hpp" #include "cppISteamNetworkingUtils_SteamNetworkingUtils003.hpp" +#include "cppISteamNetworkingUtils_SteamNetworkingUtils004.hpp" static void receive_messages_utow_144( uint32_t count, u_SteamNetworkingMessage_t_144 **u_msgs, w_SteamNetworkingMessage_t_144 **w_msgs ) @@ -339,3 +343,208 @@ void cppISteamNetworkingUtils_SteamNetworkingUtils003_SetConfigValue( struct cpp params->eDataType, params->pArg ); } } + +static void receive_messages_utow_153a( uint32_t count, u_SteamNetworkingMessage_t_153a **u_msgs, + w_SteamNetworkingMessage_t_153a **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_153a ); + w_SteamNetworkingMessage_t_153a *w_msg = &message->w_msg_153a; + u_SteamNetworkingMessage_t_153a *u_msg = u_msgs[i]; + message->u_msg_153a = u_msg; + + w_msg->m_cbSize = u_msg->m_cbSize; + w_msg->m_conn = u_msg->m_conn; + w_msg->m_identityPeer = u_msg->m_identityPeer; + 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; + w_msg->m_nFlags = u_msg->m_nFlags; + w_msg->m_nUserData = u_msg->m_nUserData; + w_msg->m_idxLane = u_msg->m_idxLane; + } +} + +void unix_networking_messages_receive_153a( uint32_t count, w_SteamNetworkingMessage_t_153a **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_153a ); + w_SteamNetworkingMessage_t_153a *w_msg = &message->w_msg_153a; + u_SteamNetworkingMessage_t_153a *u_msg = message->u_msg_153a; + + memcpy( w_msg->m_pData, u_msg->m_pData, u_msg->m_cbSize ); + u_msg->m_pfnRelease( u_msg ); + message->u_msg_153a = NULL; + } +} + +static void U_STDCALL u_SteamNetworkingMessage_t_153a_FreeData( u_SteamNetworkingMessage_t_153a *msg ) +{ + free( msg->m_pData ); + msg->m_pData = NULL; +} + +static void send_messages_wtou_153a( uint32_t count, w_SteamNetworkingMessage_t_153a *const *w_msgs, + u_SteamNetworkingMessage_t_153a **u_msgs ) +{ + uint32_t i; + + for (i = 0; i < count; i++) + { + struct networking_message *message = CONTAINING_RECORD( w_msgs[i], struct networking_message, w_msg_153a ); + w_SteamNetworkingMessage_t_153a *w_msg = &message->w_msg_153a; + u_SteamNetworkingMessage_t_153a *u_msg = message->u_msg_153a; + + if (!u_msg->m_pData) + { + u_msg->m_pData = malloc( w_msg->m_cbSize ); + u_msg->m_pfnFreeData = u_SteamNetworkingMessage_t_153a_FreeData; + } + + memcpy( u_msg->m_pData, w_msg->m_pData, w_msg->m_cbSize ); + u_msg->m_cbSize = w_msg->m_cbSize; + u_msg->m_conn = w_msg->m_conn; + u_msg->m_identityPeer = w_msg->m_identityPeer; + u_msg->m_nConnUserData = w_msg->m_nConnUserData; + u_msg->m_usecTimeReceived = w_msg->m_usecTimeReceived; + u_msg->m_nMessageNumber = w_msg->m_nMessageNumber; + u_msg->m_nChannel = w_msg->m_nChannel; + u_msg->m_nFlags = w_msg->m_nFlags; + u_msg->m_nUserData = w_msg->m_nUserData; + u_msg->m_idxLane = w_msg->m_idxLane; + + /* steamclient library takes ownership */ + message->u_msg_153a = NULL; + u_msgs[i] = u_msg; + } +} + +void unix_networking_message_release_153a( w_SteamNetworkingMessage_t_153a *w_msg ) +{ + struct networking_message *message = CONTAINING_RECORD( w_msg, struct networking_message, w_msg_153a ); + u_SteamNetworkingMessage_t_153a *u_msg = message->u_msg_153a; + + if (!message->u_msg_153a) return; + u_msg->m_pfnRelease( u_msg ); + message->u_msg_153a = NULL; +} + +/* ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 */ + +void cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages( struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages_params *params ) +{ + struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *iface = (struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *)params->linux_side; + u_SteamNetworkingMessage_t_153a *u_msgs[params->nMaxMessages]; + params->_ret = iface->ReceiveMessages( u_msgs, params->nMaxMessages ); + if (params->_ret > 0) receive_messages_utow_153a( params->_ret, u_msgs, params->ppOutMessages ); +} + +/* ISteamNetworkingMessages_SteamNetworkingMessages002 */ + +void cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel( struct cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel_params *params ) +{ + struct u_ISteamNetworkingMessages_SteamNetworkingMessages002 *iface = (struct u_ISteamNetworkingMessages_SteamNetworkingMessages002 *)params->linux_side; + u_SteamNetworkingMessage_t_153a *u_msgs[params->nMaxMessages]; + params->_ret = iface->ReceiveMessagesOnChannel( params->nLocalChannel, u_msgs, params->nMaxMessages ); + if (params->_ret > 0) receive_messages_utow_153a( params->_ret, u_msgs, params->ppOutMessages ); +} + +/* ISteamNetworkingSockets_SteamNetworkingSockets012 */ + +void cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection_params *params ) +{ + struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; + u_SteamNetworkingMessage_t_153a *u_msgs[params->nMaxMessages]; + params->_ret = iface->ReceiveMessagesOnConnection( params->hConn, u_msgs, params->nMaxMessages ); + if (params->_ret > 0) receive_messages_utow_153a( params->_ret, u_msgs, params->ppOutMessages ); +} + +void cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup_params *params ) +{ + struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; + u_SteamNetworkingMessage_t_153a *u_msgs[params->nMaxMessages]; + params->_ret = iface->ReceiveMessagesOnPollGroup( params->hPollGroup, u_msgs, params->nMaxMessages ); + if (params->_ret > 0) receive_messages_utow_153a( params->_ret, u_msgs, params->ppOutMessages ); +} + +void cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages_params *params ) +{ + struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; + u_SteamNetworkingMessage_t_153a *u_msgs[params->nMessages]; + send_messages_wtou_153a( params->nMessages, params->pMessages, u_msgs ); + iface->SendMessages( params->nMessages, u_msgs, params->pOutMessageNumberOrResult ); +} + +/* ISteamNetworkingUtils_SteamNetworkingUtils004 */ + +void cppISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage( struct cppISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage_params *params ) +{ + struct u_ISteamNetworkingUtils_SteamNetworkingUtils004 *iface = (struct u_ISteamNetworkingUtils_SteamNetworkingUtils004 *)params->linux_side; + u_SteamNetworkingMessage_t_153a *u_msg = iface->AllocateMessage( params->cbAllocateBuffer ); + if (u_msg) receive_messages_utow_153a( 1, &u_msg, ¶ms->_ret ); +} + +typedef void (*CDECL win_FnSteamNetConnectionStatusChanged_153a)( w_SteamNetConnectionStatusChangedCallback_t_153a * ); +static win_FnSteamNetConnectionStatusChanged_153a win_SteamNetConnectionStatusChanged_153a; +static void lin_SteamNetConnectionStatusChanged_153a( u_SteamNetConnectionStatusChangedCallback_t_153a *u_dat ) +{ + win_FnSteamNetConnectionStatusChanged_153a fn = win_SteamNetConnectionStatusChanged_153a; + if (fn) + { + w_SteamNetConnectionStatusChangedCallback_t_153a w_dat = *u_dat; + fn( &w_dat ); + } +} + +typedef void (*CDECL win_FnSteamNetworkingMessagesSessionFailed_153a)( SteamNetworkingMessagesSessionFailed_t_153a * ); +static win_FnSteamNetworkingMessagesSessionFailed_153a win_SteamNetworkingMessagesSessionFailed_153a; +static void lin_SteamNetworkingMessagesSessionFailed_153a( SteamNetworkingMessagesSessionFailed_t_153a *dat ) +{ + win_FnSteamNetworkingMessagesSessionFailed_153a fn = win_SteamNetworkingMessagesSessionFailed_153a; + if (fn) fn( dat ); +} + +void cppISteamNetworkingUtils_SteamNetworkingUtils004_SetConfigValue( struct cppISteamNetworkingUtils_SteamNetworkingUtils004_SetConfigValue_params *params ) +{ + struct u_ISteamNetworkingUtils_SteamNetworkingUtils004 *iface = (struct u_ISteamNetworkingUtils_SteamNetworkingUtils004 *)params->linux_side; + bool ret; + void *lin_fn; /* api requires passing pointer-to-pointer */ + + switch (params->eValue) + { + +#define CASE( y ) \ + if (!params->pArg) \ + { \ + params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, \ + params->scopeObj, params->eDataType, NULL ); \ + } \ + else \ + { \ + if (*(void **)params->pArg == NULL) lin_fn = NULL; \ + else lin_fn = (void *)&lin_##y; \ + params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, \ + params->scopeObj, params->eDataType, &lin_fn ); \ + if (params->_ret) win_##y = *(win_Fn##y *)params->pArg; \ + } + + case 201 /*ConnectionStatusChanged*/: CASE( SteamNetConnectionStatusChanged_153a ) + case 202 /*AuthStatusChanged*/: CASE( SteamNetAuthenticationStatusChanged ) + case 203 /*RelayNetworkStatusChanged*/: CASE( SteamRelayNetworkStatusChanged ) + case 204 /*MessagesSessionRequest*/: CASE( SteamNetworkingMessagesSessionRequest ) + case 205 /*MessagesSessionFailed*/: CASE( SteamNetworkingMessagesSessionFailed_153a ) + +#undef CASE + + default: + params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, params->scopeObj, + params->eDataType, params->pArg ); + } +} diff --git a/lsteamclient/unixlib.h b/lsteamclient/unixlib.h index 1f3e7f22..3133e507 100644 --- a/lsteamclient/unixlib.h +++ b/lsteamclient/unixlib.h @@ -78,17 +78,21 @@ struct networking_message { u_SteamNetworkingMessage_t_144 *u_msg_144; u_SteamNetworkingMessage_t_147 *u_msg_147; + u_SteamNetworkingMessage_t_153a *u_msg_153a; }; union { w_SteamNetworkingMessage_t_144 w_msg_144; w_SteamNetworkingMessage_t_147 w_msg_147; + w_SteamNetworkingMessage_t_153a w_msg_153a; }; }; extern void unix_networking_messages_receive_144( uint32_t count, w_SteamNetworkingMessage_t_144 **w_msgs ); extern void unix_networking_messages_receive_147( uint32_t count, w_SteamNetworkingMessage_t_147 **w_msgs ); +extern void unix_networking_messages_receive_153a( uint32_t count, w_SteamNetworkingMessage_t_153a **w_msgs ); extern void unix_networking_message_release_147( w_SteamNetworkingMessage_t_147 *w_msg ); +extern void unix_networking_message_release_153a( w_SteamNetworkingMessage_t_153a *w_msg ); #endif #ifdef __cplusplus diff --git a/lsteamclient/winISteamNetworkingFakeUDPPort.c b/lsteamclient/winISteamNetworkingFakeUDPPort.c index 5b4df2fc..504462b4 100644 --- a/lsteamclient/winISteamNetworkingFakeUDPPort.c +++ b/lsteamclient/winISteamNetworkingFakeUDPPort.c @@ -25,19 +25,6 @@ uint32_t __thiscall winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 return params._ret; } -int32_t __thiscall winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages(struct w_steam_iface *_this, w_SteamNetworkingMessage_t_153a **ppOutMessages, int32_t nMaxMessages) -{ - struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages_params params = - { - .linux_side = _this->u_iface, - .ppOutMessages = ppOutMessages, - .nMaxMessages = nMaxMessages, - }; - TRACE("%p\n", _this); - cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages( ¶ms ); - return params._ret; -} - void __thiscall winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ScheduleCleanup(struct w_steam_iface *_this, const SteamNetworkingIPAddr *remoteAddress) { struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ScheduleCleanup_params params = diff --git a/lsteamclient/winISteamNetworkingMessages.c b/lsteamclient/winISteamNetworkingMessages.c index 7e746842..578f7d45 100644 --- a/lsteamclient/winISteamNetworkingMessages.c +++ b/lsteamclient/winISteamNetworkingMessages.c @@ -28,20 +28,6 @@ uint32_t __thiscall winISteamNetworkingMessages_SteamNetworkingMessages002_SendM return params._ret; } -int32_t __thiscall winISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel(struct w_steam_iface *_this, int32_t nLocalChannel, w_SteamNetworkingMessage_t_153a **ppOutMessages, int32_t nMaxMessages) -{ - struct cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel_params params = - { - .linux_side = _this->u_iface, - .nLocalChannel = nLocalChannel, - .ppOutMessages = ppOutMessages, - .nMaxMessages = nMaxMessages, - }; - TRACE("%p\n", _this); - cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel( ¶ms ); - return params._ret; -} - bool __thiscall winISteamNetworkingMessages_SteamNetworkingMessages002_AcceptSessionWithUser(struct w_steam_iface *_this, const SteamNetworkingIdentity_144 *identityRemote) { struct cppISteamNetworkingMessages_SteamNetworkingMessages002_AcceptSessionWithUser_params params = diff --git a/lsteamclient/winISteamNetworkingSockets.c b/lsteamclient/winISteamNetworkingSockets.c index 31255474..31c184e1 100644 --- a/lsteamclient/winISteamNetworkingSockets.c +++ b/lsteamclient/winISteamNetworkingSockets.c @@ -2784,19 +2784,6 @@ uint32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_SendMes return params._ret; } -void __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages(struct w_steam_iface *_this, int32_t nMessages, w_SteamNetworkingMessage_t_153a *const *pMessages, int64_t *pOutMessageNumberOrResult) -{ - struct cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages_params params = - { - .linux_side = _this->u_iface, - .nMessages = nMessages, - .pMessages = pMessages, - .pOutMessageNumberOrResult = pOutMessageNumberOrResult, - }; - TRACE("%p\n", _this); - cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages( ¶ms ); -} - uint32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_FlushMessagesOnConnection(struct w_steam_iface *_this, uint32_t hConn) { struct cppISteamNetworkingSockets_SteamNetworkingSockets012_FlushMessagesOnConnection_params params = @@ -2809,20 +2796,6 @@ uint32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_FlushMe return params._ret; } -int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection(struct w_steam_iface *_this, uint32_t hConn, w_SteamNetworkingMessage_t_153a **ppOutMessages, int32_t nMaxMessages) -{ - struct cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection_params params = - { - .linux_side = _this->u_iface, - .hConn = hConn, - .ppOutMessages = ppOutMessages, - .nMaxMessages = nMaxMessages, - }; - TRACE("%p\n", _this); - cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection( ¶ms ); - return params._ret; -} - bool __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_GetConnectionInfo(struct w_steam_iface *_this, uint32_t hConn, SteamNetConnectionInfo_t_153a *pInfo) { struct cppISteamNetworkingSockets_SteamNetworkingSockets012_GetConnectionInfo_params params = @@ -2980,20 +2953,6 @@ bool __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_SetConnecti return params._ret; } -int32_t __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup(struct w_steam_iface *_this, uint32_t hPollGroup, w_SteamNetworkingMessage_t_153a **ppOutMessages, int32_t nMaxMessages) -{ - struct cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup_params params = - { - .linux_side = _this->u_iface, - .hPollGroup = hPollGroup, - .ppOutMessages = ppOutMessages, - .nMaxMessages = nMaxMessages, - }; - TRACE("%p\n", _this); - cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup( ¶ms ); - return params._ret; -} - bool __thiscall winISteamNetworkingSockets_SteamNetworkingSockets012_ReceivedRelayAuthTicket(struct w_steam_iface *_this, const void *pvTicket, int32_t cbTicket, SteamDatagramRelayAuthTicket *pOutParsedTicket) { struct cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceivedRelayAuthTicket_params params = diff --git a/lsteamclient/winISteamNetworkingUtils.c b/lsteamclient/winISteamNetworkingUtils.c index a9364834..460cfa5c 100644 --- a/lsteamclient/winISteamNetworkingUtils.c +++ b/lsteamclient/winISteamNetworkingUtils.c @@ -1059,18 +1059,6 @@ DEFINE_THISCALL_WRAPPER(winISteamNetworkingUtils_SteamNetworkingUtils004_SteamNe DEFINE_THISCALL_WRAPPER(winISteamNetworkingUtils_SteamNetworkingUtils004_SteamNetworkingIdentity_ParseString, 12) DEFINE_THISCALL_WRAPPER(winISteamNetworkingUtils_SteamNetworkingUtils004_destructor, 4) -w_SteamNetworkingMessage_t_153a * __thiscall winISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage(struct w_steam_iface *_this, int32_t cbAllocateBuffer) -{ - struct cppISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage_params params = - { - .linux_side = _this->u_iface, - .cbAllocateBuffer = cbAllocateBuffer, - }; - TRACE("%p\n", _this); - cppISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage( ¶ms ); - return params._ret; -} - uint32_t __thiscall winISteamNetworkingUtils_SteamNetworkingUtils004_GetRelayNetworkStatus(struct w_steam_iface *_this, SteamRelayNetworkStatus_t *pDetails) { struct cppISteamNetworkingUtils_SteamNetworkingUtils004_GetRelayNetworkStatus_params params =