fs.mitm: Get Title ID on fsp-srv init, Add worker to handle subinterfaces.
This commit is contained in:
@@ -3,6 +3,13 @@
|
||||
|
||||
Result FsMitMService::dispatch(IpcParsedCommand &r, IpcCommand &out_c, u64 cmd_id, u8 *pointer_buffer, size_t pointer_buffer_size) {
|
||||
Result rc = 0xF601;
|
||||
switch (cmd_id) {
|
||||
case FspSrv_Cmd_SetCurrentProcess:
|
||||
if (!this->has_initialized && r.HasPid) {
|
||||
this->process_id = r.Pid;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -13,7 +20,17 @@ Result FsMitMService::postprocess(IpcParsedCommand &r, IpcCommand &out_c, u64 cm
|
||||
} *resp = (decltype(resp))r.Raw;
|
||||
|
||||
Result rc = (Result)resp->result;
|
||||
/* TODO: Hook here, if needed. */
|
||||
switch (cmd_id) {
|
||||
case FspSrv_Cmd_SetCurrentProcess:
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
this->has_initialized = true;
|
||||
if (R_FAILED(pminfoInitialize()) || R_FAILED(pminfoGetTitleId(&this->title_id, this->process_id))) {
|
||||
fatalSimple(0xCAFE << 8 | 0xFD);
|
||||
}
|
||||
pminfoExit();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user