diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/InfoType.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/InfoType.cs index 5d6b1c7dc4..3cf7ba7481 100644 --- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/InfoType.cs +++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/InfoType.cs @@ -28,6 +28,7 @@ UsedNonSystemMemorySize, IsApplication, FreeThreadCount, - ThreadTickCount + ThreadTickCount, + MesosphereCurrentProcess = 65001 } } diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs index 189e4a3ead..c3fb8b8ad9 100644 --- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs +++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs @@ -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; }