Files
eden/src/core/hle/service/ldr/ldr.cpp
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
2.3 KiB
C++
Raw Normal View History

// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2018-07-25 22:57:08 -04:00
#include "core/hle/service/ldr/ldr.h"
2023-02-18 16:26:48 -05:00
#include "core/hle/service/server_manager.h"
2018-07-25 22:57:08 -04:00
#include "core/hle/service/service.h"
namespace Service::LDR {
class DebugMonitor final : public ServiceFramework<DebugMonitor> {
public:
explicit DebugMonitor(Core::System& system_) : ServiceFramework{system_, "ldr:dmnt"} {
2018-07-25 22:57:08 -04:00
// clang-format off
static const FunctionInfo functions[] = {
2026-09-25 15:53:30 +00:00
FunctionInfo{0, nullptr, "SetProgramArgument"},
FunctionInfo{1, nullptr, "FlushArguments"},
FunctionInfo{2, nullptr, "GetProcessModuleInfo"}
2018-07-25 22:57:08 -04:00
};
// clang-format on
RegisterHandlers(functions);
}
};
class ProcessManager final : public ServiceFramework<ProcessManager> {
public:
explicit ProcessManager(Core::System& system_) : ServiceFramework{system_, "ldr:pm"} {
2018-07-25 22:57:08 -04:00
// clang-format off
static const FunctionInfo functions[] = {
2026-09-25 15:53:30 +00:00
FunctionInfo{0, nullptr, "CreateProcess"},
FunctionInfo{1, nullptr, "GetProgramInfo"},
FunctionInfo{2, nullptr, "PinProgram"},
FunctionInfo{3, nullptr, "UnpinProgram"},
FunctionInfo{4, nullptr, "SetEnabledProgramVerification"}
2018-07-25 22:57:08 -04:00
};
// clang-format on
RegisterHandlers(functions);
}
};
class Shell final : public ServiceFramework<Shell> {
public:
explicit Shell(Core::System& system_) : ServiceFramework{system_, "ldr:shel"} {
2018-07-25 22:57:08 -04:00
// clang-format off
static const FunctionInfo functions[] = {
2026-09-25 15:53:30 +00:00
FunctionInfo{0, nullptr, "SetProgramArgument"},
FunctionInfo{1, nullptr, "FlushArguments"}
2018-07-25 22:57:08 -04:00
};
// clang-format on
RegisterHandlers(functions);
}
};
2023-02-18 16:26:48 -05:00
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("ldr:dmnt", std::make_shared<DebugMonitor>(system), 3);
server_manager->RegisterNamedService("ldr:pm", std::make_shared<ProcessManager>(system), 1);
server_manager->RegisterNamedService("ldr:shel", std::make_shared<Shell>(system), 3);
2023-02-18 16:26:48 -05:00
ServerManager::RunServer(std::move(server_manager));
2018-07-25 22:57:08 -04:00
}
} // namespace Service::LDR