ncm: add new 13.0.0 commands

This commit is contained in:
Michael Scire 2021-09-18 12:47:51 -07:00
parent 49507b86a8
commit 749c5c6157
2 changed files with 26 additions and 6 deletions

View File

@ -80,6 +80,8 @@ Result ncmContentStorageFlushPlaceHolder(NcmContentStorage* cs); ///< [3.0.0+]
Result ncmContentStorageGetSizeFromPlaceHolderId(NcmContentStorage* cs, s64* out_size, const NcmPlaceHolderId* placeholder_id); ///< [4.0.0+]
Result ncmContentStorageRepairInvalidFileAttribute(NcmContentStorage* cs); ///< [4.0.0+]
Result ncmContentStorageGetRightsIdFromPlaceHolderIdWithCache(NcmContentStorage* cs, NcmRightsId* out_rights_id, const NcmPlaceHolderId* placeholder_id, const NcmContentId* cache_content_id); ///< [8.0.0+]
Result ncmContentStorageRegisterPath(NcmContentStorage* cs, const NcmContentId* content_id, const char *path); ///< [13.0.0+]
Result ncmContentStorageClearRegisteredPath(NcmContentStorage* cs); ///< [13.0.0+]
void ncmContentMetaDatabaseClose(NcmContentMetaDatabase* db);
Result ncmContentMetaDatabaseSet(NcmContentMetaDatabase* db, const NcmContentMetaKey* key, const void* data, u64 data_size);

View File

@ -334,6 +334,24 @@ Result ncmContentStorageGetRightsIdFromPlaceHolderIdWithCache(NcmContentStorage*
return serviceDispatchInOut(&cs->s, 27, in, *out_rights_id);
}
Result ncmContentStorageRegisterPath(NcmContentStorage* cs, const NcmContentId* content_id, const char *path) {
if (hosversionBefore(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
char send_path[FS_MAX_PATH] = {0};
strncpy(send_path, path, FS_MAX_PATH-1);
send_path[FS_MAX_PATH-1] = 0;
return serviceDispatchIn(&cs->s, 28, *content_id,
.buffer_attrs = { SfBufferAttr_In | SfBufferAttr_HipcPointer },
.buffers = { { send_path, FS_MAX_PATH } },
);
}
Result ncmContentStorageClearRegisteredPath(NcmContentStorage* cs) {
if (hosversionBefore(13,0,0)) return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer);
return _ncmCmdNoIO(&cs->s, 29);
}
void ncmContentMetaDatabaseClose(NcmContentMetaDatabase* db) {
serviceClose(&db->s);
}