mitm/cfg: pass around override status for decision-making
This commit is contained in:
@@ -31,3 +31,18 @@ Result ldrDmntAtmosphereHasLaunchedProgram(bool *out, u64 program_id) {
|
||||
Result ldrPmAtmosphereHasLaunchedProgram(bool *out, u64 program_id) {
|
||||
return _ldrAtmosphereHasLaunchedProgram(ldrPmGetServiceSession(), out, program_id);
|
||||
}
|
||||
|
||||
Result ldrPmAtmosphereGetProgramInfo(LoaderProgramInfo *out_program_info, CfgOverrideStatus *out_status, const NcmProgramLocation *loc) {
|
||||
return serviceDispatchInOut(ldrPmGetServiceSession(), 65001, *loc, *out_status,
|
||||
.buffer_attrs = { SfBufferAttr_Out | SfBufferAttr_HipcPointer | SfBufferAttr_FixedSize },
|
||||
.buffers = { { out_program_info, sizeof(*out_program_info) } },
|
||||
);
|
||||
}
|
||||
|
||||
Result ldrPmAtmospherePinProgram(u64 *out, const NcmProgramLocation *loc, const CfgOverrideStatus *status) {
|
||||
const struct {
|
||||
NcmProgramLocation loc;
|
||||
CfgOverrideStatus status;
|
||||
} in = { *loc, *status };
|
||||
return serviceDispatchInOut(ldrPmGetServiceSession(), 65002, in, *out);
|
||||
}
|
||||
|
||||
@@ -11,9 +11,17 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
u64 keys_down;
|
||||
u64 flags;
|
||||
} CfgOverrideStatus;
|
||||
|
||||
Result ldrPmAtmosphereHasLaunchedProgram(bool *out, u64 program_id);
|
||||
Result ldrDmntAtmosphereHasLaunchedProgram(bool *out, u64 program_id);
|
||||
|
||||
Result ldrPmAtmosphereGetProgramInfo(LoaderProgramInfo *out, CfgOverrideStatus *out_status, const NcmProgramLocation *loc);
|
||||
Result ldrPmAtmospherePinProgram(u64 *out, const NcmProgramLocation *loc, const CfgOverrideStatus *status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -40,4 +40,15 @@ namespace ams::ldr::pm {
|
||||
return ldrPmAtmosphereHasLaunchedProgram(out, static_cast<u64>(program_id));
|
||||
}
|
||||
|
||||
Result AtmosphereGetProgramInfo(ProgramInfo *out, cfg::OverrideStatus *out_status, const ncm::ProgramLocation &loc) {
|
||||
static_assert(sizeof(*out_status) == sizeof(CfgOverrideStatus), "CfgOverrideStatus definition!");
|
||||
return ldrPmAtmosphereGetProgramInfo(reinterpret_cast<LoaderProgramInfo *>(out), reinterpret_cast<CfgOverrideStatus *>(out_status), reinterpret_cast<const NcmProgramLocation *>(&loc));
|
||||
}
|
||||
|
||||
Result AtmospherePinProgram(PinId *out, const ncm::ProgramLocation &loc, const cfg::OverrideStatus &status) {
|
||||
static_assert(sizeof(*out) == sizeof(u64), "PinId definition!");
|
||||
static_assert(sizeof(status) == sizeof(CfgOverrideStatus), "CfgOverrideStatus definition!");
|
||||
return ldrPmAtmospherePinProgram(reinterpret_cast<u64 *>(out), reinterpret_cast<const NcmProgramLocation *>(&loc), reinterpret_cast<const CfgOverrideStatus *>(&status));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user