mirror of
https://github.com/izzy2lost/xenia-edge.git
synced 2026-07-06 00:20:26 -07:00
[Xam] Undo the damage to Linux networking code
Fixes Rumble Roses XX profile login on Linux (and probably other games)
This commit is contained in:
@@ -264,7 +264,7 @@ dword_result_t NetDll_WSAStartup_entry(dword_t caller, word_t version,
|
||||
#endif
|
||||
|
||||
if (data_ptr) {
|
||||
data_ptr.Zero();
|
||||
auto data_out = kernel_state()->memory()->TranslateVirtual(data_ptr);
|
||||
|
||||
#ifdef XE_PLATFORM_WIN32
|
||||
data_ptr->version = wsaData.wVersion;
|
||||
@@ -273,25 +273,22 @@ dword_result_t NetDll_WSAStartup_entry(dword_t caller, word_t version,
|
||||
data_ptr->max_udpdg = wsaData.iMaxUdpDg;
|
||||
std::memcpy(&data_ptr->description, wsaData.szDescription, 0x100);
|
||||
std::memcpy(&data_ptr->system_status, wsaData.szSystemStatus, 0x80);
|
||||
data_ptr->vendor_info_ptr = 0;
|
||||
#else
|
||||
// Match Windows behavior with reasonable values
|
||||
data_ptr->version = 2;
|
||||
data_ptr->version_high = 0x0202;
|
||||
data_ptr->max_sockets = 0;
|
||||
data_ptr->max_udpdg = 0;
|
||||
|
||||
const std::string description = "WinSock 2.0";
|
||||
const std::string status = "Running";
|
||||
|
||||
data_ptr->version = version.value();
|
||||
data_ptr->version_high = version.value();
|
||||
data_ptr->max_sockets = 100;
|
||||
data_ptr->max_udpdg = 1024;
|
||||
// WinSock 2.2 typically returns empty strings for these fields
|
||||
std::memset(&data_ptr->description, 0, 0x100);
|
||||
std::memcpy(&data_ptr->description, description.data(), description.size());
|
||||
|
||||
std::memset(&data_ptr->system_status, 0, 0x80);
|
||||
std::memcpy(&data_ptr->system_status, status.data(), status.size());
|
||||
|
||||
data_ptr->vendor_info_ptr = 0;
|
||||
#endif
|
||||
|
||||
// Some games (5841099F) want this value round-tripped - they'll compare if
|
||||
// it changes and bugcheck if it does.
|
||||
// vendor_info_ptr is at offset 0x18A (after max_udpdg at 0x188)
|
||||
uint32_t vendor_ptr = xe::load_and_swap<uint32_t>(data_out + 0x18A);
|
||||
xe::store_and_swap<uint32_t>(data_out + 0x18A, vendor_ptr);
|
||||
}
|
||||
|
||||
// DEBUG
|
||||
|
||||
Reference in New Issue
Block a user