ams_mitm: begin skeleton refactor

This commit is contained in:
Michael Scire
2019-11-20 23:58:18 -08:00
committed by SciresM
parent 02d4c97c6d
commit 393596ef9a
105 changed files with 1541 additions and 352 deletions

View File

@@ -15,40 +15,28 @@
*/
#pragma once
#include <switch.h>
#include <stratosphere.hpp>
#include "../utils.hpp"
namespace ams::mitm::hid {
class HidMitmService : public IMitmServiceObject {
private:
enum class CommandId {
SetSupportedNpadStyleSet = 100,
};
private:
bool should_set_system_ext = false;
public:
HidMitmService(std::shared_ptr<Service> s, u64 pid, ams::ncm::TitleId tid) : IMitmServiceObject(s, pid, tid) {
/* ... */
}
class HidMitmService : public sf::IMitmServiceObject {
private:
enum class CommandId {
/* TODO */
};
public:
static bool ShouldMitm(os::ProcessId process_id, ncm::ProgramId program_id) {
/* TODO */
return false;
}
public:
SF_MITM_SERVICE_OBJECT_CTOR(HidMitmService) { /* ... */ }
protected:
/* TODO */
public:
DEFINE_SERVICE_DISPATCH_TABLE {
/* TODO */
};
};
~HidMitmService();
static bool ShouldMitm(u64 pid, ams::ncm::TitleId tid) {
/* TODO: Consider removing in Atmosphere 0.10.0/1.0.0. */
/* We will mitm:
* - hbl, to help homebrew not need to be recompiled.
*/
return Utils::IsHblTid(static_cast<u64>(tid));
}
static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx);
protected:
/* Overridden commands. */
Result SetSupportedNpadStyleSet(u64 applet_resource_user_id, u32 style_set, PidDescriptor pid_desc);
public:
DEFINE_SERVICE_DISPATCH_TABLE {
MAKE_SERVICE_COMMAND_META(HidMitmService, SetSupportedNpadStyleSet),
};
};
}