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 SlatteryandTSRBerry authored and GitHub committed 2022-12-04 19:46:02 +00:00
1 parent 5c0fb0cec3
commit aedfadaaf7
2 files changed
+29 -1

No files matched your search

@@ -28,6 +28,7 @@
UsedNonSystemMemorySize, UsedNonSystemMemorySize,
IsApplication, IsApplication,
FreeThreadCount, FreeThreadCount,
ThreadTickCount ThreadTickCount,
MesosphereCurrentProcess = 65001
} }
} }
@@ -2107,6 +2107,33 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
break; 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; default: return KernelResult.InvalidEnumValue;
} }