libnx  v4.6.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 build_id[0x20];
27  u64 base_address;
28  u64 size;
30 
31 /// Initialize ldr:shel.
33 
34 /// Exit ldr:shel.
35 void ldrShellExit(void);
36 
37 /// Gets the Service object for the actual ldr:shel service session.
39 
40 /// Initialize ldr:dmnt.
42 
43 /// Exit ldr:dmnt.
44 void ldrDmntExit(void);
45 
46 /// Gets the Service object for the actual ldr:dmnt service session.
48 
49 /// Initialize ldr:pm.
51 
52 /// Exit ldr:pm.
53 void ldrPmExit(void);
54 
55 /// Gets the Service object for the actual ldr:pm service session.
57 
58 Result ldrShellSetProgramArguments(u64 program_id, const void *args, size_t args_size);
59 Result ldrShellFlushArguments(void);
60 
61 Result ldrDmntSetProgramArguments(u64 program_id, const void *args, size_t args_size);
62 Result ldrDmntFlushArguments(void);
63 Result ldrDmntGetProcessModuleInfo(u64 pid, LoaderModuleInfo *out_module_infos, size_t max_out_modules, s32 *num_out);
64 
65 Result ldrPmCreateProcess(u64 pin_id, u32 flags, Handle reslimit_h, Handle *out_process_h);
66 Result ldrPmGetProgramInfo(const NcmProgramLocation *loc, LoaderProgramInfo *out_program_info);
67 Result ldrPmPinProgram(const NcmProgramLocation *loc, u64 *out_pin_id);
68 Result ldrPmUnpinProgram(u64 pin_id);
69 Result ldrPmSetEnabledProgramVerification(bool enabled); ///< [10.0.0+]
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 ldrPmInitialize(void)
Initialize ldr:pm.
Definition: ldr.h:25
Definition: ldr.h:12
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