mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Added appletGetAppletResourceUsageInfo. Added struct AppletResourceUsageInfo.
This commit is contained in:
parent
19741cb103
commit
e7a09f7be7
@ -261,6 +261,14 @@ typedef struct {
|
||||
u8 unused[0x14]; ///< Unused. Default is 0.
|
||||
} AppletApplicationAttribute;
|
||||
|
||||
/// AppletResourceUsageInfo, from \ref appletGetAppletResourceUsageInfo.
|
||||
typedef struct {
|
||||
u32 counter0; ///< Unknown counter.
|
||||
u32 counter1; ///< Unknown counter.
|
||||
u32 counter2; ///< Output from ns cmd GetRightsEnvironmentCountForDebug.
|
||||
u8 unused[0x14]; ///< Always zero.
|
||||
} AppletResourceUsageInfo;
|
||||
|
||||
/// Initialize applet, called automatically during app startup.
|
||||
Result appletInitialize(void);
|
||||
|
||||
@ -1720,6 +1728,13 @@ Result appletInvalidateTransitionLayer(void);
|
||||
*/
|
||||
Result appletRequestLaunchApplicationWithUserAndArgumentForDebug(u64 titleID, u128 *userIDs, size_t total_userIDs, bool flag, const void* buffer, size_t size);
|
||||
|
||||
/**
|
||||
* @brief Gets the \ref AppletResourceUsageInfo.
|
||||
* @note Only available on [6.0.0+].
|
||||
* @param[out] info \ref AppletResourceUsageInfo
|
||||
*/
|
||||
Result appletGetAppletResourceUsageInfo(AppletResourceUsageInfo *info);
|
||||
|
||||
// State / other
|
||||
|
||||
/**
|
||||
|
@ -4837,6 +4837,44 @@ Result appletRequestLaunchApplicationWithUserAndArgumentForDebug(u64 titleID, u1
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result appletGetAppletResourceUsageInfo(AppletResourceUsageInfo *info) {
|
||||
if (hosversionBefore(6,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
IpcCommand c;
|
||||
ipcInitialize(&c);
|
||||
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 cmd_id;
|
||||
} *raw;
|
||||
|
||||
raw = serviceIpcPrepareHeader(&g_appletIDebugFunctions, &c, sizeof(*raw));
|
||||
|
||||
raw->magic = SFCI_MAGIC;
|
||||
raw->cmd_id = 40;
|
||||
|
||||
Result rc = serviceIpcDispatch(&g_appletIDebugFunctions);
|
||||
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
IpcParsedCommand r;
|
||||
struct {
|
||||
u64 magic;
|
||||
u64 result;
|
||||
AppletResourceUsageInfo info;
|
||||
} *resp;
|
||||
|
||||
serviceIpcParse(&g_appletIDebugFunctions, &r, sizeof(*resp));
|
||||
resp = r.Raw;
|
||||
|
||||
rc = resp->result;
|
||||
|
||||
if (R_SUCCEEDED(rc) && info) *info = resp->info;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
// State / other
|
||||
|
||||
u8 appletGetOperationMode(void) {
|
||||
|
Loading…
Reference in New Issue
Block a user