Migration services: Difference between revisions
m →Cmd1001 |
No edit summary |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 12: | Line 12: | ||
| 0 || [19.0.0+] | | 0 || [19.0.0+] | ||
|- | |- | ||
| | | 1 || [20.0.0+] | ||
|- | |- | ||
| | | 2 || [20.0.0+] | ||
|- | |- | ||
| | | 10 || [7.0.0-19.0.1] TryGetLastUserMigrationInfo ([4.0.0-6.2.0] TryGetLastMigrationInfo) | ||
|- | |- | ||
| | | 11 || [20.0.0+] | ||
|- | |- | ||
| | | 100 || [7.0.0+] [[#CreateUserMigrationServer|CreateUserMigrationServer]] ([4.0.0-6.2.0] CreateServer) | ||
|- | |- | ||
| | | 101 || [7.0.0+] [[#ResumeUserMigrationServer|ResumeUserMigrationServer]] ([4.0.0-6.2.0] ResumeServer) | ||
|- | |- | ||
| | | 200 || [7.0.0+] [[#CreateUserMigrationClient|CreateUserMigrationClient]] ([4.0.0-6.2.0] CreateClient) | ||
|- | |- | ||
| | | 201 || [7.0.0+] [[#ResumeUserMigrationClient|ResumeUserMigrationClient]] ([4.0.0-6.2.0] ResumeClient) | ||
|- | |- | ||
| 1101 || [7.0.0+] | | 1001 || [8.0.0+] [[#GetSaveDataMigrationPolicyInfoAsync|GetSaveDataMigrationPolicyInfoAsync]] | ||
|- | |||
| 1010 || [7.0.0+] TryGetLastSaveDataMigrationInfo | |||
|- | |||
| 1100 || [7.0.0-19.0.1] [[#CreateSaveDataMigrationServer|CreateSaveDataMigrationServer]] | |||
|- | |||
| 1101 || [7.0.0+] [[#ResumeSaveDataMigrationServer|ResumeSaveDataMigrationServer]] | |||
|- | |- | ||
| 1110 || [17.0.0+] | | 1110 || [17.0.0+] | ||
|- | |- | ||
| 1200 || [7.0.0+] | | 1200 || [7.0.0+] [[#CreateSaveDataMigrationClient|CreateSaveDataMigrationClient]] | ||
|- | |||
| 1201 || [7.0.0+] [[#ResumeSaveDataMigrationClient|ResumeSaveDataMigrationClient]] | |||
|- | |||
| 2001 || [20.0.0+] | |||
|- | |||
| 2010 || [20.0.0+] | |||
|- | |||
| 2100 || [20.0.0+] | |||
|- | |||
| 2110 || [20.0.0+] | |||
|- | |||
| 2200 || [20.0.0+] | |||
|- | |||
| 2210 || [20.0.0+] | |||
|- | |||
| 2220 || [20.0.0+] | |||
|- | |||
| 2230 || [20.0.0+] | |||
|- | |||
| 2231 || [20.0.0+] | |||
|- | |||
| 2232 || [20.0.0+] | |||
|- | |||
| 2233 || [20.0.0+] | |||
|- | |||
| 2234 || [20.0.0+] | |||
|- | |- | ||
| | | 2250 || [20.0.0+] | ||
|- | |||
| 2260 || [20.0.0+] | |||
|- | |||
| 2270 || [20.0.0+] | |||
|- | |||
| 2280 || [20.0.0+] | |||
|- | |||
| 2300 || [20.0.0+] | |||
|- | |||
| 2310 || [20.0.0+] | |||
|- | |||
| 2400 || [20.0.0+] | |||
|- | |||
| 2420 || [20.0.0+] | |||
|} | |} | ||
== | == CreateUserMigrationServer == | ||
Takes a total of 0x18-bytes of input, a type-0x19 input buffer, a TransferMemory handle, returns an [[#IServer]]. | Takes a total of 0x18-bytes of input, a type-0x19 input buffer, a TransferMemory handle, returns an [[#IServer]]. | ||
== | == ResumeUserMigrationServer == | ||
Takes an input u32, a TransferMemory handle, returns an [[#IServer]]. | Takes an input u32, a TransferMemory handle, returns an [[#IServer]]. | ||
== | == CreateUserMigrationClient == | ||
Takes an input u32, a type-0x19 input buffer, a TransferMemory handle, returns an [[#IClient]]. | Takes an input u32, a type-0x19 input buffer, a TransferMemory handle, returns an [[#IClient]]. | ||
== | == ResumeUserMigrationClient == | ||
Takes an input u32, a TransferMemory handle, returns an [[#IClient]]. | Takes an input u32, a TransferMemory handle, returns an [[#IClient]]. | ||
== | == GetSaveDataMigrationPolicyInfoAsync == | ||
Takes an [[NCM_services#ApplicationId|ApplicationId]], returns an [[#IAsyncSaveDataMigrationPolicyInfoContext]]. | Takes an [[NCM_services#ApplicationId|ApplicationId]], returns an [[#IAsyncSaveDataMigrationPolicyInfoContext]]. | ||
Line 56: | Line 102: | ||
This starts a network request for [[Network|save_data_migration_policy]]. | This starts a network request for [[Network|save_data_migration_policy]]. | ||
== | == CreateSaveDataMigrationServer == | ||
Takes a total of 0x20-bytes of input, a type-0x19 input buffer, a TransferMemory handle, returns an [[#IServer_2|IServer]]. | Takes a total of 0x20-bytes of input, a type-0x19 input buffer, a TransferMemory handle, returns an [[#IServer_2|IServer]]. | ||
== | == ResumeSaveDataMigrationServer == | ||
Takes an input u32, a TransferMemory handle, returns an [[#IServer_2|IServer]]. | Takes an input u32, a TransferMemory handle, returns an [[#IServer_2|IServer]]. | ||
== | == Cmd1110 == | ||
Takes a total of 0x18-bytes of input, a type-0x19 input buffer, a type-0x5 input buffer containing an array of u64s, and a TransferMemory handle. Returns an [[#IServer_2|IServer]]. | |||
This is identical to [[#CreateSaveDataMigrationServer|CreateSaveDataMigrationServer]] except the u64-array is passed directly instead of from a single input u64. | |||
== CreateSaveDataMigrationClient == | |||
Takes an input u32, a type-0x19 input buffer, a TransferMemory handle, returns an [[#IClient_2|IClient]]. | Takes an input u32, a type-0x19 input buffer, a TransferMemory handle, returns an [[#IClient_2|IClient]]. | ||
== | == ResumeSaveDataMigrationClient == | ||
Takes an input u32, a TransferMemory handle, returns an [[#IClient_2|IClient]]. | Takes an input u32, a TransferMemory handle, returns an [[#IClient_2|IClient]]. | ||
== Cmd2100 == | |||
Takes 4-bytes of input, a type-0x19 input buffer containing a 0x100-byte struct, a handle. Returns an [[#IServer_3|IServer]]. | |||
== Cmd2110 == | |||
Takes 4-bytes of input, a handle. Returns an [[#IServer_3|IServer]]. | |||
== Cmd2200 == | |||
Takes 4-bytes of input, a type-0x19 input buffer containing a 0x100-byte struct, a handle. Returns an [[#IClient_3|IClient]]. | |||
On NX this just calls a logging func and returns an error. | |||
== Cmd2210 == | |||
Takes 4-bytes of input, a handle. Returns an [[#IClient_3|IClient]]. | |||
On NX this just calls a logging func and returns an error. | |||
== Cmd2250 == | |||
Takes a total of 0x18-bytes of input, a handle. Returns an [[#IUnknown|IUnknown]]. | |||
== Cmd2260 == | |||
Takes 4-bytes of input, a handle. Returns an [[#IUnknown|IUnknown]]. | |||
== Cmd2280 == | |||
Takes an input u64, returns an [[#IAsyncContext]]. | |||
This starts a network request for [[Network|transfer_events/%lld/rollback]]. | |||
== Cmd2300 == | |||
Takes a total of 0x18-bytes of input, a handle. Returns an [[#IUploader|IUploader]]. | |||
== Cmd2310 == | |||
Takes 4-bytes of input, a handle. Returns an [[#IUploader|IUploader]]. | |||
== Cmd2400 == | |||
Takes a total of 0x10-bytes of input, a handle. Returns an [[#IDownloader|IDownloader]]. | |||
== Cmd2420 == | |||
Takes 4-bytes of input, a handle. Returns an [[#IDownloader|IDownloader]]. | |||
== IServer == | == IServer == | ||
Line 82: | Line 172: | ||
|- | |- | ||
| 101 || GetConnectionRequirement | | 101 || GetConnectionRequirement | ||
|- | |||
| 102 || [20.0.0+] | |||
|- | |- | ||
| 200 || WaitConnectionAsync | | 200 || WaitConnectionAsync | ||
Line 96: | Line 188: | ||
|- | |- | ||
| 500 || Abort | | 500 || Abort | ||
|} | |} | ||
Line 119: | Line 210: | ||
|- | |- | ||
| 101 || GetConnectionRequirement | | 101 || GetConnectionRequirement | ||
|- | |||
| 102 || [20.0.0+] | |||
|- | |- | ||
| 200 || ScanServersAsync | | 200 || ScanServersAsync | ||
Line 145: | Line 238: | ||
|- | |- | ||
| 999 || DebugSynchronizeStateInFinalizationAsync | | 999 || DebugSynchronizeStateInFinalizationAsync | ||
|} | |} | ||
Line 162: | Line 254: | ||
|- | |- | ||
| 3 || GetResult | | 3 || GetResult | ||
|} | |} | ||
Line 192: | Line 283: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || | | 0 || GetUid | ||
|- | |||
| 1 || [7.0.0-19.0.1] GetApplicationId | |||
|- | |||
| 2 || GetServerProfile | |||
|- | |||
| 3 || [17.0.0+] ListApplicationIds | |||
|- | |- | ||
| | | 100 || [[#PrepareAsync|PrepareAsync]] | ||
|- | |- | ||
| | | 101 || GetConnectionRequirement | ||
|- | |- | ||
| | | 102 || [20.0.0+] | ||
|- | |- | ||
| | | 200 || WaitConnectionAsync | ||
|- | |- | ||
| | | 201 || GetClientProfile | ||
|- | |- | ||
| | | 202 || [20.0.0+] | ||
|- | |- | ||
| | | 203 || [20.0.0+] | ||
|- | |- | ||
| 210 || [8.0.0+] | | 210 || [8.0.0+] WaitAcceptanceAsync | ||
|- | |- | ||
| 300 || | | 300 || ProcessTransferAsync | ||
|- | |- | ||
| 400 || | | 400 || CompleteAsync | ||
|- | |- | ||
| 500 || | | 500 || [7.0.0-19.0.1] Abort | ||
|- | |- | ||
| 510 || [19.0.0+] | | 510 || [19.0.0+] | ||
|- | |- | ||
| 998 || [8.0.0+] | | 998 || [8.0.0+] DebugTryGetState | ||
|- | |- | ||
| 999 || [8.0.0+] DebugWaitStateSynchronizationFinalizedAsync | |||
|} | |} | ||
=== PrepareAsync === | |||
No input, returns an [[#IAsyncContext|IAsyncContext]]. | |||
Besides various other functionality, the async task also uses functionality similar to [[#GetSaveDataMigrationPolicyInfoAsync|GetSaveDataMigrationPolicyInfoAsync]], throwing an error if needed. | |||
== IClient == | == IClient == | ||
Line 228: | Line 329: | ||
This was added with [7.0.0+]. | This was added with [7.0.0+]. | ||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || GetClientProfile | |||
|- | |||
| 100 || GetConnectionRequirement | |||
|- | |||
| 101 || [20.0.0+] | |||
|- | |||
| 200 || ScanServersAsync | |||
|- | |||
| 201 || [[#ListServers|ListServers]] | |||
|- | |||
| 210 || ConnectByServerIdAsync | |||
|- | |||
| 220 || [8.0.0+] AcceptAsync | |||
|- | |||
| 221 || [8.0.0+] DeclineAsync | |||
|- | |||
| 300 || GetStorageShortfall | |||
|- | |||
| 301 || GetTotalTransferInfo | |||
|- | |||
| 302 || GetImmigrantUid | |||
|- | |||
| 303 || GetApplicationId | |||
|- | |||
| 304 || [17.0.0+] ListApplicationIds | |||
|- | |||
| 310 || GetCurrentTransferInfo | |||
|- | |||
| 320 || TransferNextAsync | |||
|- | |||
| 350 || SuspendAsync | |||
|- | |||
| 400 || CompleteAsync | |||
|- | |||
| 500 || [7.0.0-19.0.1] Abort | |||
|- | |||
| 510 || [19.0.0+] | |||
|- | |||
| 996 || [8.0.0+] DebugTryGetState | |||
|- | |||
| 997 || [8.0.0+] DebugSynchronizeStateInFinalization0Async | |||
|- | |||
| 998 || [8.0.0+] DebugSynchronizeStateInFinalization1Async | |||
|- | |||
| 999 || DebugSynchronizeStateFinalizedAsync | |||
|} | |||
=== ListServers === | |||
[20.0.0+] The struct size is now 0x130-bytes instead of 0x128-bytes. | |||
== IServer == | |||
This is "nn::migration::device::IServer". | |||
This was added with [20.0.0+]. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 234: | Line 394: | ||
|- | |- | ||
| 0 || | | 0 || | ||
|- | |||
| 10 || | |||
|- | |||
| 20 || | |||
|- | |||
| 21 || | |||
|- | |||
| 30 || | |||
|- | |||
| 40 || | |||
|- | |||
| 50 || | |||
|- | |- | ||
| 100 || | | 100 || | ||
|- | |||
| 110 || | |||
|- | |||
| 111 || | |||
|- | |||
| 120 || | |||
|- | |||
| 130 || | |||
|- | |- | ||
| 200 || | | 200 || | ||
|- | |- | ||
| | | 230 || | ||
|- | |||
| 290 || | |||
|- | |||
| 300 || | |||
|- | |||
| 400 || | |||
|- | |||
| 510 || | |||
|- | |||
| 900 || | |||
|} | |||
== IClient == | |||
This is "nn::migration::device::IClient". | |||
This was added with [20.0.0+]. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 10 || | |||
|- | |||
| 20 || | |||
|- | |||
| 30 || | |||
|- | |||
| 100 || | |||
|- | |||
| 110 || | |||
|- | |||
| 111 || | |||
|- | |||
| 200 || | |||
|- | |- | ||
| 210 || | | 210 || | ||
|- | |- | ||
| 220 || | | 220 || | ||
|- | |||
| 230 || | |||
|- | |||
| 240 || | |||
|- | |||
| 250 || | |||
|- | |- | ||
| | | 290 || | ||
|- | |- | ||
| 300 || | | 300 || | ||
|- | |- | ||
| | | 310 || | ||
|- | |- | ||
| | | 320 || | ||
|- | |- | ||
| | | 330 || | ||
|- | |- | ||
| | | 340 || | ||
|- | |||
| 400 || | |||
|- | |||
| 500 || | |||
|- | |||
| 610 || | |||
|- | |||
| 700 || | |||
|- | |||
| 710 || | |||
|- | |||
| 720 || | |||
|} | |||
== IUnknown == | |||
This was added with [20.0.0+]. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 0 || | |||
|- | |||
| 1 || | |||
|- | |||
| 2 || | |||
|- | |||
| 3 || | |||
|- | |||
| 100 || | |||
|- | |||
| 110 || | |||
|} | |||
== IUploader == | |||
This is "nn::migration::device::IUploader". | |||
This was added with [20.0.0+]. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 90 || | |||
|- | |||
| 100 || | |||
|- | |- | ||
| 310 || | | 310 || | ||
|- | |- | ||
| 320 || | | 320 || | ||
|- | |||
| 330 || | |||
|- | |||
| 340 || | |||
|- | |- | ||
| 350 || | | 350 || | ||
Line 267: | Line 537: | ||
| 500 || | | 500 || | ||
|- | |- | ||
| | | 610 || | ||
|- | |||
| 900 || | |||
|} | |||
== IDownloader == | |||
This is "nn::migration::device::IDownloader". | |||
This was added with [20.0.0+]. | |||
{| class="wikitable" border="1" | |||
|- | |||
! Cmd || Name | |||
|- | |||
| 10 || | |||
|- | |||
| 20 || | |||
|- | |||
| 30 || | |||
|- | |||
| 90 || | |||
|- | |||
| 100 || | |||
|- | |||
| 300 || | |||
|- | |||
| 310 || | |||
|- | |||
| 320 || | |||
|- | |||
| 330 || | |||
|- | |- | ||
| | | 400 || | ||
|- | |- | ||
| | | 500 || | ||
|- | |- | ||
| | | 610 || | ||
|- | |- | ||
| | | 620 || | ||
|- | |- | ||
| 900 || | |||
|} | |} | ||
= Notes = | |||
Savedata transfer ("nn::migration::savedata::IServer"/"nn::migration::savedata::IClient") requires that accounts are linked to the same network-account. acc:su [[NS_services#IManagerForSystemService|IManagerForSystemService]] GetAccountId is used here. The server stores this Id into state, and also stores it in the [[LDN_services|ldn]] AdvertiseData. The client also verifies the Id in AdvertiseData against the Id from GetAccountId for the account(s) being used, during ScanServersAsync. | |||
[[Category:Services]] | [[Category:Services]] |