mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-24 09:21:05 +00:00
Return a stub service in the event that a service interface is not implemented, instead of reporting to the caller that GetServiceHandle itself is unimplemented (which games seem to dislike).
This commit is contained in:
parent
a78b8b1bc4
commit
b4700444a2
@ -57,6 +57,8 @@ namespace Service {
|
||||
std::unordered_map<std::string, Kernel::SharedPtr<Interface>> g_kernel_named_ports;
|
||||
std::unordered_map<std::string, Kernel::SharedPtr<Interface>> g_srv_services;
|
||||
|
||||
Interface g_stub_service;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Module interface
|
||||
|
||||
|
@ -119,5 +119,7 @@ void Shutdown();
|
||||
extern std::unordered_map<std::string, Kernel::SharedPtr<Interface>> g_kernel_named_ports;
|
||||
/// Map of services registered with the "srv:" service, retrieved using GetServiceHandle.
|
||||
extern std::unordered_map<std::string, Kernel::SharedPtr<Interface>> g_srv_services;
|
||||
/// Returned to callers when the requested service is not yet implemented
|
||||
extern Interface g_stub_service;
|
||||
|
||||
} // namespace
|
||||
|
@ -42,8 +42,14 @@ static void GetServiceHandle(Service::Interface* self) {
|
||||
LOG_TRACE(Service_SRV, "called port=%s, handle=0x%08X", port_name.c_str(), cmd_buff[3]);
|
||||
} else {
|
||||
LOG_ERROR(Service_SRV, "(UNIMPLEMENTED) called port=%s", port_name.c_str());
|
||||
res = UnimplementedFunction(ErrorModule::SRV);
|
||||
|
||||
// Note: developers should add the corresponding service interface implementation when this is hit
|
||||
UNIMPLEMENTED();
|
||||
|
||||
// Return the stubbed (empty) service so that applications can continue
|
||||
cmd_buff[3] = Kernel::g_handle_table.Create(&Service::g_stub_service).MoveFrom();
|
||||
}
|
||||
|
||||
cmd_buff[1] = res.raw;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user