NCM services: Difference between revisions
IContentManager for 1.0.0 |
nn::ncm::IContentStorage -- commands > 15 don't exist on 1.0.0 |
||
Line 110: | Line 110: | ||
| 5 || GetIContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]]. | | 5 || GetIContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]]. | ||
|- | |- | ||
| ([[1.0.0]]) 6 || CloseAndLockIContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage-> | | ([[1.0.0]]) 6 || CloseAndLockIContentStorage || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentStorage->CloseAndFlushStorage(). | ||
|- | |- | ||
| ([[1.0.0]]) 7 || CloseAndLockIContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentMetaDatabase->CloseMetaDatabase(). | | ([[1.0.0]]) 7 || CloseAndLockIContentMetaDatabase || Takes a [[Filesystem_services#StorageId|StorageID]]. Calls IContentMetaDatabase->CloseMetaDatabase(). | ||
Line 134: | Line 134: | ||
! Cmd || Name || Notes | ! Cmd || Name || Notes | ||
|- | |- | ||
| 0 || [[# | | 0 || [[#GetUUID]] || Returns a random UUID for the Content Storage. | ||
|- | |- | ||
| 1 || || Takes two | | 1 || CreatePlaceholderEntryAndRegisteredDirectoryEntry || Takes two [[#NcaID]]s, and a u64 filesize. | ||
|- | |- | ||
| 2 || DeletePlaceholderEntry || Takes a | | 2 || DeletePlaceholderEntry || Takes a [[#NcaID]]. | ||
|- | |- | ||
| 3 || | | 3 || DoesPlaceholderEntryExist || Takes a [[#NcaID]]. | ||
|- | |- | ||
| 4 || WritePlaceholderEntry || Takes a [[#NcaID]], a u64-offset, and type-5 array. | | 4 || WritePlaceholderEntry || Takes a [[#NcaID]], a u64-offset, and type-5 array. | ||
|- | |- | ||
| 5 || MovePlaceholderToRegistered || Takes two | | 5 || MovePlaceholderToRegistered || Takes two [[#NcaID]]s, moves the Placeholder NCA content to the registered NCA path. | ||
|- | |- | ||
| 6 || | | 6 || DeleteRegisteredEntry || Takes a [[#NcaID]]. | ||
|- | |- | ||
| 7 || | | 7 || DoesRegisteredEntryExist || Takes a [[#NcaID]]. | ||
|- | |- | ||
| 8 || | | 8 || GetPathForRegisteredEntry || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]]. | ||
|- | |- | ||
| 9 || | | 9 || GetPathForPlaceholderEntry || Takes a [[#NcaID]]. Returns a [[Filesystem_services#ContentPath|Content Path]]. | ||
|- | |- | ||
| 10 || CleanPlaceholderDirectory || Deletes the Placeholder directory. | | 10 || CleanPlaceholderDirectory || Deletes and re-creates the Placeholder directory. | ||
|- | |- | ||
| 11 || | | 11 || GetNumberOfRegisteredEntries || This is like [[#GetRegisteredEntries]], but for the Placeholder directory. | ||
|- | |- | ||
| 12 || [[# | | 12 || [[#GetNumberOfRegisteredEntries]] || | ||
|- | |- | ||
| 13 || [[# | | 13 || [[#GetRegisteredEntries]] || | ||
|- | |- | ||
| 14 || [[# | | 14 || [[#GetRegisteredEntrySize]] || | ||
|- | |- | ||
| 15 || | | 15 || CloseAndFlushStorage || Closes/Flushes all resources for the storage, and causes all future IPC commands to the current session to return error 0xC805. | ||
|- | |- | ||
| 16 || || Takes three 0x10-sized entries. | | 16 || || Takes three 0x10-sized entries. | ||
|- | |- | ||
| 17 || | | 17 || SetPlaceholderEntrySize || Takes a [[#NcaID]], and a u64 size | ||
|- | |- | ||
| 18 || [[# | | 18 || [[#ReadRegisteredEntryRaw]] || | ||
|- | |- | ||
| 19 || | | 19 || GetPlaceholderEntryRightsID || Gets the Rights ID for the [[#NcaID]]'s placeholder path. | ||
|- | |- | ||
| 20 || | | 20 || GetRegisteredEntryRightsID || Gets the Rights ID for the [[#NcaID]]'s registered path | ||
|- | |- | ||
| 21 || WriteRegisteredPathForDebug || Takes a [[#NcaID]], a u64 size, and a type 5 buffer. On debug units, writes the buffer to the NCA's registered path. On retail units, this just aborts. | | 21 || WriteRegisteredPathForDebug || Takes a [[#NcaID]], a u64 size, and a type 5 buffer. On debug units, writes the buffer to the NCA's registered path. On retail units, this just aborts. | ||
|- | |- | ||
| 22 || GetFreeSpace || | | 22 || GetFreeSpace || Gets free space for the storage. | ||
|- | |- | ||
| 23 || GetTotalSpace || | | 23 || GetTotalSpace || Gets total space for the storage. | ||
|- | |||
| 24 || FlushStorage || Flushes resources for the storage without closing it. | |||
|} | |} | ||
Line 188: | Line 190: | ||
Changes on reboot? | Changes on reboot? | ||
==== | ==== GetNumberOfRegisteredEntries ==== | ||
Writes the total number of entries which can be read by GetEntries, to cmdreply <SFCO_offset>+0x10. | Writes the total number of entries which can be read by GetEntries, to cmdreply <SFCO_offset>+0x10. | ||
==== | ==== GetRegisteredEntries ==== | ||
Takes an output buffer, u32 offset and gets all entries starting at that offset. | Takes an output buffer, u32 offset and gets all entries starting at that offset. | ||
Returns number of entries read. | Returns number of entries read. | ||
Line 199: | Line 201: | ||
The total read entries is exactly the same as the number of "<hex>.nca" directories in the storage FS(or at least under the "registered" directory?). | The total read entries is exactly the same as the number of "<hex>.nca" directories in the storage FS(or at least under the "registered" directory?). | ||
==== | ==== GetRegisteredEntrySize ==== | ||
Takes a [[#NcaID]] as input. | Takes a [[#NcaID]] as input. | ||
Returns the total size readable by ReadEntryRaw. This is the same as the size-field in the [[NAX0]] "<NcaID>.nca/00" file. | Returns the total size readable by ReadEntryRaw. This is the same as the size-field in the [[NAX0]] "<NcaID>.nca/00" file. | ||
==== | ==== ReadRegisteredEntryRaw ==== | ||
Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset. | Takes an output buffer, a [[#NcaID]] as input, and a u64 file offset. | ||