diff options
author | Shane Slattery <Slattz@users.noreply.github.com> | 2022-12-04 19:46:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-04 19:46:02 +0000 |
commit | aedfadaaf710d8f363b730f82f8e82437a43e115 (patch) | |
tree | 5e766c99fc6be423066b5882f257cdd0915d9628 | |
parent | 5c0fb0cec30028a155a48ed0b9569abc6ec4c13b (diff) |
Add InfoType.MesosphereCurrentProcess (#3792)1.1.423
* 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>
-rw-r--r-- | Ryujinx.HLE/HOS/Kernel/SupervisorCall/InfoType.cs | 3 | ||||
-rw-r--r-- | Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs | 27 |
2 files changed, 29 insertions, 1 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/InfoType.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/InfoType.cs index 5d6b1c7d..3cf7ba74 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 189e4a3e..c3fb8b8a 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; } |