Add InfoType.MesosphereCurrentProcess (#3792)

* Add InfoType.MesosphereCurrentProcess

* Make outHandle inlined

Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com>

Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
This commit is contained in:
Shane Slattery 2022-12-04 19:46:02 +00:00 committed by Matt Heins
parent 62100849d8
commit 501f49994e
2 changed files with 29 additions and 1 deletions

View file

@ -28,6 +28,7 @@
UsedNonSystemMemorySize,
IsApplication,
FreeThreadCount,
ThreadTickCount
ThreadTickCount,
MesosphereCurrentProcess = 65001
}
}

View file

@ -2107,6 +2107,33 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
break;
}
case InfoType.MesosphereCurrentProcess:
{
if (handle != 0)
{
return KernelResult.InvalidHandle;
}
if ((ulong)subId != 0)
{
return KernelResult.InvalidCombination;
}
KProcess currentProcess = KernelStatic.GetCurrentProcess();
KHandleTable handleTable = currentProcess.HandleTable;
KernelResult result = handleTable.GenerateHandle(currentProcess, out int outHandle);
if (result != KernelResult.Success)
{
return result;
}
value = (ulong)outHandle;
break;
}
default: return KernelResult.InvalidEnumValue;
}