mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-20 20:22:38 +02:00
ldr:pm: Update ProgramInfo
This commit is contained in:
parent
5d5d13c9d6
commit
250a5777f7
@ -20,6 +20,20 @@ typedef struct {
|
||||
u32 acid_fac_size;
|
||||
u32 aci0_fah_size;
|
||||
u8 ac_buffer[0x3E0];
|
||||
} LoaderProgramInfoV1;
|
||||
|
||||
typedef struct {
|
||||
u8 main_thread_priority;
|
||||
u8 default_cpu_id;
|
||||
u16 application_type;
|
||||
u32 main_thread_stack_size;
|
||||
u64 program_id;
|
||||
u32 acid_sac_size;
|
||||
u32 aci0_sac_size;
|
||||
u32 acid_fac_size;
|
||||
u32 aci0_fah_size;
|
||||
u8 unused_20[0x10];
|
||||
u8 ac_buffer[0x3E0];
|
||||
} LoaderProgramInfo;
|
||||
|
||||
typedef struct {
|
||||
@ -63,7 +77,8 @@ Result ldrDmntFlushArguments(void);
|
||||
Result ldrDmntGetProcessModuleInfo(u64 pid, LoaderModuleInfo *out_module_infos, size_t max_out_modules, s32 *num_out);
|
||||
|
||||
Result ldrPmCreateProcess(u64 pin_id, u32 flags, Handle reslimit_h, Handle *out_process_h);
|
||||
Result ldrPmGetProgramInfo(const NcmProgramLocation *loc, LoaderProgramInfo *out_program_info);
|
||||
Result ldrPmGetProgramInfo(const NcmProgramLocation *loc, LoaderProgramInfo *out_program_info); ///< [19.0.0+/Atmosphere]
|
||||
Result ldrPmGetProgramInfoV1(const NcmProgramLocation *loc, LoaderProgramInfoV1 *out_program_info); ///< [1.0.0-18.1.0/Non-Atmosphere]
|
||||
Result ldrPmPinProgram(const NcmProgramLocation *loc, u64 *out_pin_id);
|
||||
Result ldrPmUnpinProgram(u64 pin_id);
|
||||
Result ldrPmSetEnabledProgramVerification(bool enabled); ///< [10.0.0+]
|
||||
|
@ -94,6 +94,19 @@ Result ldrPmCreateProcess(u64 pin_id, u32 flags, Handle reslimit_h, Handle *out_
|
||||
}
|
||||
|
||||
Result ldrPmGetProgramInfo(const NcmProgramLocation *loc, LoaderProgramInfo *out_program_info) {
|
||||
if (!hosversionIsAtmosphere() && hosversionBefore(19, 0, 0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
return serviceDispatchIn(&g_ldrPmSrv, 1, *loc,
|
||||
.buffer_attrs = { SfBufferAttr_Out | SfBufferAttr_HipcPointer | SfBufferAttr_FixedSize },
|
||||
.buffers = { { out_program_info, sizeof(*out_program_info) } },
|
||||
);
|
||||
}
|
||||
|
||||
Result ldrPmGetProgramInfoV1(const NcmProgramLocation *loc, LoaderProgramInfoV1 *out_program_info) {
|
||||
if (hosversionIsAtmosphere() || hosversionAtLeast(19,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
return serviceDispatchIn(&g_ldrPmSrv, 1, *loc,
|
||||
.buffer_attrs = { SfBufferAttr_Out | SfBufferAttr_HipcPointer | SfBufferAttr_FixedSize },
|
||||
.buffers = { { out_program_info, sizeof(*out_program_info) } },
|
||||
|
Loading…
Reference in New Issue
Block a user