mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-12-23 04:41:12 +00:00
kern: add extension InfoType for retrieving current process handle.
This commit is contained in:
parent
5362ee9450
commit
a7564cf303
2 changed files with 20 additions and 0 deletions
|
@ -276,6 +276,25 @@ namespace ams::kern::svc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
{
|
{
|
||||||
/* For debug, log the invalid info call. */
|
/* For debug, log the invalid info call. */
|
||||||
|
|
|
@ -159,6 +159,7 @@ namespace ams::svc {
|
||||||
InfoType_FreeThreadCount = 24,
|
InfoType_FreeThreadCount = 24,
|
||||||
|
|
||||||
InfoType_MesosphereMeta = 65000,
|
InfoType_MesosphereMeta = 65000,
|
||||||
|
InfoType_MesosphereCurrentProcess = 65001,
|
||||||
|
|
||||||
InfoType_ThreadTickCount = 0xF0000002,
|
InfoType_ThreadTickCount = 0xF0000002,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue