From 13aa774d7a42a652e2f16ee9d85570bfdd302f5f Mon Sep 17 00:00:00 2001 From: misson20000 Date: Sun, 18 Nov 2018 17:01:24 -0800 Subject: [PATCH] add docs for SetExternalContentSource --- docs/modules/loader.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/modules/loader.md b/docs/modules/loader.md index 6bde97faa..5ed0f5162 100644 --- a/docs/modules/loader.md +++ b/docs/modules/loader.md @@ -66,3 +66,17 @@ For example, `override_key=!R` will run the game only while holding down R when ### SM MITM Integration When the Stratosphere implementation of loader creates a new process, it notifies [sm](sm.md) through the `AtmosphereAssociatePidTidForMitm` command to notify any MITM services of new processes' identities. + +### IPC: AtmosphereSetExternalContentSource + +An additional command is added to the [`ldr:shel`](https://reswitched.github.io/SwIPC/ifaces.html#nn::ro::detail::ILdrShellInterface) interface, called `AtmosphereSetExternalContentSource`. It's command ID is `65000` on all system firmware versions. It takes a `u64 tid` and returns a server-side session handle. The client is expected to implement the `IFileSystem` interface on the returned handle. The next time the title specified by the given title ID is launched, its ExeFS contents will be loaded from the custom `IFileSystem` instead of from SD card or original ExeFS. NSOs loaded from external content source may still be subject to exefs IPS patches. After the title is launched, the `IFileSystem` is closed and the external content source override is removed. If `AtmosphereSetExternalContentSource` is called on a title that already has an external content source set for it, the existing one will be removed and replaced with the new one. It is illegal to call `AtmosphereSetExternalContentSource` while the title is being launched. + +The `IFileSystem` only needs to implement `OpenFile`. The paths received by the `IFileSystem`'s `OpenFile` command begin with slashes, as in `/main`, `/rtld`, and `/main.npdm`. A result code of 0x202 should be returned if the file does not exist. The `IFile`s returned from `OpenFile` only need to implement `Read` and `GetSize`. + +The SwIPC definition for the `AtmosphereSetExternalContentSource` command follows. +``` +interface nn::ldr::detail::IShellInterface is ldr:shel { + ... + [65000] AtmosphereSetExternalContentSource(u64 tid) -> handle ifilesystem_handle; +} +```