libnx v4.9.0
Loading...
Searching...
No Matches
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
12typedef 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
25typedef 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
39typedef struct {
40 u8 build_id[0x20];
41 u64 base_address;
42 u64 size;
44
45typedef struct {
46 u8 platform; ///< NcmContentMetaPlatform
47 u8 content_attributes; ///< FsContentAttributes
49
50/// Initialize ldr:shel.
52
53/// Exit ldr:shel.
54void ldrShellExit(void);
55
56/// Gets the Service object for the actual ldr:shel service session.
58
59/// Initialize ldr:dmnt.
61
62/// Exit ldr:dmnt.
63void ldrDmntExit(void);
64
65/// Gets the Service object for the actual ldr:dmnt service session.
67
68/// Initialize ldr:pm.
70
71/// Exit ldr:pm.
72void ldrPmExit(void);
73
74/// Gets the Service object for the actual ldr:pm service session.
76
77Result ldrShellSetProgramArguments(u64 program_id, const void *args, size_t args_size);
78Result ldrShellFlushArguments(void);
79
80Result ldrDmntSetProgramArguments(u64 program_id, const void *args, size_t args_size);
81Result ldrDmntFlushArguments(void);
82Result ldrDmntGetProcessModuleInfo(u64 pid, LoaderModuleInfo *out_module_infos, size_t max_out_modules, s32 *num_out);
83
84Result ldrPmCreateProcess(u64 pin_id, u32 flags, Handle reslimit_h, const LoaderProgramAttributes *attrs, Handle *out_process_h);
85Result ldrPmGetProgramInfo(const NcmProgramLocation *loc, const LoaderProgramAttributes *attrs, LoaderProgramInfo *out_program_info); ///< [19.0.0+/Atmosphere]
86Result ldrPmGetProgramInfoV1(const NcmProgramLocation *loc, LoaderProgramInfoV1 *out_program_info); ///< [1.0.0-18.1.0/Non-Atmosphere]
87Result ldrPmPinProgram(const NcmProgramLocation *loc, u64 *out_pin_id);
88Result ldrPmUnpinProgram(u64 pin_id);
89Result ldrPmSetEnabledProgramVerification(bool enabled); ///< [10.0.0+]
void ldrShellExit(void)
Exit ldr:shel.
void ldrDmntExit(void)
Exit ldr:dmnt.
Service * ldrDmntGetServiceSession(void)
Gets the Service object for the actual ldr:dmnt service session.
Result ldrPmSetEnabledProgramVerification(bool enabled)
[10.0.0+]
Result ldrShellInitialize(void)
Initialize ldr:shel.
Result ldrDmntInitialize(void)
Initialize ldr:dmnt.
void ldrPmExit(void)
Exit ldr:pm.
Service * ldrPmGetServiceSession(void)
Gets the Service object for the actual ldr:pm service session.
Service * ldrShellGetServiceSession(void)
Gets the Service object for the actual ldr:shel 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.
Result ldrPmGetProgramInfo(const NcmProgramLocation *loc, const LoaderProgramAttributes *attrs, LoaderProgramInfo *out_program_info)
[19.0.0+/Atmosphere]
Definition ldr.h:39
Definition ldr.h:45
u8 platform
NcmContentMetaPlatform.
Definition ldr.h:46
u8 content_attributes
FsContentAttributes.
Definition ldr.h:47
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