mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-06 11:22:15 +02:00
Merge 91056473df
into 80439a186b
This commit is contained in:
commit
74e2ebdf1d
@ -14,9 +14,31 @@ typedef struct {
|
||||
u8 icon[0x20000];//JPEG
|
||||
} NsApplicationControlData;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8 title_type;
|
||||
u8 storage_id;
|
||||
u8 unk_02;
|
||||
u8 padding;
|
||||
u32 title_version;
|
||||
u64 title_id;
|
||||
} NsApplicationContentMetaStatus;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u64 title_id;
|
||||
u8 type;
|
||||
u8 unk_09;
|
||||
u8 unk_0A[6];
|
||||
u8 unk_10;
|
||||
u8 unk_11[7];
|
||||
} NsApplicationRecord;
|
||||
|
||||
Result nsInitialize(void);
|
||||
void nsExit(void);
|
||||
|
||||
Result nsListApplicationRecord(NsApplicationRecord* buffer, size_t size, int* out_entrycount);
|
||||
Result nsListApplicationContentMetaStatus(u64 title_id, u32 index, NsApplicationContentMetaStatus* buffer, size_t size, int* out_entrycount);
|
||||
Result nsGetApplicationControlData(u8 flag, u64 titleID, NsApplicationControlData* buffer, size_t size, size_t* actual_size);
|
||||
|
||||
/**
|
||||
@ -44,4 +66,4 @@ Result nsdevInitialize();
|
||||
void nsdevExit();
|
||||
|
||||
Result nsdevTerminateProcess(u64 pid);
|
||||
Result nsdevTerminateProgram(u64 tid);
|
||||
Result nsdevTerminateProgram(u64 tid);
|
||||
|
@ -92,6 +92,87 @@ static Result _nsGetInterface(Service* srv_out, u64 cmd_id) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result nsListApplicationRecord(NsApplicationRecord* buffer, size_t size, int* out_entrycount)
|
||||
{
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
ipcAddRecvBuffer(&c, buffer, size, 0);
|
||||
|
||||
struct
|
||||
{
|
||||
u64 magic;
|
||||
u64 cmd_id;
|
||||
u64 unk;
|
||||
} *raw;
|
||||
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||
|
||||
raw->magic = SFCI_MAGIC;
|
||||
raw->cmd_id = 0;
|
||||
raw->unk = 0;
|
||||
|
||||
Result rc = serviceIpcDispatch(&g_nsAppManSrv);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
IpcParsedCommand r;
|
||||
ipcParse(&r);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
u32 entry_count;
|
||||
} *resp = r.Raw;
|
||||
|
||||
rc = resp->result;
|
||||
|
||||
if (R_SUCCEEDED(rc) && out_entrycount) *out_entrycount = resp->entry_count;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result nsListApplicationContentMetaStatus(u64 title_id, u32 index, NsApplicationContentMetaStatus* buffer, size_t size, int* out_entrycount)
|
||||
{
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
ipcAddRecvBuffer(&c, buffer, size, 0);
|
||||
|
||||
struct
|
||||
{
|
||||
u64 magic;
|
||||
u64 cmd_id;
|
||||
u32 index;
|
||||
u64 titleID;
|
||||
} *raw;
|
||||
|
||||
raw = ipcPrepareHeader(&c, sizeof(*raw));
|
||||
|
||||
raw->magic = SFCI_MAGIC;
|
||||
raw->cmd_id = 601;
|
||||
raw->index = index;
|
||||
raw->titleID = title_id;
|
||||
|
||||
Result rc = serviceIpcDispatch(&g_nsAppManSrv);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
IpcParsedCommand r;
|
||||
ipcParse(&r);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
u32 entry_count;
|
||||
} *resp = r.Raw;
|
||||
|
||||
rc = resp->result;
|
||||
|
||||
if (R_SUCCEEDED(rc) && out_entrycount) *out_entrycount = resp->entry_count;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result nsGetApplicationControlData(u8 flag, u64 titleID, NsApplicationControlData* buffer, size_t size, size_t* actual_size) {
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
Loading…
Reference in New Issue
Block a user