mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-27 13:14:15 -04:00
kern: resolve MESOSPHERE_UNIMPLEMENTEDs other than UserException
This commit is contained in:
parent
325802e29d
commit
c9f8252577
4 changed files with 85 additions and 12 deletions
|
@ -37,15 +37,19 @@ namespace ams::kern::svc {
|
|||
|
||||
/* Get the process from the object. */
|
||||
KProcess *process = nullptr;
|
||||
if (obj->IsDerivedFrom(KProcess::GetStaticTypeObj())) {
|
||||
if (KProcess *p = obj->DynamicCast<KProcess *>(); p != nullptr) {
|
||||
/* The object is a process, so we can use it directly. */
|
||||
process = reinterpret_cast<KProcess *>(obj.GetPointerUnsafe());
|
||||
} else if (obj->IsDerivedFrom(KThread::GetStaticTypeObj())) {
|
||||
process = p;
|
||||
} else if (KThread *t = obj->DynamicCast<KThread *>(); t != nullptr) {
|
||||
/* The object is a thread, so we want to use its parent. */
|
||||
process = reinterpret_cast<KThread *>(obj.GetPointerUnsafe())->GetOwnerProcess();
|
||||
} else if (obj->IsDerivedFrom(KDebug::GetStaticTypeObj())) {
|
||||
} else if (KDebug *d = obj->DynamicCast<KDebug *>(); d != nullptr) {
|
||||
/* The object is a debug, so we want to use the process it's attached to. */
|
||||
MESOSPHERE_UNIMPLEMENTED();
|
||||
obj = d->GetProcess();
|
||||
|
||||
if (obj.IsNotNull()) {
|
||||
process = static_cast<KProcess *>(obj.GetPointerUnsafe());
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure the target process exists. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue