mirror of
https://github.com/PabloMK7/citra.git
synced 2024-11-16 12:03:25 +01:00
svc: added a check to ensure that a service was implemented before attempting to connect to its port
This commit is contained in:
parent
7bb66421a0
commit
f8a98ab022
@ -84,7 +84,11 @@ Result MapMemoryBlock(Handle memblock, u32 addr, u32 mypermissions, u32 otherper
|
|||||||
/// Connect to an OS service given the port name, returns the handle to the port to out
|
/// Connect to an OS service given the port name, returns the handle to the port to out
|
||||||
Result ConnectToPort(void* out, const char* port_name) {
|
Result ConnectToPort(void* out, const char* port_name) {
|
||||||
Service::Interface* service = Service::g_manager->FetchFromPortName(port_name);
|
Service::Interface* service = Service::g_manager->FetchFromPortName(port_name);
|
||||||
Core::g_app_core->SetReg(1, service->GetHandle());
|
if (service) {
|
||||||
|
Core::g_app_core->SetReg(1, service->GetHandle());
|
||||||
|
} else {
|
||||||
|
PanicYesNo("ConnectToPort called port_name=%s, but it is not implemented!", port_name);
|
||||||
|
}
|
||||||
DEBUG_LOG(SVC, "ConnectToPort called port_name=%s", port_name);
|
DEBUG_LOG(SVC, "ConnectToPort called port_name=%s", port_name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user