vitasdk
Documentation of the vitasdk
appmgr.h
Go to the documentation of this file.
1 
7 #ifndef _PSP2_APPMGR_H_
8 #define _PSP2_APPMGR_H_
9 
10 #include <vitasdk/build_utils.h>
11 #include <psp2/types.h>
12 #include <psp2/apputil.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 typedef enum SceAppMgrErrorCode {
19  SCE_APPMGR_ERROR_BUSY = 0x80802000,
20  SCE_APPMGR_ERROR_STATE = 0x80802013,
22  SCE_APPMGR_ERROR_INVALID = 0x8080201A,
25  SCE_APPMGR_ERROR_NOEXEC = 0x8080201F,
26  SCE_APPMGR_ERROR_BGM_PORT_BUSY = 0x80803000
28 
35 
40 
41 typedef enum SceAppMgrInfoBarColor {
45 
50 
56 
57 typedef struct SceAppMgrSystemEvent {
59  uint8_t reserved[60];
62 
63 typedef struct SceAppMgrSaveDataData {
64  int size;
65  unsigned int slotId;
67  uint8_t reserved[32];
69  int fileNum;
71  unsigned int* requiredSizeKB;
72  int unk_0x48;
75 
77  int size;
78  unsigned int slotId;
80  uint8_t reserved[32];
82  int fileNum;
86 
87 typedef struct SceAppMgrSaveDataSlot {
88  int size;
89  unsigned int slotId;
91  uint8_t reserved[116];
93  uint8_t reserved2[0x40];
96 
98  int size;
99  unsigned int slotId;
103 
104 typedef struct SceAppMgrAppState {
111 
112 typedef struct SceAppMgrBudgetInfo {
113  int size;
114  int app_mode;
115  int unk0;
116  unsigned int total_user_rw_mem;
117  unsigned int free_user_rw;
119  int unk1;
120  unsigned int total_extra_mem;
121  unsigned int free_extra_mem;
122  int unk2[2];
123  unsigned int total_phycont_mem;
124  unsigned int free_phycont_mem;
125  int unk3[10];
126  unsigned int total_cdram_mem;
127  unsigned int free_cdram_mem;
128  int reserved[9];
131 
132 typedef struct SceAppMgrExecOptParam SceAppMgrExecOptParam; // Missing struct
133 typedef struct SceAppMgrLaunchAppOptParam SceAppMgrLaunchAppOptParam; // Missing struct
134 
136  int reserved[64];
139 
140 #define SCE_APPMGR_MAX_APP_NAME_LENGTH (31)
141 
150 
159 
168 
177 
186 
195 
204 int sceAppMgrGetIdByName(SceUID *pid, const char *name);
205 
214 int sceAppMgrGetNameById(SceUID pid, char *name);
215 
222 
230 int sceAppMgrDestroyAppByName(const char *name);
231 
240 
249 
259 
270 
279 
289 int sceAppMgrGetAppParam(char *param);
290 
298 
306 
318 
330 int sceAppMgrLoadExec(const char *appPath, char * const argv[],
331  const SceAppMgrExecOptParam *optParam);
332 
343 int sceAppMgrLaunchAppByUri(int flags, const char *uri);
344 
354 int sceAppMgrLaunchAppByName2(const char *name, const char *param, SceAppMgrLaunchAppOptParam *optParam);
355 
365 int sceAppMgrLaunchAppByName(int flags, const char* name, const char* param);
366 
376 SceUID sceAppMgrLaunchAppByName2ForShell(const char *name, const char *param, SceAppMgrLaunchAppOptParam *optParam);
377 
389 int sceAppMgrGameDataMount(const char *app_path, const char *patch_path, const char *rif_path, char *mount_point);
390 
401 int sceAppMgrAppDataMount(int id, const char *mount_point);
402 
414 int sceAppMgrAppDataMountById(int id, const char *titleid, const char *mount_point);
415 
428 int sceAppMgrAppParamGetString(int pid, int param, char *string, SceSize length);
429 
441 int sceAppMgrGetDevInfo(const char *dev, uint64_t *max_size, uint64_t *free_size);
442 
453 int sceAppMgrMmsMount(int id, const char *mount_point);
454 
464 int sceAppMgrPspSaveDataRootMount(const char *mount_point);
465 
476 int sceAppMgrWorkDirMount(int id, const char *mount_point);
477 
489 int sceAppMgrWorkDirMountById(int id, const char *titleid, const char *mount_point);
490 
500 int sceAppMgrUmount(const char *mount_point);
501 
511 int sceAppMgrConvertVs0UserDrivePath(char *path, char *mount_point, int unk);
512 
522 int sceAppMgrGetRawPath(char *path, char *resolved_path, int resolved_path_size);
523 
532 int sceAppMgrGetRawPathOfApp0ByAppIdForShell(int appId, char resolved_path[292]);
533 
544 
545 typedef struct SceAppMgrCoredumpState {
548  int progress; // 0-100
552  char path[0x400];
559 
568 
569 // missing structs
571 typedef struct SceAppMgrAppInfo SceAppMgrAppInfo;
572 
574 
585 
586 #ifdef __cplusplus
587 }
588 #endif
589 
590 #endif /* _PSP2_APPMGR_H_ */
SceBool extra_mem_allowed
Flag for extra memory accessibility.
Definition: appmgr.h:118
int unk1
Unknown Data.
Definition: appmgr.h:119
int sceAppMgrDestroyOtherApp(void)
Destroy other apps.
int unk_0x48
Definition: appmgr.h:72
int sceAppMgrGetIdByName(SceUID *pid, const char *name)
Get Process ID by Title ID.
unsigned int slotId
Save slot to use.
Definition: appmgr.h:89
unsigned int slotId
Save slot to use.
Definition: appmgr.h:99
int sceAppMgrGetDevInfo(const char *dev, uint64_t *max_size, uint64_t *free_size)
Get device info.
SceSize path_len
Definition: appmgr.h:551
int data_0x41C
Definition: appmgr.h:554
unsigned int total_cdram_mem
Total amount of accessible CDRAM memory.
Definition: appmgr.h:126
int sceAppMgrWorkDirMountById(int id, const char *titleid, const char *mount_point)
Mount working directory by Title ID.
int sceAppMgrSaveDataSlotGetParam(SceAppMgrSaveDataSlot *data)
Get current param of a savedata slot.
SceBool isSystemUiOverlaid
Definition: appmgr.h:107
SceAppMgrApplicationMode
Definition: appmgr.h:51
int data_0x418
Definition: appmgr.h:553
SceAppMgrInfoBarTransparency
Definition: appmgr.h:46
int fileNum
Number of files to delete.
Definition: appmgr.h:82
struct SceAppMgrLaunchAppOptParam SceAppMgrLaunchAppOptParam
Definition: appmgr.h:133
struct SceAppMgrAppInfo SceAppMgrAppInfo
Definition: appmgr.h:571
SceAppUtilSaveDataFile * files
Pointer to an array of files.
Definition: appmgr.h:81
int unk2[2]
Unknown Data.
Definition: appmgr.h:122
int sceAppMgrSaveDataDataRemove(SceAppMgrSaveDataDataDelete *data)
Remove data on savedata0: partition.
unsigned int total_phycont_mem
Total amount of accessible physically contiguous memory.
Definition: appmgr.h:123
int sceAppMgrLaunchAppByName2(const char *name, const char *param, SceAppMgrLaunchAppOptParam *optParam)
Start an application by Title ID.
int size
Must be 0x88.
Definition: appmgr.h:113
SceAppUtilSaveDataMountPoint mountPoint
Savedata mountpoint.
Definition: appmgr.h:100
int sceAppMgrLaunchAppByUri(int flags, const char *uri)
Start an application by URI.
unsigned int free_extra_mem
Free amount of accessible extra memory.
Definition: appmgr.h:121
int sceAppMgrAcquireBgmPort(void)
Obtains the BGM port, even when it is not in front.
unsigned int * requiredSizeKB
Required size in KBs.
Definition: appmgr.h:71
struct SceAppMgrExecOptParam SceAppMgrExecOptParam
Definition: appmgr.h:132
uint8_t reserved[32]
Reserved data.
Definition: appmgr.h:67
SceUInt32 systemEventNum
Definition: appmgr.h:105
SceUInt8 reserved[116]
Definition: appmgr.h:108
unsigned int slotId
Save slot to use.
Definition: appmgr.h:78
int size
Must be 0x18.
Definition: appmgr.h:98
int reserved[64]
Reserved data.
Definition: appmgr.h:136
SceAppUtilSaveDataSlotParam * slotParam
Save slot params.
Definition: appmgr.h:66
char path[0x400]
Definition: appmgr.h:552
int sceAppMgrSaveDataSlotCreate(SceAppMgrSaveDataSlot *data)
Create a savedata slot.
unsigned int slotId
Save slot to use.
Definition: appmgr.h:65
unsigned int free_cdram_mem
Free amount of accessible CDRAM memory.
Definition: appmgr.h:127
int sceAppMgrReleaseBgmPort(void)
Release acquired BGM port.
unsigned int total_user_rw_mem
Total amount of accessible USER_RW memory.
Definition: appmgr.h:116
int unk0
Unknown Data.
Definition: appmgr.h:115
int _sceAppMgrGetAppState(SceAppMgrAppState *appState, SceSize len, uint32_t version)
Get an application state.
int sceAppMgrGetRawPath(char *path, char *resolved_path, int resolved_path_size)
Get raw path for a given path.
int systemEvent
One of SceAppMgrSystemEventType.
Definition: appmgr.h:58
int size
Must be 0x44.
Definition: appmgr.h:77
SceUID sceAppMgrGetProcessIdByAppIdForShell(SceInt32 appId)
Get PID of an application for Shell.
int is_coredump_completed
Definition: appmgr.h:549
struct SceAppMgrDrmOpenParam SceAppMgrDrmOpenParam
Definition: appmgr.h:570
int sceAppMgrLoadExec(const char *appPath, char *const argv[], const SceAppMgrExecOptParam *optParam)
Load and start a SELF executable.
SceAppMgrErrorCode
Definition: appmgr.h:18
int sceAppMgrSetInfobarState(SceAppMgrInfoBarVisibility visibility, SceAppMgrInfoBarColor color, SceAppMgrInfoBarTransparency transparency)
Set infobar state.
uint8_t reserved2[0x40]
Definition: appmgr.h:93
int sceAppMgrSaveDataSlotDelete(SceAppMgrSaveDataSlotDelete *data)
Delete a savedata slot.
int sceAppMgrLaunchAppByName(int flags, const char *name, const char *param)
Start an Application by Title ID.
uint8_t reserved[116]
Reserved data.
Definition: appmgr.h:91
int sceAppMgrDestroyAppByAppId(SceInt32 appId)
Destroy an application by Application ID.
int sceAppMgrAppParamGetString(int pid, int param, char *string, SceSize length)
Get application params from SFO descriptor.
int data_0x420
Definition: appmgr.h:555
int sceAppMgrAppDataMount(int id, const char *mount_point)
Mount application data.
int data_0x10
Definition: appmgr.h:550
SceAppMgrInfoBarColor
Definition: appmgr.h:41
unsigned int free_phycont_mem
Free amount of accessible physically contiguous memory.
Definition: appmgr.h:124
SceAppUtilSaveDataMountPoint mountPoint
Savedata mountpoint.
Definition: appmgr.h:83
SceInt32 sceAppMgrGetAppInfo(const char *unk, SceAppMgrAppState *state)
Get AppInfo via syscall directly.
int sceAppMgrConvertVs0UserDrivePath(char *path, char *mount_point, int unk)
Convert vs0 path string to a new one usable by applications.
int size
Must be 0x418.
Definition: appmgr.h:88
int fileNum
Number of files to save.
Definition: appmgr.h:69
VITASDK_BUILD_ASSERT_EQ(0x40, SceAppMgrSystemEvent)
int sceAppMgrAppDataMountById(int id, const char *titleid, const char *mount_point)
Mount application data by Title ID.
int size
Must be 0x4C.
Definition: appmgr.h:64
int sceAppMgrGetRunningAppIdListForShell(SceInt32 *appIds, int count)
Get a list of running applications.
SceUID sceAppMgrLaunchAppByName2ForShell(const char *name, const char *param, SceAppMgrLaunchAppOptParam *optParam)
Start an application by Title ID for Shell.
int sceAppMgrWorkDirMount(int id, const char *mount_point)
Mount working directory.
int sceAppMgrPspSaveDataRootMount(const char *mount_point)
Mount PSPEmu virtual memory stick.
uint8_t reserved[60]
Reserved data.
Definition: appmgr.h:59
SceAppUtilSaveDataSlotParam * slotParam
Save slot params.
Definition: appmgr.h:79
int progress
Definition: appmgr.h:548
SceAppUtilSaveDataMountPoint mountPoint
Savedata mountpoint.
Definition: appmgr.h:92
uint8_t reserved[32]
Reserved data.
Definition: appmgr.h:80
int sceAppMgrGetBudgetInfo(SceAppMgrBudgetInfo *info)
Get memory budget info for a running system application.
SceUInt32 appEventNum
Definition: appmgr.h:106
int sceAppMgrSaveDataSlotSetParam(SceAppMgrSaveDataSlot *data)
Set current param of a savedata slot.
int process_state
Definition: appmgr.h:547
SceAppUtilSaveDataFile * files
Pointer to an array of files.
Definition: appmgr.h:68
SceAppUtilSaveDataMountPoint mountPoint
Savedata mountpoint.
Definition: appmgr.h:70
int reserved[9]
Reserved data.
Definition: appmgr.h:128
int app_mode
One of SceAppMgrApplicationMode.
Definition: appmgr.h:114
SceAppMgrSystemEventType
Definition: appmgr.h:29
int unk3[10]
Unknown Data.
Definition: appmgr.h:125
SceUID pid
Definition: appmgr.h:546
int sceAppMgrSaveDataDataSave(SceAppMgrSaveDataData *data)
Save data on savedata0: partition.
unsigned int free_user_rw
Free amount of accessible USER_RW memory.
Definition: appmgr.h:117
int sceAppMgrGetRawPathOfApp0ByAppIdForShell(int appId, char resolved_path[292])
Get the real/resolved path of app0: (where it's actually mounted)
int sceAppMgrGetCoredumpStateForShell(SceAppMgrCoredumpState *state)
Get current coredump state for shell.
int sceAppMgrUmount(const char *mount_point)
Unmount a mountpoint.
int sceAppMgrMmsMount(int id, const char *mount_point)
Mount application data (PSPEmu)
int data_0x424
Definition: appmgr.h:556
int sceAppMgrDestroyAppByName(const char *name)
Destroy an application by Title ID.
int sceAppMgrReceiveSystemEvent(SceAppMgrSystemEvent *systemEvent)
Receive system event.
int sceAppMgrGetNameById(SceUID pid, char *name)
Get Title ID by Process ID.
SceAppMgrInfoBarVisibility
Definition: appmgr.h:36
unsigned int total_extra_mem
Total amount of accessible extra memory.
Definition: appmgr.h:120
int sceAppMgrGetAppParam(char *param)
Copies app param to an array.
SceInt32 sceAppMgrDrmOpen(const SceAppMgrDrmOpenParam *param)
SceAppUtilSaveDataSlotParam slotParam
Save slot params.
Definition: appmgr.h:90
int sceAppMgrGameDataMount(const char *app_path, const char *patch_path, const char *rif_path, char *mount_point)
Mount game data.
@ SCE_APPMGR_APPLICATION_MODE_B
Application with physically contiguous memory access.
Definition: appmgr.h:53
@ SCE_APPMGR_APPLICATION_MODE_C
Application with physically contiguous memory and extra memory access.
Definition: appmgr.h:54
@ SCE_APPMGR_APPLICATION_MODE_A
Application without physically contiguous memory access.
Definition: appmgr.h:52
@ SCE_APPMGR_INFOBAR_TRANSPARENCY_OPAQUE
Definition: appmgr.h:47
@ SCE_APPMGR_INFOBAR_TRANSPARENCY_TRANSLUCENT
Definition: appmgr.h:48
@ SCE_APPMGR_ERROR_TOO_LONG_ARGV
argv is too long
Definition: appmgr.h:23
@ SCE_APPMGR_ERROR_NULL_POINTER
NULL pointer.
Definition: appmgr.h:21
@ SCE_APPMGR_ERROR_BGM_PORT_BUSY
BGM port was occupied and could not be secured.
Definition: appmgr.h:26
@ SCE_APPMGR_ERROR_BUSY
Busy.
Definition: appmgr.h:19
@ SCE_APPMGR_ERROR_NOEXEC
The process is not authorized to run this function.
Definition: appmgr.h:25
@ SCE_APPMGR_ERROR_INVALID
Invalid param.
Definition: appmgr.h:22
@ SCE_APPMGR_ERROR_INVALID_SELF_PATH
Invalid SELF path.
Definition: appmgr.h:24
@ SCE_APPMGR_ERROR_STATE
Invalid state.
Definition: appmgr.h:20
@ SCE_APPMGR_INFOBAR_COLOR_WHITE
Definition: appmgr.h:43
@ SCE_APPMGR_INFOBAR_COLOR_BLACK
Definition: appmgr.h:42
@ SCE_APPMGR_SYSTEMEVENT_ON_RESUME
Definition: appmgr.h:30
@ SCE_APPMGR_SYSTEMEVENT_ON_STORE_PURCHASE
Definition: appmgr.h:31
@ SCE_APPMGR_SYSTEMEVENT_ON_NP_MESSAGE_ARRIVED
Definition: appmgr.h:32
@ SCE_APPMGR_SYSTEMEVENT_ON_STORE_REDEMPTION
Definition: appmgr.h:33
@ SCE_APPMGR_INFOBAR_VISIBILITY_VISIBLE
Definition: appmgr.h:38
@ SCE_APPMGR_INFOBAR_VISIBILITY_INVISIBLE
Definition: appmgr.h:37
Definition: appmgr.h:104
Definition: appmgr.h:112
Definition: appmgr.h:545
Definition: appmgr.h:135
Definition: appmgr.h:63
Definition: appmgr.h:76
Definition: appmgr.h:87
Definition: appmgr.h:97
Definition: appmgr.h:57
Definition: apputil.h:133
Definition: apputil.h:77
Definition: apputil.h:110
uint32_t length
Definition: bt.h:7
uint16_t version
Definition: kbl.h:0
char titleid[0xC]
Title id of the process where the event occurred.
Definition: debug.h:4
int flags
Event flags.
Definition: debug.h:3
SceUID pid
Definition: debug.h:1
int SceBool
Definition: types.h:59
int32_t SceInt32
Definition: types.h:44
unsigned int SceSize
Definition: types.h:56
int SceUID
UIDs are used to describe many different kernel objects.
Definition: types.h:90
uint32_t SceUInt32
Definition: types.h:45
uint8_t SceUInt8
Definition: types.h:36