Filesystem services: Difference between revisions

 
(16 intermediate revisions by 3 users not shown)
Line 275: Line 275:
|-
|-
| 640 || [4.0.0-7.0.1] IsSignedSystemPartitionOnSdCardValid
| 640 || [4.0.0-7.0.1] IsSignedSystemPartitionOnSdCardValid
|-
| 651 || [S2]
|-
| 660 || [S2]
|-
|-
| 700 || [5.0.0+] [[#OpenAccessFailureDetectionEventNotifier]]
| 700 || [5.0.0+] [[#OpenAccessFailureDetectionEventNotifier]]
Line 351: Line 355:


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 641:
| [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 659:
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 1,107: Line 1,113:
| 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,133: Line 1,139:
| 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,206: Line 1,212:
|-
|-
| 501 || [6.0.0+] [[#ClearDeviceSimulationEvent]]
| 501 || [6.0.0+] [[#ClearDeviceSimulationEvent]]
|-
| 800 || [S2] [[#OpenStorageDeviceManager]]
|}
|}


Line 1,361: Line 1,369:
== 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,884: Line 1,895:


= 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,890: Line 1,901:
! Cmd || Name
! Cmd || Name
|-
|-
| N/A || IsInserted
| 0 || IsInserted
|-
|-
| N/A || IsHandleValid
| 1 || IsHandleValid
|-
|-
| N/A || OpenDetectionEvent
| 2 || [[#OpenDetectionEvent]]
|-
|-
| N/A || OpenOperator
| 3 || Returns an [[#IEventNotifier]].
|-
|-
| N/A || OpenDevice
| 10 || [[#OpenOperator]]
|-
|-
| N/A || OpenStorage
| 20 || [[#OpenDevice]]
|-
|-
| N/A || Invalidate
| 21 || [[#OpenStorage]]
|-
| 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,912: Line 1,936:
! 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,932: Line 1,956:
! 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,003: Line 2,029:
|-
|-
| 0 || None
| 0 || None
|-
| 1 || [S2]
|-
|-
| 15 || All
| 15 || All