mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-06-01 18:09:15 +00:00
This PR is the first in a batch of structural changes to Ryujinx. **Changes** - Added `ProcessIdentity` and `ProcessKind` to describe loaded programs by: - PID, program ID, application ID, program index, display version, process kind - Stored identity metadata on `ProcessResult`. - Added PID-based process lookup helpers to `ProcessLoader`. - Updated HLE services to resolve application metadata through the caller PID instead of `Processes.ActiveApplication`. - Added PTC/JIT disk cache initialization logging with PID, title ID, display version, selector, and enabled state. - Added `ClientProcessId` property to ServiceCtx (/src/Ryujinx.HLE/HOS/ServiceCtx.cs) that uses the handle descriptor PId when available, falling back to `Process.Pid`. - Updated 15 HLE service files to use `context.ClientProcessId` instead of `context.Process.Pid` for client process access, ensuring services correctly identify the calling process even when invoked via IPC with handle descriptors. These changes make service metadata resolution more explicit and prepare the emulator for other structural changes later on. Reviewed-on: https://git.ryujinx.app/projects/Ryubing/pulls/100
106 lines
3.4 KiB
C#
106 lines
3.4 KiB
C#
using Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.LibraryAppletProxy;
|
|
using Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.SystemAppletProxy;
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService
|
|
{
|
|
class ILibraryAppletProxy : IpcService
|
|
{
|
|
private readonly ulong _pid;
|
|
|
|
public ILibraryAppletProxy(ulong pid)
|
|
{
|
|
_pid = pid;
|
|
}
|
|
|
|
[CommandCmif(0)]
|
|
// GetCommonStateGetter() -> object<nn::am::service::ICommonStateGetter>
|
|
public ResultCode GetCommonStateGetter(ServiceCtx context)
|
|
{
|
|
MakeObject(context, new ICommonStateGetter(context));
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
|
|
[CommandCmif(1)]
|
|
// GetSelfController() -> object<nn::am::service::ISelfController>
|
|
public ResultCode GetSelfController(ServiceCtx context)
|
|
{
|
|
MakeObject(context, new ISelfController(context, _pid));
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
|
|
[CommandCmif(2)]
|
|
// GetWindowController() -> object<nn::am::service::IWindowController>
|
|
public ResultCode GetWindowController(ServiceCtx context)
|
|
{
|
|
MakeObject(context, new IWindowController(_pid));
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
|
|
[CommandCmif(3)]
|
|
// GetAudioController() -> object<nn::am::service::IAudioController>
|
|
public ResultCode GetAudioController(ServiceCtx context)
|
|
{
|
|
MakeObject(context, new IAudioController());
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
|
|
[CommandCmif(4)]
|
|
// GetDisplayController() -> object<nn::am::service::IDisplayController>
|
|
public ResultCode GetDisplayController(ServiceCtx context)
|
|
{
|
|
MakeObject(context, new IDisplayController(context));
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
|
|
[CommandCmif(10)]
|
|
// GetProcessWindingController() -> object<nn::am::service::IProcessWindingController>
|
|
public ResultCode GetProcessWindingController(ServiceCtx context)
|
|
{
|
|
MakeObject(context, new IProcessWindingController());
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
|
|
[CommandCmif(11)]
|
|
// GetLibraryAppletCreator() -> object<nn::am::service::ILibraryAppletCreator>
|
|
public ResultCode GetLibraryAppletCreator(ServiceCtx context)
|
|
{
|
|
MakeObject(context, new ILibraryAppletCreator());
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
|
|
[CommandCmif(20)]
|
|
// OpenLibraryAppletSelfAccessor() -> object<nn::am::service::ILibraryAppletSelfAccessor>
|
|
public ResultCode OpenLibraryAppletSelfAccessor(ServiceCtx context)
|
|
{
|
|
MakeObject(context, new ILibraryAppletSelfAccessor(context, _pid));
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
|
|
[CommandCmif(21)]
|
|
// GetAppletCommonFunctions() -> object<nn::am::service::IAppletCommonFunctions>
|
|
public ResultCode GetAppletCommonFunctions(ServiceCtx context)
|
|
{
|
|
MakeObject(context, new IAppletCommonFunctions());
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
|
|
[CommandCmif(1000)]
|
|
// GetDebugFunctions() -> object<nn::am::service::IDebugFunctions>
|
|
public ResultCode GetDebugFunctions(ServiceCtx context)
|
|
{
|
|
MakeObject(context, new IDebugFunctions());
|
|
|
|
return ResultCode.Success;
|
|
}
|
|
}
|
|
}
|