Skip to content

Commit

Permalink
[Xlivebase] Fixed GetServiceInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianCassar committed Dec 8, 2023
1 parent de2d9ae commit 2ff6503
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/xenia/kernel/xam/apps/xlivebase_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,21 +171,26 @@ X_HRESULT XLiveBaseApp::DispatchMessageSync(uint32_t message,

X_HRESULT XLiveBaseApp::GetServiceInfo(uint32_t serviceid,
uint32_t serviceinfo) {
if (serviceid == NULL) {
return 0x80151802; // ERROR_CONNECTION_INVALID
if (serviceinfo == NULL) {
return -1; // ERROR_FUNCTION_FAILED
}

XLiveAPI::XONLINE_SERVICE_INFO* service_info =
reinterpret_cast<XLiveAPI::XONLINE_SERVICE_INFO*>(
memory_->TranslateVirtual(serviceid));
memory_->TranslateVirtual(serviceinfo));

memset(service_info, 0, sizeof(XLiveAPI::XONLINE_SERVICE_INFO));

XLiveAPI::XONLINE_SERVICE_INFO retrieved_service_info =
XLiveAPI::GetServiceInfoById(serviceinfo);

service_info->ip.s_addr = retrieved_service_info.ip.s_addr;
service_info->port = retrieved_service_info.port;
XLiveAPI::GetServiceInfoById(serviceid);

if (retrieved_service_info.ip.s_addr == 0) {
return 0x80151100; // ERROR_SERVICE_NOT_FOUND
// return 0x80151802; // ERROR_CONNECTION_INVALID
} else {
service_info->ip.s_addr = retrieved_service_info.ip.s_addr;
service_info->port = retrieved_service_info.port;
}

return X_E_SUCCESS;
}
Expand Down

0 comments on commit 2ff6503

Please sign in to comment.