fix crashes on NGC

This commit is contained in:
lizzie
2026-08-15 18:29:13 +00:00
parent da560fde52
commit 2799621089
3 changed files with 37 additions and 28 deletions
+6 -4
View File
@@ -29,8 +29,9 @@ public:
private:
void Match(HLERequestContext& ctx) {
const auto buffer = ctx.ReadBuffer();
const auto text = Common::StringFromFixedZeroTerminatedBuffer(
reinterpret_cast<const char*>(buffer.data()), buffer.size());
const auto text = !buffer.empty()
? Common::StringFromFixedZeroTerminatedBuffer(reinterpret_cast<const char*>(buffer.data()), buffer.size())
: std::string{};
LOG_WARNING(Service_NGC, "(STUBBED) called, text={}", text);
@@ -42,8 +43,9 @@ private:
void Filter(HLERequestContext& ctx) {
const auto buffer = ctx.ReadBuffer();
const auto text = Common::StringFromFixedZeroTerminatedBuffer(
reinterpret_cast<const char*>(buffer.data()), buffer.size());
const auto text = !buffer.empty()
? Common::StringFromFixedZeroTerminatedBuffer(reinterpret_cast<const char*>(buffer.data()), buffer.size())
: std::string{};
LOG_WARNING(Service_NGC, "(STUBBED) called, text={}", text);
+15 -12
View File
@@ -9,20 +9,23 @@
namespace Service::OLSC {
class ISProfileBgAgentForSystemProcess final : public ServiceFramework<ISProfileBgAgentForSystemProcess> {
public:
explicit ISProfileBgAgentForSystemProcess(Core::System& system_)
: ServiceFramework{system_, "spbg:sp"}
{
static const FunctionInfo functions[] = {
{ 100, nullptr, "OpenBgAgentController" },
};
RegisterHandlers(functions);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
const auto OlscFactoryForApplication = [&] {
return std::make_shared<IOlscServiceForApplication>(system);
};
const auto OlscFactoryForSystemService = [&] {
return std::make_shared<IOlscServiceForSystemService>(system);
};
server_manager->RegisterNamedService("olsc:u", OlscFactoryForApplication);
server_manager->RegisterNamedService("olsc:s", OlscFactoryForSystemService);
server_manager->RegisterNamedService("olsc:u", std::make_shared<IOlscServiceForApplication>(system));
server_manager->RegisterNamedService("olsc:s", std::make_shared<IOlscServiceForSystemService>(system));
server_manager->RegisterNamedService("spbg:sp", std::make_shared<ISProfileBgAgentForSystemProcess>(system));
ServerManager::RunServer(std::move(server_manager));
}
+16 -12
View File
@@ -571,22 +571,26 @@ private:
} // namespace
class IDebugMonitorInterface final : public ServiceFramework<IDebugMonitorInterface> {
public:
explicit IDebugMonitorInterface(Core::System& system_)
: ServiceFramework{system_, "ro:dmnt"}
{
static const FunctionInfo functions[] = {
{ 0, nullptr, "GetProcessModuleInfo" },
};
RegisterHandlers(functions);
}
};
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
auto ro = std::make_shared<RoContext>();
const auto RoInterfaceFactoryForUser = [&, ro] {
return std::make_shared<RoInterface>(system, "ldr:ro", ro, NrrKind::User);
};
const auto RoInterfaceFactoryForJitPlugin = [&, ro] {
return std::make_shared<RoInterface>(system, "ro:1", ro, NrrKind::JitPlugin);
};
server_manager->RegisterNamedService("ldr:ro", std::move(RoInterfaceFactoryForUser));
server_manager->RegisterNamedService("ro:1", std::move(RoInterfaceFactoryForJitPlugin));
server_manager->RegisterNamedService("ldr:ro", std::make_shared<RoInterface>(system, "ldr:ro", ro, NrrKind::User));
server_manager->RegisterNamedService("ro:1", std::make_shared<RoInterface>(system, "ro:1", ro, NrrKind::JitPlugin));
server_manager->RegisterNamedService("ro:dmnt", std::make_shared<IDebugMonitorInterface>(system));
ServerManager::RunServer(std::move(server_manager));
}