From 0267a1ad71a607e78c6d1fcacf1d08f73fc8fb0c Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 19 Apr 2018 16:28:19 -0600 Subject: [PATCH] Stratosphere: Skeleton framework for auto-hipc manager responses for IpcCommandType != Request --- stratosphere/loader/source/servicesession.hpp | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/stratosphere/loader/source/servicesession.hpp b/stratosphere/loader/source/servicesession.hpp index 5f0aeb959..51f5d6897 100644 --- a/stratosphere/loader/source/servicesession.hpp +++ b/stratosphere/loader/source/servicesession.hpp @@ -88,8 +88,35 @@ class ServiceSession : public IWaitable { if (R_SUCCEEDED(retval)) { rawdata_start = (u32 *)r.Raw; wordcount = r.RawSize; - retval = this->service_object->dispatch(&r, &c, cmdbuf, rawdata_start[2], &rawdata_start[4], wordcount - 6, &cmdbuf[8], &extra_rawdata_count); + switch (r.CommandType) { + case IpcCommandType_Control: + case IpcCommandType_ControlWithContext: + /* TODO: Implement HIPC Control commands. */ + retval = 0xF601; + break; + case IpcCommandType_Close: + /* TODO: This should close the session and clean up its resources. */ + retval = 0xF601; + break; + case IpcCommandType_LegacyControl: + /* TODO: What does this allow one to do? */ + retval = 0xF601; + break; + case IpcCommandType_LegacyRequest: + /* TODO: What does this allow one to do? */ + retval = 0xF601; + break; + case IpcCommandType_Request: + case IpcCommandType_RequestWithContext: + retval = this->service_object->dispatch(&r, &c, cmdbuf, rawdata_start[2], &rawdata_start[4], wordcount - 6, &cmdbuf[8], &extra_rawdata_count); out_words += extra_rawdata_count; + break; + case IpcCommandType_Invalid: + default: + retval = 0xF601; + break; + } + } if (retval != 0xF601) {