1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-11-18 06:46:41 +00:00

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 GitHub
parent 5c0fb0cec3
commit aedfadaaf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 1 deletions

View file

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

View file

@ -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;
} }