mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
Added NsApplicationControlSource for use with nsGetApplicationControlData. Fixed actual_size handling for nsGetApplicationControlData.
This commit is contained in:
parent
653a1a6b9a
commit
e483dc87a0
@ -22,6 +22,13 @@ typedef enum {
|
||||
NsShellEvent_Debug = 4, ///< Debug
|
||||
} NsShellEvent;
|
||||
|
||||
/// ApplicationControlSource
|
||||
typedef enum {
|
||||
NsApplicationControlSource_CacheOnly = 0, ///< Returns data from cache.
|
||||
NsApplicationControlSource_Storage = 1, ///< Returns data from storage if not present in cache.
|
||||
NsApplicationControlSource_StorageOnly = 2, ///< Returns data from storage without using cache.
|
||||
} NsApplicationControlSource;
|
||||
|
||||
/// BackgroundNetworkUpdateState
|
||||
typedef enum {
|
||||
NsBackgroundNetworkUpdateState_None = 0, ///< No sysupdate task exists.
|
||||
@ -140,7 +147,7 @@ Result nsListApplicationContentMetaStatus(u64 titleID, s32 index, NsApplicationC
|
||||
* @param[in] size Size of the buffer.
|
||||
* @param[out] actual_size Actual output size.
|
||||
*/
|
||||
Result nsGetApplicationControlData(u8 flag, u64 titleID, NsApplicationControlData* buffer, size_t size, u64* actual_size);
|
||||
Result nsGetApplicationControlData(NsApplicationControlSource source, u64 titleID, NsApplicationControlData* buffer, size_t size, u64* actual_size);
|
||||
|
||||
/**
|
||||
* @brief Returns the total storage capacity (used + free) from content manager services.
|
||||
|
@ -186,16 +186,20 @@ Result nsListApplicationContentMetaStatus(u64 titleID, s32 index, NsApplicationC
|
||||
);
|
||||
}
|
||||
|
||||
Result nsGetApplicationControlData(u8 flag, u64 titleID, NsApplicationControlData* buffer, size_t size, u64* actual_size) {
|
||||
Result nsGetApplicationControlData(NsApplicationControlSource source, u64 titleID, NsApplicationControlData* buffer, size_t size, u64* actual_size) {
|
||||
const struct {
|
||||
u8 flag;
|
||||
u8 source;
|
||||
u64 titleID;
|
||||
} in = { flag, titleID };
|
||||
} in = { source, titleID };
|
||||
|
||||
return serviceDispatchInOut(&g_nsAppManSrv, 400, in, *actual_size,
|
||||
u32 tmp=0;
|
||||
|
||||
Result rc = serviceDispatchInOut(&g_nsAppManSrv, 400, in, tmp,
|
||||
.buffer_attrs = { SfBufferAttr_HipcMapAlias | SfBufferAttr_Out },
|
||||
.buffers = { { buffer, size } },
|
||||
);
|
||||
if (R_SUCCEEDED(rc) && actual_size) *actual_size = tmp;
|
||||
return rc;
|
||||
}
|
||||
|
||||
Result nsGetTotalSpaceSize(FsStorageId storage_id, u64 *size) {
|
||||
|
Loading…
Reference in New Issue
Block a user