diff --git a/libraries/libmesosphere/source/svc/kern_svc_info.cpp b/libraries/libmesosphere/source/svc/kern_svc_info.cpp index 60a72fb..308871f 100644 --- a/libraries/libmesosphere/source/svc/kern_svc_info.cpp +++ b/libraries/libmesosphere/source/svc/kern_svc_info.cpp @@ -276,6 +276,25 @@ } } break; + case ams::svc::InfoType_MesosphereCurrentProcess: + { + /* Verify the input handle is invalid. */ + R_UNLESS(handle == ams::svc::InvalidHandle, svc::ResultInvalidHandle()); + + /* Verify the sub-type is valid. */ + R_UNLESS(info_subtype == 0, svc::ResultInvalidCombination()); + + /* Get the handle table. */ + KHandleTable &handle_table = GetCurrentProcess().GetHandleTable(); + + /* Get a new handle for the current process. */ + ams::svc::Handle tmp; + R_TRY(handle_table.Add(std::addressof(tmp), GetCurrentProcessPointer())); + + /* Set the output. */ + *out = tmp; + } + break; default: { /* For debug, log the invalid info call. */ diff --git a/libraries/libvapours/include/vapours/svc/svc_types_common.hpp b/libraries/libvapours/include/vapours/svc/svc_types_common.hpp index b533d4e..0695189 100644 --- a/libraries/libvapours/include/vapours/svc/svc_types_common.hpp +++ b/libraries/libvapours/include/vapours/svc/svc_types_common.hpp @@ -159,6 +159,7 @@ InfoType_FreeThreadCount = 24, InfoType_MesosphereMeta = 65000, + InfoType_MesosphereCurrentProcess = 65001, InfoType_ThreadTickCount = 0xF0000002, };