diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index 6786190b..df75aecb 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -675,6 +675,8 @@ class Method: return self.result_type.spelling.startswith("ISteam") or "GetISteam" in self.name def returns_string(self): + if self._klass.name == 'ISteamMatchmakingServers' and self.name == 'GetServerDetails': + return True return self.result_type.spelling == "const char *" def write_params(self, out): diff --git a/lsteamclient/steamclient_structs.h b/lsteamclient/steamclient_structs.h index 41e19c3f..0d3625d2 100644 --- a/lsteamclient/steamclient_structs.h +++ b/lsteamclient/steamclient_structs.h @@ -73,6 +73,7 @@ struct u_buffer UINT64 len; #ifdef __cplusplus struct u_buffer &operator=(const char* value) { this->ptr = (UINT_PTR)value; this->len = value ? strlen( value ) + 1 : 0; return *this; } + template< typename T > struct u_buffer &operator=(const T* value) { this->ptr = (UINT_PTR)value; this->len = value ? sizeof( *value ) : 0; return *this; } operator char*() const { return (char*)(UINT_PTR)this->ptr; } #endif /* __cplusplus */ }; diff --git a/lsteamclient/unixlib_generated.h b/lsteamclient/unixlib_generated.h index e1e6cddc..eeb1897b 100644 --- a/lsteamclient/unixlib_generated.h +++ b/lsteamclient/unixlib_generated.h @@ -40135,7 +40135,7 @@ struct ISteamMatchmakingServers_SteamMatchMakingServers001_RequestSpectatorServe struct ISteamMatchmakingServers_SteamMatchMakingServers001_GetServerDetails_params { struct u_iface u_iface; - gameserveritem_t_105 *_ret; + struct u_buffer _ret; uint32_t eType; int32_t iServer; }; @@ -40273,7 +40273,7 @@ struct ISteamMatchmakingServers_SteamMatchMakingServers002_ReleaseRequest_params struct ISteamMatchmakingServers_SteamMatchMakingServers002_GetServerDetails_params { struct u_iface u_iface; - gameserveritem_t_105 *_ret; + struct u_buffer _ret; void *hRequest; int32_t iServer; }; diff --git a/lsteamclient/winISteamMatchmakingServers.c b/lsteamclient/winISteamMatchmakingServers.c index 310a9b85..e8dc9595 100644 --- a/lsteamclient/winISteamMatchmakingServers.c +++ b/lsteamclient/winISteamMatchmakingServers.c @@ -112,7 +112,7 @@ gameserveritem_t_105 * __thiscall winISteamMatchmakingServers_SteamMatchMakingSe }; TRACE("%p\n", _this); STEAMCLIENT_CALL( ISteamMatchmakingServers_SteamMatchMakingServers001_GetServerDetails, ¶ms ); - return params._ret; + return get_unix_buffer( params._ret ); } void __thiscall winISteamMatchmakingServers_SteamMatchMakingServers001_CancelQuery(struct w_iface *_this, uint32_t eType) @@ -288,7 +288,7 @@ gameserveritem_t_105 * __thiscall winISteamMatchmakingServers_SteamMatchMakingSe }; TRACE("%p\n", _this); STEAMCLIENT_CALL( ISteamMatchmakingServers_SteamMatchMakingServers002_GetServerDetails, ¶ms ); - return params._ret; + return get_unix_buffer( params._ret ); } void __thiscall winISteamMatchmakingServers_SteamMatchMakingServers002_CancelQuery(struct w_iface *_this, void *hRequest)