2023-01-15 21:16:24 +00:00
|
|
|
|
using Ryujinx.HLE.HOS.Kernel;
|
|
|
|
|
using Ryujinx.HLE.HOS.Kernel.Process;
|
|
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Pm
|
vi: Unify resolutions values and accurate implementation of them. (#2640)
* vi: Unify resolutions values and accurate implementation of them.
To continue what was made in #2618, I've REd `vi` service a bit. Now values and checks related to displays are more accurate.
- `am` GetDefaultDisplayResolution / GetDefaultDisplayResolutionChangeEvent have more informations on what the service does.
- `vi:u/vi:m/vi:s` GetDisplayService are now accurate.
- `IApplicationDisplay` GetRelayService, GetSystemDisplayService, GetManagerDisplayService, GetIndirectDisplayTransactionService, ListDisplays, OpenDisplay, OpenDefaultDisplay, CloseDisplay, GetDisplayResolution are now properly implemented.
- Some other calls are cleaned or have extra checks accordingly to RE.
Additionnaly, `IFriendService` have some wrong aligned things, and `pm:info` service placeholder was missing.
* just use _openedDisplayInfo.Remove()
* use context.Memory.Fill()
* fix some casting
* remove unneeded comment
* cleanup
* uses TryAdd
* displayId > ulong
* GetDisplayResolution > ulong
* UL
2021-09-19 10:57:39 +00:00
|
|
|
|
{
|
|
|
|
|
[Service("pm:info")]
|
|
|
|
|
class IInformationInterface : IpcService
|
|
|
|
|
{
|
|
|
|
|
public IInformationInterface(ServiceCtx context) { }
|
2023-01-15 21:16:24 +00:00
|
|
|
|
|
|
|
|
|
[CommandHipc(0)]
|
|
|
|
|
// GetProgramId(os::ProcessId process_id) -> sf::Out<ncm::ProgramId> out
|
|
|
|
|
public ResultCode GetProgramId(ServiceCtx context)
|
|
|
|
|
{
|
|
|
|
|
ulong pid = context.RequestData.ReadUInt64();
|
|
|
|
|
|
|
|
|
|
// TODO: Not correct as it shouldn't be directly using kernel objects here
|
|
|
|
|
if (context.Device.System.KernelContext.Processes.TryGetValue(pid, out KProcess process))
|
|
|
|
|
{
|
|
|
|
|
context.ResponseData.Write(process.TitleId);
|
|
|
|
|
|
|
|
|
|
return ResultCode.Success;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ResultCode.ProcessNotFound;
|
|
|
|
|
}
|
vi: Unify resolutions values and accurate implementation of them. (#2640)
* vi: Unify resolutions values and accurate implementation of them.
To continue what was made in #2618, I've REd `vi` service a bit. Now values and checks related to displays are more accurate.
- `am` GetDefaultDisplayResolution / GetDefaultDisplayResolutionChangeEvent have more informations on what the service does.
- `vi:u/vi:m/vi:s` GetDisplayService are now accurate.
- `IApplicationDisplay` GetRelayService, GetSystemDisplayService, GetManagerDisplayService, GetIndirectDisplayTransactionService, ListDisplays, OpenDisplay, OpenDefaultDisplay, CloseDisplay, GetDisplayResolution are now properly implemented.
- Some other calls are cleaned or have extra checks accordingly to RE.
Additionnaly, `IFriendService` have some wrong aligned things, and `pm:info` service placeholder was missing.
* just use _openedDisplayInfo.Remove()
* use context.Memory.Fill()
* fix some casting
* remove unneeded comment
* cleanup
* uses TryAdd
* displayId > ulong
* GetDisplayResolution > ulong
* UL
2021-09-19 10:57:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|