libnx v4.9.0
Loading...
Searching...
No Matches
pgl.h
Go to the documentation of this file.
1/**
2 * @file pgl.h
3 * @brief PGL 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 "../sf/tipc.h"
11#include "../services/ncm_types.h"
12#include "../services/pm.h"
13
14/// LaunchFlag
15typedef enum {
16 PglLaunchFlag_None = 0,
17 PglLaunchFlag_EnableDetailedCrashReport = BIT(0),
18 PglLaunchFlag_EnableCrashReportScreenShotForProduction = BIT(1),
19 PglLaunchFlag_EnableCrashReportScreenShotForDevelop = BIT(2),
21
22/// SnapShotDumpType
23typedef enum {
24 PglSnapShotDumpType_None = 0,
25 PglSnapShotDumpType_Auto = 1,
26 PglSnapShotDumpType_Full = 2,
28
29typedef struct {
30 u64 id; ///< Program Id
31 u32 version; ///< Version
32 u8 content_type; ///< NcmContentType
33 u8 id_offset; ///< Id Offset
34 u8 reserved_0E[2]; ///< Padding
36
37typedef union {
38 Service s;
41
42/// Initialize pgl.
44
45/// Exit pgl.
46void pglExit(void);
47
48/// Gets the Service object for the actual pgl service session. Requires < 12.0.0
50
51/// Gets the TipcService object for the actual pgl service session. Requires 12.0.0+
53
54Result pglLaunchProgram(u64 *out_pid, const NcmProgramLocation *loc, u32 pm_launch_flags, u8 pgl_launch_flags);
55Result pglTerminateProcess(u64 pid);
56Result pglLaunchProgramFromHost(u64 *out_pid, const char *content_path, u32 pm_launch_flags);
57Result pglGetHostContentMetaInfo(PglContentMetaInfo *out, const char *content_path);
58Result pglGetApplicationProcessId(u64 *out);
59Result pglBoostSystemMemoryResourceLimit(u64 size);
60Result pglIsProcessTracked(bool *out, u64 pid);
61Result pglEnableApplicationCrashReport(bool en);
62Result pglIsApplicationCrashReportEnabled(bool *out);
63Result pglEnableApplicationAllThreadDumpOnCrash(bool en);
64Result pglTriggerApplicationSnapShotDumper(PglSnapShotDumpType dump_type, const char *arg);
65Result pglGetEventObserver(PglEventObserver *out);
66
67Result pglEventObserverGetProcessEvent(PglEventObserver *observer, Event *out);
68Result pglEventObserverGetProcessEventInfo(PglEventObserver *observer, PmProcessEventInfo *out);
69void pglEventObserverClose(PglEventObserver *observer);
Result pglInitialize(void)
Initialize pgl.
Service * pglGetServiceSessionCmif(void)
Gets the Service object for the actual pgl service session. Requires < 12.0.0.
void pglExit(void)
Exit pgl.
PglSnapShotDumpType
SnapShotDumpType.
Definition pgl.h:23
PglLaunchFlag
LaunchFlag.
Definition pgl.h:15
TipcService * pglGetServiceSessionTipc(void)
Gets the TipcService object for the actual pgl service session. Requires 12.0.0+.
Kernel-mode event structure.
Definition event.h:13
ProgramLocation.
Definition ncm_types.h:173
Definition pgl.h:29
u32 version
Version.
Definition pgl.h:31
u8 id_offset
Id Offset.
Definition pgl.h:33
u64 id
Program Id.
Definition pgl.h:30
u8 content_type
NcmContentType.
Definition pgl.h:32
ProcessEventInfo.
Definition pm.h:48
Service object structure.
Definition service.h:14
tipc Service object structure
Definition tipc.h:18
#define BIT(n)
Creates a bitmask from a bit number.
Definition types.h:54
uint64_t u64
64-bit unsigned integer.
Definition types.h:22
uint8_t u8
8-bit unsigned integer.
Definition types.h:19
u32 Result
Function error code result type.
Definition types.h:44
uint32_t u32
32-bit unsigned integer.
Definition types.h:21
Definition pgl.h:37