diff --git a/lsteamclient/Makefile.in b/lsteamclient/Makefile.in index 77efbdb8..9a4f4188 100644 --- a/lsteamclient/Makefile.in +++ b/lsteamclient/Makefile.in @@ -6,6 +6,7 @@ EXTRADEFS = -DWINE_NO_LONG_TYPES -DSTEAM_API_EXPORTS -Dprivate=public -Dprotecte SOURCES = \ steam_client_manual.c \ + steam_networking_manual.c \ steamclient_main.c \ steamclient_wrappers.c \ winISteamAppList.c \ diff --git a/lsteamclient/cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.hpp b/lsteamclient/cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.hpp index cef1f1c2..af325d04 100644 --- a/lsteamclient/cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.hpp +++ b/lsteamclient/cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.hpp @@ -12,6 +12,12 @@ struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 #endif /* __cplusplus */ }; +void cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort( struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort_params *params ) +{ + struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *iface = (struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *)params->linux_side; + iface->DestroyFakeUDPPort( ); +} + void cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_SendMessageToFakeIP( struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_SendMessageToFakeIP_params *params ) { struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *iface = (struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *)params->linux_side; diff --git a/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.hpp b/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.hpp index 5293c154..e44906c0 100644 --- a/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.hpp +++ b/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.hpp @@ -314,3 +314,9 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets012_GetRemoteFakeIPForConn params->_ret = iface->GetRemoteFakeIPForConnection( params->hConn, params->pOutAddr ); } +void cppISteamNetworkingSockets_SteamNetworkingSockets012_CreateFakeUDPPort( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_CreateFakeUDPPort_params *params ) +{ + struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; + params->_ret = iface->CreateFakeUDPPort( params->idxFakeServerPort ); +} + diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index 6dfc84a6..9bbeaccd 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -208,7 +208,6 @@ MANUAL_METHODS = { "ISteamNetworkingSockets_ReceiveMessagesOnListenSocket": lambda ver, abi: abi == 'u', "ISteamNetworkingSockets_ReceiveMessagesOnPollGroup": lambda ver, abi: abi == 'u', "ISteamNetworkingSockets_SendMessages": lambda ver, abi: abi == 'u', - "ISteamNetworkingSockets_CreateFakeUDPPort": lambda ver, abi: abi == 'u', "ISteamNetworkingUtils_AllocateMessage": lambda ver, abi: abi == 'u', "ISteamNetworkingUtils_SetConfigValue": lambda ver, abi: abi == 'u' and ver >= 3, @@ -225,7 +224,7 @@ MANUAL_METHODS = { "ISteamController_GetGlyphForActionOrigin": lambda ver, abi: abi == 'u', "ISteamController_GetGlyphForXboxOrigin": lambda ver, abi: abi == 'u', - "ISteamNetworkingFakeUDPPort_DestroyFakeUDPPort": lambda ver, abi: abi == 'u', + "ISteamNetworkingFakeUDPPort_DestroyFakeUDPPort": lambda ver, abi: abi == 'w', "ISteamNetworkingFakeUDPPort_ReceiveMessages": lambda ver, abi: abi == 'u', "ISteamClient_BShutdownIfAllPipesClosed": lambda ver, abi: abi == 'w', @@ -1010,10 +1009,11 @@ def handle_method_c(klass, method, winclassname, cppname, out): out(f' {cppname}_{method.name}( ¶ms );\n') - should_gen_wrapper = not is_manual_method(klass, method, "u") and \ - (method.result_type.spelling.startswith("ISteam") or \ - method.name.startswith("GetISteamGenericInterface")) - if should_gen_wrapper: + if method.name.startswith('CreateFakeUDPPort'): + out(u' params._ret = create_winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001( params._ret );\n') + elif method.name.startswith("GetISteamGenericInterface"): + out(u' params._ret = create_win_interface( pchVersion, params._ret );\n') + elif method.result_type.spelling.startswith("ISteam"): out(u' params._ret = create_win_interface( pchVersion, params._ret );\n') for name, conv in filter(lambda x: x[0] in names, path_conv_utow.items()): diff --git a/lsteamclient/steam_networking_manual.c b/lsteamclient/steam_networking_manual.c new file mode 100644 index 00000000..07ccbeff --- /dev/null +++ b/lsteamclient/steam_networking_manual.c @@ -0,0 +1,15 @@ +#include "steamclient_private.h" + +#include "cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.h" + +WINE_DEFAULT_DEBUG_CHANNEL(steamclient); + +/* ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 */ + +void __thiscall winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort( struct w_steam_iface *_this ) +{ + struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort_params params = {.linux_side = _this->u_iface}; + TRACE( "%p\n", _this ); + cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort( ¶ms ); + HeapFree( GetProcessHeap(), 0, _this ); +} diff --git a/lsteamclient/steamclient_manual_153a.cpp b/lsteamclient/steamclient_manual_153a.cpp index a788d331..66f84da0 100644 --- a/lsteamclient/steamclient_manual_153a.cpp +++ b/lsteamclient/steamclient_manual_153a.cpp @@ -73,20 +73,6 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages( struct c } } -/* from winISteamNetworkingFakeUDPPort.c */ -typedef struct __winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 { - void *vtable; - void *linux_side; -} winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001; - -void cppISteamNetworkingSockets_SteamNetworkingSockets012_CreateFakeUDPPort( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_CreateFakeUDPPort_params *params ) -{ - struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct u_ISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; - void *lin_iface = iface->CreateFakeUDPPort( params->idxFakeServerPort ); - if (!lin_iface) params->_ret = NULL; - else params->_ret = create_winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001( lin_iface ); -} - void cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages( struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages_params *params ) { struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *iface = (struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *)params->linux_side; @@ -96,16 +82,6 @@ void cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessage params->ppOutMessages, params->nMaxMessages ); } -void cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort( struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort_params *params ) -{ - struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *iface = (struct u_ISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *)params->linux_side; - winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 - *win_side = (winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *)( char *)params->linux_side - - offsetof( winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001, linux_side ); - iface->DestroyFakeUDPPort(); - HeapFree(GetProcessHeap(), 0, win_side); -} - typedef void (*CDECL win_FnSteamNetConnectionStatusChanged)( w_SteamNetConnectionStatusChangedCallback_t_153a * ); static win_FnSteamNetConnectionStatusChanged win_SteamNetConnectionStatusChanged; static void lin_SteamNetConnectionStatusChanged( u_SteamNetConnectionStatusChangedCallback_t_153a *u_dat ) diff --git a/lsteamclient/steamclient_private.h b/lsteamclient/steamclient_private.h index 77524bb1..4e54bded 100644 --- a/lsteamclient/steamclient_private.h +++ b/lsteamclient/steamclient_private.h @@ -37,6 +37,8 @@ struct w_steam_iface void *u_iface; }; +#include "win_constructors.h" + struct SteamInputActionEvent_t; typedef void (*CDECL win_SteamInputActionEventCallbackPointer)( struct SteamInputActionEvent_t * ); void lin_SteamInputActionEventCallbackPointer( struct SteamInputActionEvent_t *dat ); diff --git a/lsteamclient/winISteamNetworkingFakeUDPPort.c b/lsteamclient/winISteamNetworkingFakeUDPPort.c index e29381c8..5b4df2fc 100644 --- a/lsteamclient/winISteamNetworkingFakeUDPPort.c +++ b/lsteamclient/winISteamNetworkingFakeUDPPort.c @@ -10,16 +10,6 @@ DEFINE_THISCALL_WRAPPER(winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPor DEFINE_THISCALL_WRAPPER(winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages, 12) DEFINE_THISCALL_WRAPPER(winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ScheduleCleanup, 8) -void __thiscall winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort(struct w_steam_iface *_this) -{ - struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort_params params = - { - .linux_side = _this->u_iface, - }; - TRACE("%p\n", _this); - cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_DestroyFakeUDPPort( ¶ms ); -} - uint32_t __thiscall winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_SendMessageToFakeIP(struct w_steam_iface *_this, const SteamNetworkingIPAddr *remoteAddress, const void *pData, uint32_t cbData, int32_t nSendFlags) { struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_SendMessageToFakeIP_params params = diff --git a/lsteamclient/winISteamNetworkingSockets.c b/lsteamclient/winISteamNetworkingSockets.c index b59fae71..b7552aca 100644 --- a/lsteamclient/winISteamNetworkingSockets.c +++ b/lsteamclient/winISteamNetworkingSockets.c @@ -3417,6 +3417,7 @@ void /*ISteamNetworkingFakeUDPPort*/ * __thiscall winISteamNetworkingSockets_Ste }; TRACE("%p\n", _this); cppISteamNetworkingSockets_SteamNetworkingSockets012_CreateFakeUDPPort( ¶ms ); + params._ret = create_winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001( params._ret ); return params._ret; }