mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-01-28 06:28:20 +03:00
lsteamclient: Move ISteamNetworkingFakeUDPPort creation / destroy to the PE side.
CW-Bug-Id: #22729
This commit is contained in:
parent
537b4096a5
commit
96a26ea211
@ -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 \
|
||||
|
@ -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;
|
||||
|
@ -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 );
|
||||
}
|
||||
|
||||
|
@ -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()):
|
||||
|
15
lsteamclient/steam_networking_manual.c
Normal file
15
lsteamclient/steam_networking_manual.c
Normal file
@ -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 );
|
||||
}
|
@ -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 )
|
||||
|
@ -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 );
|
||||
|
@ -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 =
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user