2023-09-30 15:02:30 +03:00
|
|
|
#ifndef __STEAMCLIENT_UNIXLIB_H
|
|
|
|
#define __STEAMCLIENT_UNIXLIB_H
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
2023-10-04 18:38:54 +03:00
|
|
|
#include <assert.h>
|
2023-09-30 15:02:30 +03:00
|
|
|
|
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
2023-09-30 14:08:49 +03:00
|
|
|
#include <winternl.h>
|
2023-09-30 15:02:30 +03:00
|
|
|
|
2023-10-02 11:51:14 +03:00
|
|
|
#include "steamclient_structs.h"
|
|
|
|
|
2024-01-04 23:59:44 +03:00
|
|
|
#define TEMP_PATH_BUFFER_LENGTH 4096
|
|
|
|
|
2023-09-30 15:02:30 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2023-10-03 12:04:33 +03:00
|
|
|
#include "wine/unixlib.h"
|
2023-09-30 15:02:30 +03:00
|
|
|
|
2023-10-04 22:32:49 +03:00
|
|
|
#include <pshpack1.h>
|
|
|
|
|
2023-10-19 12:07:32 +03:00
|
|
|
struct steamclient_init_params
|
|
|
|
{
|
2023-10-03 12:04:33 +03:00
|
|
|
char *g_tmppath;
|
2023-10-19 12:07:32 +03:00
|
|
|
const char *steam_app_id;
|
2023-10-04 23:02:15 +03:00
|
|
|
int8_t steam_app_id_unset;
|
2023-10-19 12:07:32 +03:00
|
|
|
const char *ignore_child_processes;
|
2023-10-04 23:02:15 +03:00
|
|
|
int8_t ignore_child_processes_unset;
|
2023-10-19 12:07:32 +03:00
|
|
|
};
|
|
|
|
|
2023-09-30 15:02:30 +03:00
|
|
|
enum callback_type
|
|
|
|
{
|
2023-10-02 16:27:37 +03:00
|
|
|
SOCKETS_DEBUG_OUTPUT = 1,
|
|
|
|
WARNING_MESSAGE_HOOK,
|
2023-10-03 12:01:47 +03:00
|
|
|
CALL_CDECL_FUNC_DATA,
|
2023-10-03 10:40:50 +03:00
|
|
|
CALL_IFACE_VTABLE_0,
|
|
|
|
CALL_IFACE_VTABLE_1,
|
|
|
|
CALL_IFACE_VTABLE_2,
|
2024-01-19 13:40:09 +03:00
|
|
|
CALL_IFACE_VTABLE_0_SERVER_RESPONDED,
|
2023-10-03 10:40:50 +03:00
|
|
|
CALL_IFACE_VTABLE_0_ADD_PLAYER_TO_LIST,
|
|
|
|
CALL_IFACE_VTABLE_0_RULES_RESPONDED,
|
2023-09-30 15:02:30 +03:00
|
|
|
};
|
|
|
|
|
2023-10-02 16:27:37 +03:00
|
|
|
struct callback
|
2023-09-30 15:02:30 +03:00
|
|
|
{
|
|
|
|
enum callback_type type;
|
2023-10-02 16:27:37 +03:00
|
|
|
uint32_t size;
|
|
|
|
|
2023-09-30 15:02:30 +03:00
|
|
|
union
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
2023-12-05 00:48:13 +03:00
|
|
|
void (*W_CDECL pfnFunc)( uint32_t, const char * );
|
2023-10-02 16:27:37 +03:00
|
|
|
uint32_t type;
|
|
|
|
const char msg[1];
|
|
|
|
} sockets_debug_output;
|
|
|
|
|
2023-09-30 15:02:30 +03:00
|
|
|
struct
|
|
|
|
{
|
2023-10-02 16:27:37 +03:00
|
|
|
void (*W_CDECL pFunction)( int32_t, const char * );
|
|
|
|
int32_t severity;
|
|
|
|
const char msg[1];
|
|
|
|
} warning_message_hook;
|
2023-10-03 10:40:50 +03:00
|
|
|
|
2023-10-03 12:01:47 +03:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
void (*W_CDECL pFunc)( void * );
|
|
|
|
unsigned char data[1];
|
|
|
|
} call_cdecl_func_data;
|
|
|
|
|
2023-10-03 10:40:50 +03:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct w_steam_iface *iface;
|
|
|
|
uint64_t arg0;
|
|
|
|
uint64_t arg1;
|
|
|
|
uint64_t arg2;
|
|
|
|
} call_iface_vtable;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct w_steam_iface *iface;
|
2024-01-19 13:40:09 +03:00
|
|
|
gameserveritem_t_105 server[];
|
|
|
|
} server_responded;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct w_steam_iface *iface;
|
2023-10-03 10:40:50 +03:00
|
|
|
int32_t score;
|
|
|
|
float time_played;
|
|
|
|
const char name[1];
|
|
|
|
} add_player_to_list;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
struct w_steam_iface *iface;
|
|
|
|
const char rule_and_value[1];
|
|
|
|
} rules_responded;
|
2023-09-30 15:02:30 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-10-19 11:38:37 +03:00
|
|
|
struct steamclient_next_callback_params
|
|
|
|
{
|
2023-10-04 23:02:15 +03:00
|
|
|
int8_t _ret;
|
2023-10-19 11:38:37 +03:00
|
|
|
struct callback *callback;
|
|
|
|
uint32_t size;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_CreateInterface_params
|
|
|
|
{
|
|
|
|
void *_ret;
|
|
|
|
const char *name;
|
|
|
|
int *return_code;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_Steam_GetAPICallResult_params
|
|
|
|
{
|
2023-10-04 23:02:15 +03:00
|
|
|
int8_t _ret;
|
2023-10-19 11:38:37 +03:00
|
|
|
int32_t pipe;
|
|
|
|
uint64_t call;
|
|
|
|
void *w_callback;
|
|
|
|
int w_callback_len;
|
|
|
|
int id;
|
2023-10-04 23:02:15 +03:00
|
|
|
int8_t *failed;
|
2023-10-19 11:38:37 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_Steam_BGetCallback_params
|
|
|
|
{
|
2023-10-04 23:02:15 +03:00
|
|
|
int8_t _ret;
|
2023-10-19 11:38:37 +03:00
|
|
|
uint32_t pipe;
|
|
|
|
w_CallbackMsg_t *w_msg;
|
|
|
|
int32_t *ignored;
|
|
|
|
u_CallbackMsg_t *u_msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_callback_message_receive_params
|
|
|
|
{
|
|
|
|
u_CallbackMsg_t *u_msg;
|
|
|
|
w_CallbackMsg_t *w_msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_Steam_FreeLastCallback_params
|
|
|
|
{
|
2023-10-04 23:02:15 +03:00
|
|
|
int8_t _ret;
|
2023-10-19 11:38:37 +03:00
|
|
|
uint32_t pipe;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_Steam_ReleaseThreadLocalMemory_params
|
|
|
|
{
|
|
|
|
int thread_exit;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_Steam_IsKnownInterface_params
|
|
|
|
{
|
2023-10-04 23:02:15 +03:00
|
|
|
int8_t _ret;
|
2023-10-19 11:38:37 +03:00
|
|
|
const char *version;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_Steam_NotifyMissingInterface_params
|
|
|
|
{
|
|
|
|
int32_t pipe;
|
|
|
|
const char *version;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_networking_messages_receive_144_params
|
|
|
|
{
|
|
|
|
uint32_t count;
|
|
|
|
w_SteamNetworkingMessage_t_144 **w_msgs;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_networking_messages_receive_147_params
|
|
|
|
{
|
|
|
|
uint32_t count;
|
|
|
|
w_SteamNetworkingMessage_t_147 **w_msgs;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_networking_messages_receive_153a_params
|
|
|
|
{
|
|
|
|
uint32_t count;
|
|
|
|
w_SteamNetworkingMessage_t_153a **w_msgs;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_networking_message_release_147_params
|
|
|
|
{
|
|
|
|
w_SteamNetworkingMessage_t_147 *w_msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct steamclient_networking_message_release_153a_params
|
|
|
|
{
|
|
|
|
w_SteamNetworkingMessage_t_153a *w_msg;
|
|
|
|
};
|
2023-10-01 11:32:08 +03:00
|
|
|
|
2023-10-02 11:51:14 +03:00
|
|
|
struct networking_message_pool;
|
|
|
|
struct networking_message
|
|
|
|
{
|
|
|
|
struct networking_message_pool *pool;
|
|
|
|
void **p_data;
|
|
|
|
uint32_t *p_size;
|
|
|
|
|
2023-10-02 11:52:15 +03:00
|
|
|
union
|
|
|
|
{
|
|
|
|
u_SteamNetworkingMessage_t_144 *u_msg_144;
|
|
|
|
u_SteamNetworkingMessage_t_147 *u_msg_147;
|
2023-10-02 15:50:49 +03:00
|
|
|
u_SteamNetworkingMessage_t_153a *u_msg_153a;
|
2023-10-02 11:52:15 +03:00
|
|
|
};
|
|
|
|
union
|
|
|
|
{
|
|
|
|
w_SteamNetworkingMessage_t_144 w_msg_144;
|
|
|
|
w_SteamNetworkingMessage_t_147 w_msg_147;
|
2023-10-02 15:50:49 +03:00
|
|
|
w_SteamNetworkingMessage_t_153a w_msg_153a;
|
2023-10-02 11:52:15 +03:00
|
|
|
};
|
2023-10-02 11:51:14 +03:00
|
|
|
};
|
|
|
|
|
2023-10-04 22:32:49 +03:00
|
|
|
#include <poppack.h>
|
|
|
|
|
2023-10-04 18:38:54 +03:00
|
|
|
#define STEAMCLIENT_CALL( code, args ) \
|
|
|
|
({ \
|
|
|
|
NTSTATUS status = WINE_UNIX_CALL( unix_ ## code, args ); \
|
|
|
|
if (status) WARN( #code " failed, status %#x\n", (UINT)status ); \
|
|
|
|
assert( !status ); \
|
|
|
|
status; \
|
|
|
|
})
|
2023-09-30 14:08:49 +03:00
|
|
|
|
2023-09-30 15:02:30 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2023-09-30 14:08:49 +03:00
|
|
|
#include "unixlib_generated.h"
|
|
|
|
|
2023-09-30 15:02:30 +03:00
|
|
|
#endif /* __STEAMCLIENT_UNIXLIB_H */
|