mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 04:22:50 +02:00
ncm/fs: add new 17.0.0 commands
This commit is contained in:
parent
cb6f366a2a
commit
25a8f21796
@ -405,6 +405,8 @@ Result fsOpenSdCardDetectionEventNotifier(FsEventNotifier* out);
|
||||
|
||||
Result fsIsSignedSystemPartitionOnSdCardValid(bool *out);
|
||||
|
||||
Result fsGetProgramId(u64* out, const char *path, FsContentAttributes attr); ///< [17.0.0+]
|
||||
|
||||
/// Retrieves the rights id corresponding to the content path. Only available on [2.0.0-15.0.1].
|
||||
Result fsGetRightsIdByPath(const char* path, FsRightsId* out_rights_id);
|
||||
|
||||
|
@ -83,6 +83,7 @@ Result ncmContentStorageRepairInvalidFileAttribute(NcmContentStorage* cs); ///<
|
||||
Result ncmContentStorageGetRightsIdFromPlaceHolderIdWithCache(NcmContentStorage* cs, NcmRightsId* out_rights_id, const NcmPlaceHolderId* placeholder_id, const NcmContentId* cache_content_id, FsContentAttributes attr); ///< [8.0.0+]
|
||||
Result ncmContentStorageRegisterPath(NcmContentStorage* cs, const NcmContentId* content_id, const char *path); ///< [13.0.0+]
|
||||
Result ncmContentStorageClearRegisteredPath(NcmContentStorage* cs); ///< [13.0.0+]
|
||||
Result ncmContentStorageGetProgramId(NcmContentStorage* cs, u64* out, const NcmContentId* content_id, FsContentAttributes attr); ///< [17.0.0+]
|
||||
|
||||
void ncmContentMetaDatabaseClose(NcmContentMetaDatabase* db);
|
||||
Result ncmContentMetaDatabaseSet(NcmContentMetaDatabase* db, const NcmContentMetaKey* key, const void* data, u64 data_size);
|
||||
@ -106,3 +107,4 @@ Result ncmContentMetaDatabaseListContentMetaInfo(NcmContentMetaDatabase* db, s32
|
||||
Result ncmContentMetaDatabaseGetAttributes(NcmContentMetaDatabase* db, const NcmContentMetaKey* key, u8* out);
|
||||
Result ncmContentMetaDatabaseGetRequiredApplicationVersion(NcmContentMetaDatabase* db, u32* out_version, const NcmContentMetaKey* key); ///< [2.0.0+]
|
||||
Result ncmContentMetaDatabaseGetContentIdByTypeAndIdOffset(NcmContentMetaDatabase* db, NcmContentId* out_content_id, const NcmContentMetaKey* key, NcmContentType type, u8 id_offset); ///< [5.0.0+]
|
||||
Result ncmContentMetaDatabaseGetPlatform(NcmContentMetaDatabase* db, u8* out, const NcmContentMetaKey* key); ///< [17.0.0+]
|
||||
|
@ -60,6 +60,11 @@ typedef enum {
|
||||
NcmContentInstallType_Unknown = 7, ///< Unknown
|
||||
} NcmContentInstallType;
|
||||
|
||||
/// ContentMetaPlatform
|
||||
typedef enum {
|
||||
NcmContentMetaPlatform_Nx = 0, ///< Nx
|
||||
} NcmContentMetaPlatform;
|
||||
|
||||
/// ContentId
|
||||
typedef struct {
|
||||
u8 c[0x10]; ///< Id
|
||||
|
@ -538,6 +538,20 @@ Result fsIsSignedSystemPartitionOnSdCardValid(bool *out) {
|
||||
return _fsCmdNoInOutBool(&g_fsSrv, out, 640);
|
||||
}
|
||||
|
||||
Result fsGetProgramId(u64* out, const char *path, FsContentAttributes attr) {
|
||||
if (hosversionBefore(17,0,0))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
char send_path[FS_MAX_PATH] = {0};
|
||||
strncpy(send_path, path, FS_MAX_PATH-1);
|
||||
|
||||
const u8 in = attr;
|
||||
return _fsObjectDispatchInOut(&g_fsSrv, 618, in, out,
|
||||
.buffer_attrs = { SfBufferAttr_HipcPointer | SfBufferAttr_In },
|
||||
.buffers = { { send_path, sizeof(send_path) } },
|
||||
);
|
||||
}
|
||||
|
||||
Result fsGetRightsIdByPath(const char* path, FsRightsId* out_rights_id) {
|
||||
if (!hosversionBetween(2, 16))
|
||||
return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
@ -407,6 +407,16 @@ Result ncmContentStorageClearRegisteredPath(NcmContentStorage* cs) {
|
||||
return _ncmCmdNoIO(&cs->s, 29);
|
||||
}
|
||||
|
||||
Result ncmContentStorageGetProgramId(NcmContentStorage* cs, u64* out, const NcmContentId* content_id, FsContentAttributes attr) {
|
||||
if (hosversionBefore(17,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
const struct {
|
||||
NcmContentId content_id;
|
||||
u8 attr;
|
||||
} in = { *content_id, attr };
|
||||
return serviceDispatchInOut(&cs->s, 30, in, *out);
|
||||
}
|
||||
|
||||
void ncmContentMetaDatabaseClose(NcmContentMetaDatabase* db) {
|
||||
serviceClose(&db->s);
|
||||
}
|
||||
@ -586,3 +596,9 @@ Result ncmContentMetaDatabaseGetContentIdByTypeAndIdOffset(NcmContentMetaDatabas
|
||||
} in = { type, id_offset, {0}, *key };
|
||||
return serviceDispatchInOut(&db->s, 20, in, *out_content_id);
|
||||
}
|
||||
|
||||
Result ncmContentMetaDatabaseGetPlatform(NcmContentMetaDatabase* db, u8* out, const NcmContentMetaKey* key) {
|
||||
if (hosversionBefore(17,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
|
||||
|
||||
return serviceDispatchInOut(&db->s, 26, *key, *out);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user