Filesystem services: Difference between revisions

No edit summary
 
(27 intermediate revisions by 3 users not shown)
Line 133: Line 133:
|-
|-
| 38 || [20.0.0+] DetachSdCard
| 38 || [20.0.0+] DetachSdCard
|-
| 39 || [21.0.0+] ShutdownStorage
|-
| 40 || [21.0.0+] FixSaveDataCertificate
|-
|-
| 51 || [[#OpenSaveDataFileSystem]]
| 51 || [[#OpenSaveDataFileSystem]]
Line 183: Line 187:
|-
|-
| 87 || [11.0.0+] [[#OpenSaveDataTransferManagerForRepair]]
| 87 || [11.0.0+] [[#OpenSaveDataTransferManagerForRepair]]
|-
| 88 || [21.0.0+] OpenSaveDataTransferManagerForSaveDataRepairWithPolicy
|-
|-
| 100 || OpenImageDirectoryFileSystem
| 100 || OpenImageDirectoryFileSystem
Line 275: Line 281:
|-
|-
| 640 || [4.0.0-7.0.1] IsSignedSystemPartitionOnSdCardValid
| 640 || [4.0.0-7.0.1] IsSignedSystemPartitionOnSdCardValid
|-
| 650 || [S2]
|-
| 651 || [S2]
|-
| 660 || [S2]
|-
|-
| 700 || [5.0.0+] [[#OpenAccessFailureDetectionEventNotifier]]
| 700 || [5.0.0+] [[#OpenAccessFailureDetectionEventNotifier]]
Line 286: Line 298:
| 720 || [5.0.0+] AbandonAccessFailure
| 720 || [5.0.0+] AbandonAccessFailure
|-
|-
| 800 || [2.0.0+] GetAndClearErrorInfo
| 800 || [2.0.0+] [[#GetAndClearErrorInfo]]
|-
|-
| 810 || [7.0.0+] RegisterProgramIndexMapInfo
| 810 || [7.0.0+] RegisterProgramIndexMapInfo
Line 351: Line 363:


Note that the functions check whether or not at least one bit is set in the mask. This means that, you don't need to set 0xFFFFFFFFFFFFFFFF to get all permissions: it suffices to set 0x8000000000000000.
Note that the functions check whether or not at least one bit is set in the mask. This means that, you don't need to set 0xFFFFFFFFFFFFFFFF to get all permissions: it suffices to set 0x8000000000000000.
If nn::spl::IsDebugMode() is disabled (retail behavior), the FS sysmodule masks the permission descriptor with 0x3FFFFFFFFFFFFFFF upon process registration.


If the code were to request an invalid input type, panic. But this never happens.
If the code were to request an invalid input type, panic. But this never happens.
Line 635: Line 649:
| [17.0.0-19.0.0] 0x4A || CanGetProgramId || 0x8000000008000000 || GetProgramId, Removed in 20.0.0
| [17.0.0-19.0.0] 0x4A || CanGetProgramId || 0x8000000008000000 || GetProgramId, Removed in 20.0.0
|-
|-
| [20.0.0+] 0x55 || || 0x8000000000000800 ||
| [20.0.0+] 0x55 || CanGetContentStorageInfo || 0x8000000000000800 ||
|-
|-
| [20.0.0+] 0x56 || || 0x8000000004000000 ||
| [20.0.0+] 0x56 || CanDetachSdCard || 0x8000000004000000 ||
|-
|-
| [20.0.0+] 0x57 || || 0x8000000004000000 ||
| [20.0.0+] 0x57 || CanSetSdCardActivationMode || 0x8000000004000000 ||
|}
|}


Line 653: Line 667:
Takes an input [[#FileSystemProxyType]] and an input [[NCM_services#ProgramId|ProgramId]]. Returns an [[#IFileSystem]].
Takes an input [[#FileSystemProxyType]] and an input [[NCM_services#ProgramId|ProgramId]]. Returns an [[#IFileSystem]].


Web-applet loads the [[#FileSystemProxyType]] (which must be '''Manual''') from u32_table[inparam].
The [[#FileSystemProxyType]] must be '''Manual'''.


Note: web-applet strings refer to both this cmd and [[#OpenFileSystemWithId]] as "MountContent", but official nn_sf_sync symbols use "OpenXX" names.
Note: web-applet strings refer to both this cmd and [[#OpenFileSystemWithId]] as "MountContent", but official nn_sf_sync symbols use "OpenXX" names.
Line 755: Line 769:
== OpenSaveDataTransferManager ==
== OpenSaveDataTransferManager ==
No input, returns an [[#ISaveDataTransferManager]].
No input, returns an [[#ISaveDataTransferManager]].
[S2] Stubbed, just returns Result 0x177202.


== OpenSaveDataTransferManagerVersion2 ==
== OpenSaveDataTransferManagerVersion2 ==
Line 791: Line 807:


Returns a [[IPC_Marshalling#Domain_message|domain object ID]] implementing the [[#IStorage]] interface for data archives.
Returns a [[IPC_Marshalling#Domain_message|domain object ID]] implementing the [[#IStorage]] interface for data archives.
[[NCA|PublicData]] is exempt from the [[#Permissions|permissions]] check.


== OpenDataFileSystemWithProgramIndex ==
== OpenDataFileSystemWithProgramIndex ==
Line 827: Line 845:


[8.0.0+] Now takes an additional 8-bytes of input.
[8.0.0+] Now takes an additional 8-bytes of input.
== GetAndClearErrorInfo ==
[21.0.0+] Now takes a type-0x1A output buffer and no longer returns 0x80-bytes of output.


== SetSaveDataSize ==
== SetSaveDataSize ==
Line 1,105: Line 1,126:
| 7 || [20.0.0+] SetSdCardActivationMode
| 7 || [20.0.0+] SetSdCardActivationMode
|-
|-
| 8 || [20.0.0+] TryGetSdCardInfo
| 8 || [20.0.0+] [S1] TryGetSdCardInfo
|-
|-
| 100 || [[#GetMmcCid]]
| 100 || [[#GetMmcCid]]
Line 1,131: Line 1,152:
| 119 || [20.0.0+] CheckAfterEraseMmcPartitionUserData
| 119 || [20.0.0+] CheckAfterEraseMmcPartitionUserData
|-
|-
| 200 || [[#IsGameCardInserted]]
| 200 || [S1] [[#IsGameCardInserted]]
|-
|-
| 201 || [[#EraseGameCard]]
| 201 || [S1] [[#EraseGameCard]]
|-
|-
| 202 || [[#GetGameCardHandle]]
| 202 || [S1] [[#GetGameCardHandle]]
|-
|-
| 203 || [[#GetGameCardUpdatePartitionInfo]]
| 203 || [S1] [[#GetGameCardUpdatePartitionInfo]]
|-
|-
| 204 || [[#FinalizeGameCardDriver]]
| 204 || [S1] [[#FinalizeGameCardDriver]]
|-
|-
| 205 || [[#GetGameCardAttribute]]
| 205 || [S1] [[#GetGameCardAttribute]]
|-
|-
| 206 || [[#GetGameCardDeviceCertificate]]
| 206 || [S1] [[#GetGameCardDeviceCertificate]]
|-
|-
| 207 || [[#GetGameCardAsicInfo]]
| 207 || [S1] [[#GetGameCardAsicInfo]]
|-
|-
| 208 || [[#GetGameCardIdSet]]
| 208 || [S1] [[#GetGameCardIdSet]]
|-
|-
| 209 || [[#WriteToGameCardDirectly]]
| 209 || [S1] [[#WriteToGameCardDirectly]]
|-
|-
| 210 || [[#SetVerifyWriteEnalbleFlag]]
| 210 || [S1] [[#SetVerifyWriteEnalbleFlag]]
|-
|-
| 211 || [[#GetGameCardImageHash]]
| 211 || [S1] [[#GetGameCardImageHash]]
|-
|-
| 212 || [2.0.0+] [[#GetGameCardDeviceIdForProdCard]]
| 212 || [S1] [2.0.0+] [[#GetGameCardDeviceIdForProdCard]]
|-
|-
| 213 || [2.0.0+] [[#EraseAndWriteParamDirectly]]
| 213 || [S1] [2.0.0+] [[#EraseAndWriteParamDirectly]]
|-
|-
| 214 || [2.0.0+] [[#ReadParamDirectly]]
| 214 || [S1] [2.0.0+] [[#ReadParamDirectly]]
|-
|-
| 215 || [2.0.0+] [[#ForceEraseGameCard]]
| 215 || [S1] [2.0.0+] [[#ForceEraseGameCard]]
|-
|-
| 216 || [2.0.0+] [[#GetGameCardErrorInfo]]
| 216 || [S1] [2.0.0+] [[#GetGameCardErrorInfo]]
|-
|-
| 217 || [2.1.0+] [[#GetGameCardErrorReportInfo]]
| 217 || [S1] [2.1.0+] [[#GetGameCardErrorReportInfo]]
|-
|-
| 218 || [3.0.0+] [[#GetGameCardDeviceId]]
| 218 || [S1] [3.0.0+] [[#GetGameCardDeviceId]]
|-
|-
| 219 || [8.0.0+] [[#ChallengeCardExistence]]
| 219 || [S1] [8.0.0+] [[#ChallengeCardExistence]]
|-
|-
| 220 || [9.0.0+] [[#GetGameCardCompatibilityType]]
| 220 || [S1] [9.0.0+] [[#GetGameCardCompatibilityType]]
|-
|-
| 221 || [17.0.0+] [[#GetGameCardAsicCertificate]]
| 221 || [S1] [17.0.0+] [[#GetGameCardAsicCertificate]]
|-
|-
| 222 || [18.0.0+] [[#GetGameCardCardHeader]]
| 222 || [S1] [18.0.0+] [[#GetGameCardCardHeader]]
|-
|-
| 223 || [19.0.0+] [[#SetGameCardSessionCreationDelay]]
| 223 || [S1] [19.0.0+] [[#SetGameCardSessionCreationDelay]]
|-
|-
| 224 || [19.0.0+] [[#GetGameCardApplicationIdList]]
| 224 || [S1] [19.0.0+] [[#GetGameCardApplicationIdList]]
|-
|-
| 225 || [20.0.0+] RegisterGameCardConfigurationData
| 225 || [S1] [20.0.0+] RegisterGameCardConfigurationData
|-
|-
| 226 || [20.0.0+] GetGameCardDetailedErrorReportInfo
| 226 || [S1] [20.0.0+] GetGameCardDetailedErrorReportInfo
|-
|-
| 300 || [[#SetSpeedEmulationMode]]
| 300 || [[#SetSpeedEmulationMode]]
Line 1,204: Line 1,225:
|-
|-
| 501 || [6.0.0+] [[#ClearDeviceSimulationEvent]]
| 501 || [6.0.0+] [[#ClearDeviceSimulationEvent]]
|-
| 800 || [S2] [[#OpenStorageDeviceManager]]
|}
|}


Line 1,359: Line 1,382:
== ClearDeviceSimulationEvent ==
== ClearDeviceSimulationEvent ==
Takes a total of 4-bytes of input. No output.
Takes a total of 4-bytes of input. No output.
== OpenStorageDeviceManager ==
Takes a byte. Returns an [[#IStorageDeviceManager]].


= IEventNotifier =
= IEventNotifier =
Line 1,578: Line 1,604:
| 16 || [[#SetKeySeedPackage]]
| 16 || [[#SetKeySeedPackage]]
|-
|-
| 17 || [20.0.0+] SetLocalKeySeedPackage
| 17 || [20.0.0+] [[#SetLocalKeySeedPackage|SetLocalKeySeedPackage]]
|-
|-
| 32 || [[#OpenSaveDataExporter]]
| 32 || [[#OpenSaveDataExporter]]
Line 1,610: Line 1,636:
== SetKeySeedPackage ==
== SetKeySeedPackage ==
No input/output, takes a type-0x5 input buffer containing the '''KeySeedPackage'''.
No input/output, takes a type-0x5 input buffer containing the '''KeySeedPackage'''.
== SetLocalKeySeedPackage ==
No input/output, takes a type-0x5 input buffer.
This can only be used after [[#SetKeySeedPackage]], in certain conditions.


== OpenSaveDataExporter ==
== OpenSaveDataExporter ==
Line 1,882: Line 1,913:


= IStorageDeviceManager =
= IStorageDeviceManager =
This is "nn::fssrv::storage::sf::IStorageDeviceManager".
[S2] This is "nn::fssrv::storage::sf::IStorageDeviceManager".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,888: Line 1,919:
! Cmd || Name
! Cmd || Name
|-
|-
| N/A || IsInserted
| 0 || IsInserted
|-
| 1 || IsHandleValid
|-
|-
| N/A || IsHandleValid
| 2 || [[#OpenDetectionEvent]]
|-
|-
| N/A || OpenDetectionEvent
| 3 || Returns an [[#IEventNotifier]].
|-
|-
| N/A || OpenOperator
| 10 || [[#OpenOperator]]
|-
|-
| N/A || OpenDevice
| 20 || [[#OpenDevice]]
|-
|-
| N/A || OpenStorage
| 21 || [[#OpenStorage]]
|-
|-
| N/A || Invalidate
| 34 || Invalidate
|}
|}
== OpenDetectionEvent ==
Returns an [[#IEventNotifier]].
== OpenOperator ==
Returns an [[#IStorageDeviceOperator]].
== OpenDevice ==
Returns an [[#IStorageDevice]].
== OpenStorage ==
Returns an [[#IStorage]].


= IStorageDeviceOperator =
= IStorageDeviceOperator =
This is "nn::fssrv::storage::sf::IStorageDeviceOperator".
[S2] This is "nn::fssrv::storage::sf::IStorageDeviceOperator".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,910: Line 1,954:
! Cmd || Name
! Cmd || Name
|-
|-
| N/A || Operate
| 0 || Operate
|-
|-
| N/A || OperateIn
| 1 || OperateIn
|-
|-
| N/A || OperateOut
| 10 || OperateOut
|-
|-
| N/A || OperateOut2
| 11 || OperateOut2
|-
|-
| N/A || OperateInOut
| 20 || OperateInOut
|-
|-
| N/A || OperateIn2Out
| 21 || OperateIn2Out
|}
|}


= IStorageDevice =
= IStorageDevice =
This is "nn::fssrv::storage::sf::IStorageDevice".
[S2] This is "nn::fssrv::storage::sf::IStorageDevice".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 1,930: Line 1,974:
! Cmd || Name
! Cmd || Name
|-
|-
| N/A || GetHandle
| 0 || GetHandle
|-
|-
| N/A || IsHandleValid
| 1 || IsHandleValid
|-
|-
| N/A || OpenOperator
| 10 || OpenOperator
|-
|-
| N/A || Read
| 20 || Read
|-
|-
| N/A || Write
| 21 || Write
|-
|-
| N/A || Flush
| 22 || Flush
|-
|-
| N/A || SetSize
| 23 || SetSize
|-
|-
| N/A || GetSize
| 24 || GetSize
|-
|-
| N/A || OperateRange
| 25 || OperateRange
|}
|}


= FileSystemProxyType =
= FileSystemProxyType =
This is "nn::fs::FileSystemProxyType".
This is "nn::fs::FileSystemProxyType".
sdknso converts the input [[#ContentType|ContentType]] to a FileSystemProxyType, for use with the cmd input.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,001: Line 2,047:
|-
|-
| 0 || None
| 0 || None
|-
| 1 || [S2]
|-
|-
| 15 || All
| 15 || All
Line 2,041: Line 2,089:
|-
|-
| 101 || [3.0.0+] SafeMode
| 101 || [3.0.0+] SafeMode
|-
| 102 || [?+] ProperUser
|}
|}


Line 2,264: Line 2,314:
| 33 || SystemProperPartition
| 33 || SystemProperPartition
|-
|-
| 34 || SignedSystemPartitionOnSafeMode
| 34 || [-?] SignedSystemPartitionOnSafeMode
|-
|-
| 35 || [16.0.0+] DeviceTreeBlob
| 35 || [16.0.0+] DeviceTreeBlob
|-
|-
| 36 || [16.0.0+] System0
| 36 || [16.0.0+] System0
|-
| 37 || System2
|-
| 38 || [?+] System3
|-
| 39 || [21.0.0+] UserProperPartition
|}
|}
System2 is not supported by FS, perhaps removed at some point?


= SdCardSpeedMode =
= SdCardSpeedMode =