mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Added appletGetMainAppletAvailableUsers.
This commit is contained in:
parent
a17c73e783
commit
5090c54654
@ -1437,6 +1437,16 @@ Result appletGetCurrentApplicationId(u64 *titleID);
|
|||||||
*/
|
*/
|
||||||
Result appletRequestExitToSelf(void);
|
Result appletRequestExitToSelf(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets an array of userIDs for the MainApplet AvailableUsers.
|
||||||
|
* @note Only available with AppletType_LibraryApplet on [6.0.0+].
|
||||||
|
* @param[out] userIDs Output array of userIDs.
|
||||||
|
* @param[in] count Size of the userID array, must be at least ACC_USER_LIST_SIZE.
|
||||||
|
* @param[out] flag When true, this indicates that no users are available.
|
||||||
|
* @param[out] total_out Total output entries. This is -1 when flag is true.
|
||||||
|
*/
|
||||||
|
Result appletGetMainAppletAvailableUsers(u128 *userIDs, s32 count, bool *flag, s32 *total_out);
|
||||||
|
|
||||||
// IFunctions for AppletType_OverlayApplet (IOverlayFunctions).
|
// IFunctions for AppletType_OverlayApplet (IOverlayFunctions).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4252,6 +4252,50 @@ Result appletRequestExitToSelf(void) {
|
|||||||
return _appletCmdNoIO(&g_appletILibraryAppletSelfAccessor, 80);
|
return _appletCmdNoIO(&g_appletILibraryAppletSelfAccessor, 80);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Result appletGetMainAppletAvailableUsers(u128 *userIDs, s32 count, bool *flag, s32 *total_out) {
|
||||||
|
if (__nx_applet_type != AppletType_LibraryApplet)
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_NotInitialized);
|
||||||
|
if (hosversionBefore(6,0,0))
|
||||||
|
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||||
|
|
||||||
|
IpcCommand c;
|
||||||
|
ipcInitialize(&c);
|
||||||
|
|
||||||
|
ipcAddRecvBuffer(&c, userIDs, count*sizeof(u128), BufferType_Normal);
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 cmd_id;
|
||||||
|
} *raw;
|
||||||
|
|
||||||
|
raw = serviceIpcPrepareHeader(&g_appletILibraryAppletSelfAccessor, &c, sizeof(*raw));
|
||||||
|
|
||||||
|
raw->magic = SFCI_MAGIC;
|
||||||
|
raw->cmd_id = 110;
|
||||||
|
|
||||||
|
Result rc = serviceIpcDispatch(&g_appletILibraryAppletSelfAccessor);
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
IpcParsedCommand r;
|
||||||
|
struct {
|
||||||
|
u64 magic;
|
||||||
|
u64 result;
|
||||||
|
u8 flag;
|
||||||
|
s32 total_out;
|
||||||
|
} *resp;
|
||||||
|
|
||||||
|
serviceIpcParse(&g_appletILibraryAppletSelfAccessor, &r, sizeof(*resp));
|
||||||
|
resp = r.Raw;
|
||||||
|
|
||||||
|
rc = resp->result;
|
||||||
|
|
||||||
|
if (R_SUCCEEDED(rc) && flag) *flag = resp->flag!=0;
|
||||||
|
if (R_SUCCEEDED(rc) && total_out) *total_out = resp->total_out;
|
||||||
|
}
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
// IOverlayFunctions
|
// IOverlayFunctions
|
||||||
|
|
||||||
Result appletBeginToWatchShortHomeButtonMessage(void) {
|
Result appletBeginToWatchShortHomeButtonMessage(void) {
|
||||||
|
Loading…
Reference in New Issue
Block a user