libnx  v4.8.0
ldr.h
Go to the documentation of this file.
1 /**
2  * @file ldr.h
3  * @brief Loader (ldr*) service IPC wrapper.
4  * @author SciresM
5  * @copyright libnx Authors
6  */
7 #pragma once
8 #include "../types.h"
9 #include "../sf/service.h"
10 #include "../services/ncm_types.h"
11 
12 typedef struct {
13  u8 main_thread_priority;
14  u8 default_cpu_id;
15  u16 application_type;
16  u32 main_thread_stack_size;
17  u64 program_id;
18  u32 acid_sac_size;
19  u32 aci0_sac_size;
20  u32 acid_fac_size;
21  u32 aci0_fah_size;
22  u8 ac_buffer[0x3E0];
24 
25 typedef struct {
26  u8 main_thread_priority;
27  u8 default_cpu_id;
28  u16 application_type;
29  u32 main_thread_stack_size;
30  u64 program_id;
31  u32 acid_sac_size;
32  u32 aci0_sac_size;
33  u32 acid_fac_size;
34  u32 aci0_fah_size;
35  u8 unused_20[0x10];
36  u8 ac_buffer[0x3E0];
38 
39 typedef struct {
40  u8 build_id[0x20];
41  u64 base_address;
42  u64 size;
44 
45 /// Initialize ldr:shel.
47 
48 /// Exit ldr:shel.
49 void ldrShellExit(void);
50 
51 /// Gets the Service object for the actual ldr:shel service session.
53 
54 /// Initialize ldr:dmnt.
56 
57 /// Exit ldr:dmnt.
58 void ldrDmntExit(void);
59 
60 /// Gets the Service object for the actual ldr:dmnt service session.
62 
63 /// Initialize ldr:pm.
65 
66 /// Exit ldr:pm.
67 void ldrPmExit(void);
68 
69 /// Gets the Service object for the actual ldr:pm service session.
71 
72 Result ldrShellSetProgramArguments(u64 program_id, const void *args, size_t args_size);
73 Result ldrShellFlushArguments(void);
74 
75 Result ldrDmntSetProgramArguments(u64 program_id, const void *args, size_t args_size);
76 Result ldrDmntFlushArguments(void);
77 Result ldrDmntGetProcessModuleInfo(u64 pid, LoaderModuleInfo *out_module_infos, size_t max_out_modules, s32 *num_out);
78 
79 Result ldrPmCreateProcess(u64 pin_id, u32 flags, Handle reslimit_h, Handle *out_process_h);
80 Result ldrPmGetProgramInfo(const NcmProgramLocation *loc, LoaderProgramInfo *out_program_info); ///< [19.0.0+/Atmosphere]
81 Result ldrPmGetProgramInfoV1(const NcmProgramLocation *loc, LoaderProgramInfoV1 *out_program_info); ///< [1.0.0-18.1.0/Non-Atmosphere]
82 Result ldrPmPinProgram(const NcmProgramLocation *loc, u64 *out_pin_id);
83 Result ldrPmUnpinProgram(u64 pin_id);
84 Result ldrPmSetEnabledProgramVerification(bool enabled); ///< [10.0.0+]
Result ldrPmGetProgramInfo(const NcmProgramLocation *loc, LoaderProgramInfo *out_program_info)
[19.0.0+/Atmosphere]
void ldrShellExit(void)
Exit ldr:shel.
void ldrDmntExit(void)
Exit ldr:dmnt.
Result ldrPmSetEnabledProgramVerification(bool enabled)
[10.0.0+]
Service * ldrPmGetServiceSession(void)
Gets the Service object for the actual ldr:pm service session.
Result ldrShellInitialize(void)
Initialize ldr:shel.
Result ldrDmntInitialize(void)
Initialize ldr:dmnt.
void ldrPmExit(void)
Exit ldr:pm.
Service * ldrShellGetServiceSession(void)
Gets the Service object for the actual ldr:shel service session.
Service * ldrDmntGetServiceSession(void)
Gets the Service object for the actual ldr:dmnt service session.
Result ldrPmGetProgramInfoV1(const NcmProgramLocation *loc, LoaderProgramInfoV1 *out_program_info)
[1.0.0-18.1.0/Non-Atmosphere]
Result ldrPmInitialize(void)
Initialize ldr:pm.
Definition: ldr.h:39
Definition: ldr.h:12
Definition: ldr.h:25
ProgramLocation.
Definition: ncm_types.h:173
Service object structure.
Definition: service.h:14
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
u32 Handle
Kernel object handle.
Definition: types.h:43
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20
u32 Result
Function error code result type.
Definition: types.h:44
int32_t s32
32-bit signed integer.
Definition: types.h:27
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21