From 0e7edfb0194acbe40b929aa41e49d72e350f5b06 Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Fri, 13 Jun 2025 17:11:36 -0600 Subject: [PATCH] lsteamclient: Make functions which take array of SteamNetworkingConfigValue_t manual. CW-Bug-Id: #25554 --- ...rkingSockets_SteamNetworkingSockets012.cpp | 144 ------------------ lsteamclient/gen_wrapper.py | 9 +- lsteamclient/unix_steam_networking_manual.cpp | 64 ++++++++ 3 files changed, 72 insertions(+), 145 deletions(-) diff --git a/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.cpp b/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.cpp index bf2d791b..8d63e2dc 100644 --- a/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.cpp +++ b/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.cpp @@ -5,78 +5,6 @@ #pragma makedep unix #endif -NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketIP( void *args ) -{ - struct ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketIP_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketIP_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->CreateListenSocketIP( params->localAddress, params->nOptions, params->pOptions ); - return 0; -} - -#if defined(__x86_64__) || defined(__aarch64__) -NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketIP( void *args ) -{ - struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketIP_params *params = (struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketIP_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->CreateListenSocketIP( params->localAddress, params->nOptions, params->pOptions ); - return 0; -} -#endif - -NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectByIPAddress( void *args ) -{ - struct ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectByIPAddress_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectByIPAddress_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->ConnectByIPAddress( params->address, params->nOptions, params->pOptions ); - return 0; -} - -#if defined(__x86_64__) || defined(__aarch64__) -NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectByIPAddress( void *args ) -{ - struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectByIPAddress_params *params = (struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectByIPAddress_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->ConnectByIPAddress( params->address, params->nOptions, params->pOptions ); - return 0; -} -#endif - -NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2P( void *args ) -{ - struct ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2P_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2P_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->CreateListenSocketP2P( params->nLocalVirtualPort, params->nOptions, params->pOptions ); - return 0; -} - -#if defined(__x86_64__) || defined(__aarch64__) -NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2P( void *args ) -{ - struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2P_params *params = (struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2P_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->CreateListenSocketP2P( params->nLocalVirtualPort, params->nOptions, params->pOptions ); - return 0; -} -#endif - -NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2P( void *args ) -{ - struct ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2P_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2P_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->ConnectP2P( params->identityRemote, params->nRemoteVirtualPort, params->nOptions, params->pOptions ); - return 0; -} - -#if defined(__x86_64__) || defined(__aarch64__) -NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2P( void *args ) -{ - struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2P_params *params = (struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2P_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->ConnectP2P( params->identityRemote, params->nRemoteVirtualPort, params->nOptions, params->pOptions ); - return 0; -} -#endif - NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_AcceptConnection( void *args ) { struct ISteamNetworkingSockets_SteamNetworkingSockets012_AcceptConnection_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_AcceptConnection_params *)args; @@ -491,24 +419,6 @@ NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_FindRelayAuthTi } #endif -NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectToHostedDedicatedServer( void *args ) -{ - struct ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectToHostedDedicatedServer_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectToHostedDedicatedServer_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->ConnectToHostedDedicatedServer( params->identityTarget, params->nRemoteVirtualPort, params->nOptions, params->pOptions ); - return 0; -} - -#if defined(__x86_64__) || defined(__aarch64__) -NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectToHostedDedicatedServer( void *args ) -{ - struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectToHostedDedicatedServer_params *params = (struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectToHostedDedicatedServer_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->ConnectToHostedDedicatedServer( params->identityTarget, params->nRemoteVirtualPort, params->nOptions, params->pOptions ); - return 0; -} -#endif - NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_GetHostedDedicatedServerPort( void *args ) { struct ISteamNetworkingSockets_SteamNetworkingSockets012_GetHostedDedicatedServerPort_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_GetHostedDedicatedServerPort_params *)args; @@ -563,24 +473,6 @@ NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_GetHostedDedica } #endif -NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_CreateHostedDedicatedServerListenSocket( void *args ) -{ - struct ISteamNetworkingSockets_SteamNetworkingSockets012_CreateHostedDedicatedServerListenSocket_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_CreateHostedDedicatedServerListenSocket_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->CreateHostedDedicatedServerListenSocket( params->nLocalVirtualPort, params->nOptions, params->pOptions ); - return 0; -} - -#if defined(__x86_64__) || defined(__aarch64__) -NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateHostedDedicatedServerListenSocket( void *args ) -{ - struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateHostedDedicatedServerListenSocket_params *params = (struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateHostedDedicatedServerListenSocket_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->CreateHostedDedicatedServerListenSocket( params->nLocalVirtualPort, params->nOptions, params->pOptions ); - return 0; -} -#endif - NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_GetGameCoordinatorServerLogin( void *args ) { struct ISteamNetworkingSockets_SteamNetworkingSockets012_GetGameCoordinatorServerLogin_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_GetGameCoordinatorServerLogin_params *)args; @@ -599,24 +491,6 @@ NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_GetGameCoordina } #endif -NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2PCustomSignaling( void *args ) -{ - struct ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2PCustomSignaling_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2PCustomSignaling_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->ConnectP2PCustomSignaling( params->pSignaling, params->pPeerIdentity, params->nRemoteVirtualPort, params->nOptions, params->pOptions ); - return 0; -} - -#if defined(__x86_64__) || defined(__aarch64__) -NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2PCustomSignaling( void *args ) -{ - struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2PCustomSignaling_params *params = (struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_ConnectP2PCustomSignaling_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->ConnectP2PCustomSignaling( params->pSignaling, params->pPeerIdentity, params->nRemoteVirtualPort, params->nOptions, params->pOptions ); - return 0; -} -#endif - NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_ReceivedP2PCustomSignal( void *args ) { struct ISteamNetworkingSockets_SteamNetworkingSockets012_ReceivedP2PCustomSignal_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_ReceivedP2PCustomSignal_params *)args; @@ -743,24 +617,6 @@ NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_GetFakeIP( void } #endif -NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2PFakeIP( void *args ) -{ - struct ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2PFakeIP_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2PFakeIP_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->CreateListenSocketP2PFakeIP( params->idxFakePort, params->nOptions, params->pOptions ); - return 0; -} - -#if defined(__x86_64__) || defined(__aarch64__) -NTSTATUS wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2PFakeIP( void *args ) -{ - struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2PFakeIP_params *params = (struct wow64_ISteamNetworkingSockets_SteamNetworkingSockets012_CreateListenSocketP2PFakeIP_params *)args; - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->u_iface; - params->_ret = iface->CreateListenSocketP2PFakeIP( params->idxFakePort, params->nOptions, params->pOptions ); - return 0; -} -#endif - NTSTATUS ISteamNetworkingSockets_SteamNetworkingSockets012_GetRemoteFakeIPForConnection( void *args ) { struct ISteamNetworkingSockets_SteamNetworkingSockets012_GetRemoteFakeIPForConnection_params *params = (struct ISteamNetworkingSockets_SteamNetworkingSockets012_GetRemoteFakeIPForConnection_params *)args; diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index 3f2780a9..b2a2d5ef 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -262,8 +262,15 @@ MANUAL_METHODS = { "ISteamNetworkingSockets_ReceiveMessagesOnListenSocket": True, "ISteamNetworkingSockets_ReceiveMessagesOnPollGroup": True, "ISteamNetworkingSockets_SendMessages": True, - "ISteamNetworkingSockets_ConnectP2PCustomSignaling": lambda ver, abi: abi == 'u' and ver <= 8, + "ISteamNetworkingSockets_ConnectP2PCustomSignaling": lambda ver, abi: abi == 'u' and (ver <= 8 or ver >= 12), "ISteamNetworkingSockets_ReceivedP2PCustomSignal": lambda ver, abi: abi == 'u' and ver <= 8, + "ISteamNetworkingSockets_CreateListenSocketIP": lambda ver, abi: abi == 'u' and ver >= 12, + "ISteamNetworkingSockets_ConnectByIPAddress": lambda ver, abi: abi == 'u' and ver >= 12, + "ISteamNetworkingSockets_CreateListenSocketP2P": lambda ver, abi: abi == 'u' and ver >= 12, + "ISteamNetworkingSockets_ConnectP2P": lambda ver, abi: abi == 'u' and ver >= 12, + "ISteamNetworkingSockets_ConnectToHostedDedicatedServer": lambda ver, abi: abi == 'u' and ver >= 12, + "ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket": lambda ver, abi: abi == 'u' and ver >= 12, + "ISteamNetworkingSockets_CreateListenSocketP2PFakeIP": lambda ver, abi: abi == 'u' and ver >= 12, "ISteamMatchmakingServers_CancelQuery": lambda ver, abi: (abi == 'u' and ver >= 2) or (abi == 'w'), "ISteamMatchmakingServers_GetServerCount": lambda ver, abi: abi == 'u' and ver >= 2, diff --git a/lsteamclient/unix_steam_networking_manual.cpp b/lsteamclient/unix_steam_networking_manual.cpp index 77953ef3..0c0ad8c8 100644 --- a/lsteamclient/unix_steam_networking_manual.cpp +++ b/lsteamclient/unix_steam_networking_manual.cpp @@ -407,6 +407,62 @@ static NTSTATUS ISteamNetworkingMessages_ReceiveMessagesOnChannel( Iface *iface, return 0; } +template< typename Iface, typename Params > +static NTSTATUS ISteamNetworkingSockets_CreateListenSocketIP( Iface *iface, Params *params, bool wow64 ) +{ + params->_ret = iface->CreateListenSocketIP( params->localAddress, params->nOptions, params->pOptions ); + return 0; +} + +template< typename Iface, typename Params > +static NTSTATUS ISteamNetworkingSockets_ConnectP2PCustomSignaling( Iface *iface, Params *params, bool wow64, u_SteamNetworkingMessage_t_153a const & ) +{ + params->_ret = iface->ConnectP2PCustomSignaling( params->pSignaling, params->pPeerIdentity, params->nRemoteVirtualPort, params->nOptions, params->pOptions ); + return 0; +} + +template< typename Iface, typename Params > +static NTSTATUS ISteamNetworkingSockets_ConnectByIPAddress( Iface *iface, Params *params, bool wow64 ) +{ + params->_ret = iface->ConnectByIPAddress( params->address, params->nOptions, params->pOptions ); + return 0; +} + +template< typename Iface, typename Params > +static NTSTATUS ISteamNetworkingSockets_CreateListenSocketP2P( Iface *iface, Params *params, bool wow64 ) +{ + params->_ret = iface->CreateListenSocketP2P( params->nLocalVirtualPort, params->nOptions, params->pOptions ); + return 0; +} + +template< typename Iface, typename Params > +static NTSTATUS ISteamNetworkingSockets_ConnectP2P( Iface *iface, Params *params, bool wow64 ) +{ + params->_ret = iface->ConnectP2P( params->identityRemote, params->nRemoteVirtualPort, params->nOptions, params->pOptions ); + return 0; +} + +template< typename Iface, typename Params > +static NTSTATUS ISteamNetworkingSockets_ConnectToHostedDedicatedServer( Iface *iface, Params *params, bool wow64 ) +{ + params->_ret = iface->ConnectToHostedDedicatedServer( params->identityTarget, params->nRemoteVirtualPort, params->nOptions, params->pOptions ); + return 0; +} + +template< typename Iface, typename Params > +static NTSTATUS ISteamNetworkingSockets_CreateHostedDedicatedServerListenSocket( Iface *iface, Params *params, bool wow64 ) +{ + params->_ret = iface->CreateHostedDedicatedServerListenSocket( params->nLocalVirtualPort, params->nOptions, params->pOptions ); + return 0; +} + +template< typename Iface, typename Params > +static NTSTATUS ISteamNetworkingSockets_CreateListenSocketP2PFakeIP( Iface *iface, Params *params, bool wow64 ) +{ + params->_ret = iface->CreateListenSocketP2PFakeIP( params->idxFakePort, params->nOptions, params->pOptions ); + return 0; +} + LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets002, ReceiveMessagesOnConnection, u_SteamNetworkingMessage_t_144() ); LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets002, ReceiveMessagesOnListenSocket, u_SteamNetworkingMessage_t_144() ); @@ -432,6 +488,14 @@ LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets009, Send LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets012, ReceiveMessagesOnConnection, u_SteamNetworkingMessage_t_153a() ); LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets012, ReceiveMessagesOnPollGroup, u_SteamNetworkingMessage_t_153a() ); LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets012, SendMessages, u_SteamNetworkingMessage_t_153a() ); +LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets012, CreateListenSocketIP ); +LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets012, ConnectP2PCustomSignaling, u_SteamNetworkingMessage_t_153a() ); +LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets012, ConnectByIPAddress ); +LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets012, CreateListenSocketP2P ); +LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets012, ConnectP2P ); +LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets012, ConnectToHostedDedicatedServer ); +LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets012, CreateHostedDedicatedServerListenSocket ); +LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingSockets, SteamNetworkingSockets012, CreateListenSocketP2PFakeIP ); LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingUtils, SteamNetworkingUtils003, AllocateMessage, u_SteamNetworkingMessage_t_147() ); LSTEAMCLIENT_UNIX_IMPL( ISteamNetworkingUtils, SteamNetworkingUtils003, SetConfigValue, u_SteamNetworkingMessage_t_147() );