mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-05 09:13:43 -04:00
sf: properly support preservation of inline context
This commit is contained in:
parent
94ec9ae41b
commit
d77fe98203
5 changed files with 148 additions and 0 deletions
|
@ -239,6 +239,24 @@ namespace ams::sf::hipc {
|
|||
Result ServerSessionManager::ProcessRequestImpl(ServerSession *session, const cmif::PointerAndSize &in_message, const cmif::PointerAndSize &out_message) {
|
||||
/* TODO: Inline context support, retrieve from raw data + 0xC. */
|
||||
const auto cmif_command_type = GetCmifCommandType(in_message);
|
||||
|
||||
const auto GetInlineContext = [&]() -> cmif::InlineContext {
|
||||
cmif::InlineContext ret = {};
|
||||
switch (cmif_command_type) {
|
||||
case CmifCommandType_RequestWithContext:
|
||||
case CmifCommandType_ControlWithContext:
|
||||
if (in_message.GetSize() >= 0x10) {
|
||||
static_assert(sizeof(cmif::InlineContext) == 4);
|
||||
std::memcpy(std::addressof(ret), static_cast<u8 *>(in_message.GetPointer()) + 0xC, sizeof(ret));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
cmif::ScopedInlineContextChanger sicc(GetInlineContext());
|
||||
switch (cmif_command_type) {
|
||||
case CmifCommandType_Request:
|
||||
case CmifCommandType_RequestWithContext:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue