From 596b61ce1fc9ac0397c3ea74a1033a3be5608512 Mon Sep 17 00:00:00 2001 From: Ac_K Date: Wed, 10 Jul 2019 17:59:54 +0200 Subject: [PATCH] IPC services refactoring (#726) * IPC services refactoring - Use custom Attributes to handle services. - Add a way to set the permissions and fix the bsd service to use it. - Little cleanup. - C#7.1 is required. * fix var name * fix syntax * Change Permission to Parameter * Delete BsdServicePermissionLevel.cs * Fix Linq --- .../HOS/Services/Acc/IAccountService.cs | 4 +- .../Am/IAllSystemAppletProxiesService.cs | 3 +- .../Services/Am/IApplicationProxyService.cs | 3 +- Ryujinx.HLE/HOS/Services/Apm/IManager.cs | 4 +- .../HOS/Services/Aud/IAudioOutManager.cs | 3 +- .../HOS/Services/Aud/IAudioRendererManager.cs | 3 +- .../Aud/IHardwareOpusDecoderManager.cs | 3 +- .../HOS/Services/Bcat/IServiceCreator.cs | 6 +- Ryujinx.HLE/HOS/Services/Bsd/IClient.cs | 13 +- .../Services/Caps/IAlbumAccessorService.cs | 3 +- .../HOS/Services/Caps/IScreenshotService.cs | 3 +- .../HOS/Services/Es/IETicketService.cs | 9 +- .../HOS/Services/Friend/IServiceCreator.cs | 11 +- .../HOS/Services/FspSrv/IFileSystemProxy.cs | 3 +- Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs | 9 +- .../HOS/Services/Hid/Irs/IIrSensorServer.cs | 3 +- Ryujinx.HLE/HOS/Services/Ldr/IRoInterface.cs | 3 +- Ryujinx.HLE/HOS/Services/Lm/ILogService.cs | 3 +- .../Services/Lr/ILocationResolverManager.cs | 3 +- Ryujinx.HLE/HOS/Services/Mm/IRequest.cs | 3 +- .../HOS/Services/Ncm/IContentManager.cs | 7 +- .../HOS/Services/Nfc/Nfp/IUserManager.cs | 3 +- .../HOS/Services/Nifm/IStaticService.cs | 3 +- .../HOS/Services/Ns/IAddOnContentManager.cs | 3 +- .../Ns/IApplicationManagerInterface.cs | 3 +- .../Services/Ns/IServiceGetterInterface.cs | 6 +- .../HOS/Services/Ns/ISystemUpdateInterface.cs | 3 +- .../Ns/IVulnerabilityManagerInterface.cs | 3 +- Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs | 6 +- .../Pctl/IParentalControlServiceFactory.cs | 6 +- .../HOS/Services/Pl/ISharedFontManager.cs | 3 +- .../HOS/Services/Pm/IShellInterface.cs | 3 +- .../HOS/Services/Prepo/IPrepoService.cs | 4 +- Ryujinx.HLE/HOS/Services/Psm/IPsmServer.cs | 3 +- Ryujinx.HLE/HOS/Services/ServiceAttributes.cs | 17 ++ .../HOS/Services/ServiceConfiguration.cs | 7 + Ryujinx.HLE/HOS/Services/ServiceFactory.cs | 236 ------------------ .../HOS/Services/Set/ISettingsServer.cs | 3 +- .../HOS/Services/Set/ISystemSettingsServer.cs | 3 +- .../HOS/Services/Sfdnsres/IResolver.cs | 3 +- Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs | 33 ++- .../HOS/Services/Spl/IRandomInterface.cs | 3 +- Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs | 3 +- .../HOS/Services/Time/IStaticService.cs | 5 +- .../Services/Vi/IApplicationRootService.cs | 3 +- .../HOS/Services/Vi/IManagerRootService.cs | 3 +- .../HOS/Services/Vi/ISystemRootService.cs | 3 +- Ryujinx.HLE/Ryujinx.HLE.csproj | 1 + 48 files changed, 175 insertions(+), 299 deletions(-) create mode 100644 Ryujinx.HLE/HOS/Services/ServiceAttributes.cs create mode 100644 Ryujinx.HLE/HOS/Services/ServiceConfiguration.cs delete mode 100644 Ryujinx.HLE/HOS/Services/ServiceFactory.cs diff --git a/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs b/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs index 101cb361c9..3f00ae66a4 100644 --- a/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs +++ b/Ryujinx.HLE/HOS/Services/Acc/IAccountService.cs @@ -11,6 +11,8 @@ using static Ryujinx.HLE.HOS.ErrorCode; namespace Ryujinx.HLE.HOS.Services.Acc { + [Service("acc:u0")] + [Service("acc:u1")] class IAccountService : IpcService { private bool _userRegistrationRequestPermitted = false; @@ -21,7 +23,7 @@ namespace Ryujinx.HLE.HOS.Services.Acc public override IReadOnlyDictionary Commands => _commands; - public IAccountService() + public IAccountService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Am/IAllSystemAppletProxiesService.cs b/Ryujinx.HLE/HOS/Services/Am/IAllSystemAppletProxiesService.cs index 0d067b169a..64bb674511 100644 --- a/Ryujinx.HLE/HOS/Services/Am/IAllSystemAppletProxiesService.cs +++ b/Ryujinx.HLE/HOS/Services/Am/IAllSystemAppletProxiesService.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Am { + [Service("appletAE")] class IAllSystemAppletProxiesService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IAllSystemAppletProxiesService() + public IAllSystemAppletProxiesService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Am/IApplicationProxyService.cs b/Ryujinx.HLE/HOS/Services/Am/IApplicationProxyService.cs index 88792a1651..8ca0586852 100644 --- a/Ryujinx.HLE/HOS/Services/Am/IApplicationProxyService.cs +++ b/Ryujinx.HLE/HOS/Services/Am/IApplicationProxyService.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Am { + [Service("appletOE")] class IApplicationProxyService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IApplicationProxyService() + public IApplicationProxyService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Apm/IManager.cs b/Ryujinx.HLE/HOS/Services/Apm/IManager.cs index cd86e51695..02f3661a0f 100644 --- a/Ryujinx.HLE/HOS/Services/Apm/IManager.cs +++ b/Ryujinx.HLE/HOS/Services/Apm/IManager.cs @@ -3,13 +3,15 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Apm { + [Service("apm")] + [Service("apm:p")] class IManager : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IManager() + public IManager(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Aud/IAudioOutManager.cs b/Ryujinx.HLE/HOS/Services/Aud/IAudioOutManager.cs index a276c96e36..e4e037dea5 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/IAudioOutManager.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/IAudioOutManager.cs @@ -11,6 +11,7 @@ using static Ryujinx.HLE.HOS.ErrorCode; namespace Ryujinx.HLE.HOS.Services.Aud { + [Service("audout:u")] class IAudioOutManager : IpcService { private const string DefaultAudioOutput = "DeviceOut"; @@ -23,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud public override IReadOnlyDictionary Commands => _commands; - public IAudioOutManager() + public IAudioOutManager(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Aud/IAudioRendererManager.cs b/Ryujinx.HLE/HOS/Services/Aud/IAudioRendererManager.cs index 18e9184cf0..c757d5fd5b 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/IAudioRendererManager.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/IAudioRendererManager.cs @@ -9,6 +9,7 @@ using static Ryujinx.HLE.HOS.ErrorCode; namespace Ryujinx.HLE.HOS.Services.Aud { + [Service("audren:u")] class IAudioRendererManager : IpcService { private const int Rev0Magic = ('R' << 0) | @@ -24,7 +25,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud public override IReadOnlyDictionary Commands => _commands; - public IAudioRendererManager() + public IAudioRendererManager(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs b/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs index 0b5e12f098..e66a9fe603 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoderManager.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Aud { + [Service("hwopus")] class IHardwareOpusDecoderManager : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IHardwareOpusDecoderManager() + public IHardwareOpusDecoderManager(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs b/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs index 6523aa632e..6ed7ec3fcb 100644 --- a/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs +++ b/Ryujinx.HLE/HOS/Services/Bcat/IServiceCreator.cs @@ -3,13 +3,17 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Bcat { + [Service("bcat:a")] + [Service("bcat:m")] + [Service("bcat:u")] + [Service("bcat:s")] class IServiceCreator : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IServiceCreator() + public IServiceCreator(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Bsd/IClient.cs b/Ryujinx.HLE/HOS/Services/Bsd/IClient.cs index 86d914d4db..0d5775d588 100644 --- a/Ryujinx.HLE/HOS/Services/Bsd/IClient.cs +++ b/Ryujinx.HLE/HOS/Services/Bsd/IClient.cs @@ -8,9 +8,10 @@ using System.Text; namespace Ryujinx.HLE.HOS.Services.Bsd { + [Service("bsd:s", true)] + [Service("bsd:u", false)] class IClient : IpcService { - private static Dictionary _errorMap = new Dictionary { // WSAEINTR @@ -95,15 +96,15 @@ namespace Ryujinx.HLE.HOS.Services.Bsd {0, 0} }; - private Dictionary _commands; - - public override IReadOnlyDictionary Commands => _commands; - private bool _isPrivileged; private List _sockets = new List(); - public IClient(bool isPrivileged) + private Dictionary _commands; + + public override IReadOnlyDictionary Commands => _commands; + + public IClient(ServiceCtx context, bool isPrivileged) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Caps/IAlbumAccessorService.cs b/Ryujinx.HLE/HOS/Services/Caps/IAlbumAccessorService.cs index 82da2451ab..f10095edf4 100644 --- a/Ryujinx.HLE/HOS/Services/Caps/IAlbumAccessorService.cs +++ b/Ryujinx.HLE/HOS/Services/Caps/IAlbumAccessorService.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Caps { + [Service("caps:a")] class IAlbumAccessorService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IAlbumAccessorService() + public IAlbumAccessorService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Caps/IScreenshotService.cs b/Ryujinx.HLE/HOS/Services/Caps/IScreenshotService.cs index 9273b39403..e37c51e247 100644 --- a/Ryujinx.HLE/HOS/Services/Caps/IScreenshotService.cs +++ b/Ryujinx.HLE/HOS/Services/Caps/IScreenshotService.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Caps { + [Service("caps:ss")] class IScreenshotService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IScreenshotService() + public IScreenshotService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Es/IETicketService.cs b/Ryujinx.HLE/HOS/Services/Es/IETicketService.cs index 049e94dbcd..4aa0a7fa18 100644 --- a/Ryujinx.HLE/HOS/Services/Es/IETicketService.cs +++ b/Ryujinx.HLE/HOS/Services/Es/IETicketService.cs @@ -3,20 +3,19 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Es { + [Service("es")] class IeTicketService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - private bool _isInitialized; - - public IeTicketService() + public IeTicketService(ServiceCtx context) { _commands = new Dictionary { - + //... }; } } -} +} \ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Friend/IServiceCreator.cs b/Ryujinx.HLE/HOS/Services/Friend/IServiceCreator.cs index dea9d9ae13..af97391d0d 100644 --- a/Ryujinx.HLE/HOS/Services/Friend/IServiceCreator.cs +++ b/Ryujinx.HLE/HOS/Services/Friend/IServiceCreator.cs @@ -7,15 +7,20 @@ using static Ryujinx.HLE.HOS.ErrorCode; namespace Ryujinx.HLE.HOS.Services.Friend { + [Service("friend:a", FriendServicePermissionLevel.Admin)] + [Service("friend:m", FriendServicePermissionLevel.Manager)] + [Service("friend:s", FriendServicePermissionLevel.System)] + [Service("friend:u", FriendServicePermissionLevel.User)] + [Service("friend:v", FriendServicePermissionLevel.Overlay)] class IServiceCreator : IpcService { - private Dictionary _commands; - private FriendServicePermissionLevel _permissionLevel; + private Dictionary _commands; + public override IReadOnlyDictionary Commands => _commands; - public IServiceCreator(FriendServicePermissionLevel permissionLevel) + public IServiceCreator(ServiceCtx context, FriendServicePermissionLevel permissionLevel) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs b/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs index a1afe9beb1..84869bf55e 100644 --- a/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs +++ b/Ryujinx.HLE/HOS/Services/FspSrv/IFileSystemProxy.cs @@ -15,13 +15,14 @@ using static Ryujinx.HLE.Utilities.StringUtils; namespace Ryujinx.HLE.HOS.Services.FspSrv { + [Service("fsp-srv")] class IFileSystemProxy : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IFileSystemProxy() + public IFileSystemProxy(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs index 7e48a18690..0ea7f1917a 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs @@ -8,6 +8,7 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Hid { + [Service("hid")] class IHidServer : IpcService { private Dictionary _commands; @@ -40,7 +41,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid public override IReadOnlyDictionary Commands => _commands; - public IHidServer(Horizon system) + public IHidServer(ServiceCtx context) { _commands = new Dictionary { @@ -149,9 +150,9 @@ namespace Ryujinx.HLE.HOS.Services.Hid { 1001, GetNpadCommunicationMode } }; - _npadStyleSetUpdateEvent = new KEvent(system); - _xpadIdEvent = new KEvent(system); - _palmaOperationCompleteEvent = new KEvent(system); + _npadStyleSetUpdateEvent = new KEvent(context.Device.System); + _xpadIdEvent = new KEvent(context.Device.System); + _palmaOperationCompleteEvent = new KEvent(context.Device.System); _npadJoyHoldType = HidNpadJoyHoldType.Vertical; _npadStyleSet = HidNpadStyle.FullKey | HidNpadStyle.Dual | HidNpadStyle.Left | HidNpadStyle.Right | HidNpadStyle.Handheld; diff --git a/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs b/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs index da1fbc1891..a720ef4dea 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/Irs/IIrSensorServer.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Hid.Irs { + [Service("irs")] class IIrSensorServer : IpcService { private int _irsensorSharedMemoryHandle = 0; @@ -15,7 +16,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid.Irs public override IReadOnlyDictionary Commands => _commands; - public IIrSensorServer() + public IIrSensorServer(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Ldr/IRoInterface.cs b/Ryujinx.HLE/HOS/Services/Ldr/IRoInterface.cs index 49edab59e6..8820e2d4b3 100644 --- a/Ryujinx.HLE/HOS/Services/Ldr/IRoInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ldr/IRoInterface.cs @@ -95,6 +95,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldr } } + [Service("ldr:ro")] class IRoInterface : IpcService { private Dictionary _commands; @@ -112,7 +113,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldr private bool _isInitialized; - public IRoInterface() + public IRoInterface(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Lm/ILogService.cs b/Ryujinx.HLE/HOS/Services/Lm/ILogService.cs index 37621c3176..0be76866b6 100644 --- a/Ryujinx.HLE/HOS/Services/Lm/ILogService.cs +++ b/Ryujinx.HLE/HOS/Services/Lm/ILogService.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Lm { + [Service("lm")] class ILogService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public ILogService() + public ILogService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Lr/ILocationResolverManager.cs b/Ryujinx.HLE/HOS/Services/Lr/ILocationResolverManager.cs index 4b2de6b388..00186037c9 100644 --- a/Ryujinx.HLE/HOS/Services/Lr/ILocationResolverManager.cs +++ b/Ryujinx.HLE/HOS/Services/Lr/ILocationResolverManager.cs @@ -4,13 +4,14 @@ using Ryujinx.HLE.FileSystem; namespace Ryujinx.HLE.HOS.Services.Lr { + [Service("lr")] class ILocationResolverManager : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public ILocationResolverManager() + public ILocationResolverManager(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Mm/IRequest.cs b/Ryujinx.HLE/HOS/Services/Mm/IRequest.cs index 932e5b0d60..6d450b21b7 100644 --- a/Ryujinx.HLE/HOS/Services/Mm/IRequest.cs +++ b/Ryujinx.HLE/HOS/Services/Mm/IRequest.cs @@ -4,13 +4,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Mm { + [Service("mm:u")] class IRequest : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IRequest() + public IRequest(ServiceCtx context) { _commands = new Dictionary() { diff --git a/Ryujinx.HLE/HOS/Services/Ncm/IContentManager.cs b/Ryujinx.HLE/HOS/Services/Ncm/IContentManager.cs index bd92a45065..6dc46dc13d 100644 --- a/Ryujinx.HLE/HOS/Services/Ncm/IContentManager.cs +++ b/Ryujinx.HLE/HOS/Services/Ncm/IContentManager.cs @@ -3,18 +3,19 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Ncm { + [Service("ncm")] class IContentManager : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IContentManager() + public IContentManager(ServiceCtx context) { _commands = new Dictionary { - + //... }; } } -} +} \ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/Nfc/Nfp/IUserManager.cs b/Ryujinx.HLE/HOS/Services/Nfc/Nfp/IUserManager.cs index dad1026ecf..8350b37c65 100644 --- a/Ryujinx.HLE/HOS/Services/Nfc/Nfp/IUserManager.cs +++ b/Ryujinx.HLE/HOS/Services/Nfc/Nfp/IUserManager.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp { + [Service("nfp:user")] class IUserManager : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IUserManager() + public IUserManager(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Nifm/IStaticService.cs b/Ryujinx.HLE/HOS/Services/Nifm/IStaticService.cs index 42d9c78e7e..91b4d1294d 100644 --- a/Ryujinx.HLE/HOS/Services/Nifm/IStaticService.cs +++ b/Ryujinx.HLE/HOS/Services/Nifm/IStaticService.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Nifm { + [Service("nifm:u")] class IStaticService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IStaticService() + public IStaticService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs b/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs index 9139c9bfc8..fe845f8747 100644 --- a/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs +++ b/Ryujinx.HLE/HOS/Services/Ns/IAddOnContentManager.cs @@ -4,13 +4,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Ns { + [Service("aoc:u")] class IAddOnContentManager : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IAddOnContentManager() + public IAddOnContentManager(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Ns/IApplicationManagerInterface.cs b/Ryujinx.HLE/HOS/Services/Ns/IApplicationManagerInterface.cs index 8c0fa41a8b..88e669642e 100644 --- a/Ryujinx.HLE/HOS/Services/Ns/IApplicationManagerInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ns/IApplicationManagerInterface.cs @@ -6,13 +6,14 @@ using System.Text; namespace Ryujinx.HLE.HOS.Services.Ns { + [Service("ns:am")] class IApplicationManagerInterface : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IApplicationManagerInterface() + public IApplicationManagerInterface(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Ns/IServiceGetterInterface.cs b/Ryujinx.HLE/HOS/Services/Ns/IServiceGetterInterface.cs index 89dde1f9bb..7c42d3edee 100644 --- a/Ryujinx.HLE/HOS/Services/Ns/IServiceGetterInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ns/IServiceGetterInterface.cs @@ -3,13 +3,15 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Ns { + [Service("ns:am2")] + [Service("ns:ec")] class IServiceGetterInterface : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IServiceGetterInterface() + public IServiceGetterInterface(ServiceCtx context) { _commands = new Dictionary { @@ -19,7 +21,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns public long GetApplicationManagerInterface(ServiceCtx context) { - MakeObject(context, new IApplicationManagerInterface()); + MakeObject(context, new IApplicationManagerInterface(context)); return 0; } diff --git a/Ryujinx.HLE/HOS/Services/Ns/ISystemUpdateInterface.cs b/Ryujinx.HLE/HOS/Services/Ns/ISystemUpdateInterface.cs index 5499e235f3..503b2f10d0 100644 --- a/Ryujinx.HLE/HOS/Services/Ns/ISystemUpdateInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ns/ISystemUpdateInterface.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Ns { + [Service("ns:su")] class ISystemUpdateInterface : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public ISystemUpdateInterface() + public ISystemUpdateInterface(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Ns/IVulnerabilityManagerInterface.cs b/Ryujinx.HLE/HOS/Services/Ns/IVulnerabilityManagerInterface.cs index 6b7c419340..c8a31e1606 100644 --- a/Ryujinx.HLE/HOS/Services/Ns/IVulnerabilityManagerInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Ns/IVulnerabilityManagerInterface.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Ns { + [Service("ns:vm")] class IVulnerabilityManagerInterface : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IVulnerabilityManagerInterface() + public IVulnerabilityManagerInterface(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs b/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs index dcfaef7896..bfd91c44b8 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs @@ -14,6 +14,8 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Nv { + [Service("nvdrv")] + [Service("nvdrv:a")] class INvDrvServices : IpcService { private delegate int IoctlProcessor(ServiceCtx context, int cmd); @@ -38,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv private KEvent _event; - public INvDrvServices(Horizon system) + public INvDrvServices(ServiceCtx context) { _commands = new Dictionary() { @@ -53,7 +55,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv { 13, FinishInitialize } }; - _event = new KEvent(system); + _event = new KEvent(context.Device.System); } static INvDrvServices() diff --git a/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs b/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs index 92500187ca..372560e68f 100644 --- a/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs +++ b/Ryujinx.HLE/HOS/Services/Pctl/IParentalControlServiceFactory.cs @@ -3,13 +3,17 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Pctl { + [Service("pctl")] + [Service("pctl:a")] + [Service("pctl:r")] + [Service("pctl:s")] class IParentalControlServiceFactory : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IParentalControlServiceFactory() + public IParentalControlServiceFactory(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs b/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs index 1c67d35685..7fc4e6cd71 100644 --- a/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs +++ b/Ryujinx.HLE/HOS/Services/Pl/ISharedFontManager.cs @@ -6,13 +6,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Pl { + [Service("pl:u")] class ISharedFontManager : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public ISharedFontManager() + public ISharedFontManager(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs b/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs index 35fdd5472f..69e221eb5d 100644 --- a/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Pm/IShellInterface.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Pm { + [Service("pm:shell")] class IShellInterface : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IShellInterface() + public IShellInterface(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs b/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs index a3cb5cc900..0997644513 100644 --- a/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs +++ b/Ryujinx.HLE/HOS/Services/Prepo/IPrepoService.cs @@ -4,13 +4,15 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Prepo { + [Service("prepo:a")] + [Service("prepo:u")] class IPrepoService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IPrepoService() + public IPrepoService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Psm/IPsmServer.cs b/Ryujinx.HLE/HOS/Services/Psm/IPsmServer.cs index 02bc5524e8..2310e8b900 100644 --- a/Ryujinx.HLE/HOS/Services/Psm/IPsmServer.cs +++ b/Ryujinx.HLE/HOS/Services/Psm/IPsmServer.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Psm { + [Service("psm")] class IPsmServer : IpcService { enum ChargerType @@ -17,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Psm public override IReadOnlyDictionary Commands => _commands; - public IPsmServer() + public IPsmServer(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/ServiceAttributes.cs b/Ryujinx.HLE/HOS/Services/ServiceAttributes.cs new file mode 100644 index 0000000000..9ca775afe8 --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/ServiceAttributes.cs @@ -0,0 +1,17 @@ +using System; + +namespace Ryujinx.HLE.HOS.Services +{ + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] + public class ServiceAttribute : Attribute + { + public readonly string Name; + public readonly object Parameter; + + public ServiceAttribute(string name, object parameter = null) + { + Name = name; + Parameter = parameter; + } + } +} \ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/ServiceConfiguration.cs b/Ryujinx.HLE/HOS/Services/ServiceConfiguration.cs new file mode 100644 index 0000000000..d73c76d9cf --- /dev/null +++ b/Ryujinx.HLE/HOS/Services/ServiceConfiguration.cs @@ -0,0 +1,7 @@ +namespace Ryujinx.HLE.HOS.Services +{ + public static class ServiceConfiguration + { + public static bool IgnoreMissingServices { get; set; } + } +} \ No newline at end of file diff --git a/Ryujinx.HLE/HOS/Services/ServiceFactory.cs b/Ryujinx.HLE/HOS/Services/ServiceFactory.cs deleted file mode 100644 index 3edb5619ee..0000000000 --- a/Ryujinx.HLE/HOS/Services/ServiceFactory.cs +++ /dev/null @@ -1,236 +0,0 @@ -using Ryujinx.Common.Logging; -using Ryujinx.HLE.HOS.Services.Acc; -using Ryujinx.HLE.HOS.Services.Am; -using Ryujinx.HLE.HOS.Services.Apm; -using Ryujinx.HLE.HOS.Services.Aud; -using Ryujinx.HLE.HOS.Services.Bsd; -using Ryujinx.HLE.HOS.Services.Caps; -using Ryujinx.HLE.HOS.Services.Es; -using Ryujinx.HLE.HOS.Services.FspSrv; -using Ryujinx.HLE.HOS.Services.Hid; -using Ryujinx.HLE.HOS.Services.Hid.Irs; -using Ryujinx.HLE.HOS.Services.Ldr; -using Ryujinx.HLE.HOS.Services.Lm; -using Ryujinx.HLE.HOS.Services.Mm; -using Ryujinx.HLE.HOS.Services.Ncm; -using Ryujinx.HLE.HOS.Services.Nfc.Nfp; -using Ryujinx.HLE.HOS.Services.Ns; -using Ryujinx.HLE.HOS.Services.Nv; -using Ryujinx.HLE.HOS.Services.Pctl; -using Ryujinx.HLE.HOS.Services.Pl; -using Ryujinx.HLE.HOS.Services.Pm; -using Ryujinx.HLE.HOS.Services.Prepo; -using Ryujinx.HLE.HOS.Services.Psm; -using Ryujinx.HLE.HOS.Services.Set; -using Ryujinx.HLE.HOS.Services.Sfdnsres; -using Ryujinx.HLE.HOS.Services.Sm; -using Ryujinx.HLE.HOS.Services.Spl; -using Ryujinx.HLE.HOS.Services.Ssl; -using Ryujinx.HLE.HOS.Services.Vi; -using System; - -namespace Ryujinx.HLE.HOS.Services -{ - public static class ServiceConfiguration - { - public static bool IgnoreMissingServices { get; set; } - } - - static class ServiceFactory - { - public static IpcService MakeService(Horizon system, string name) - { - switch (name) - { - case "acc:u0": - return new IAccountService(); - - case "acc:u1": - return new IAccountService(); - - case "aoc:u": - return new IAddOnContentManager(); - - case "apm": - return new IManager(); - - case "apm:p": - return new IManager(); - - case "appletAE": - return new IAllSystemAppletProxiesService(); - - case "appletOE": - return new IApplicationProxyService(); - - case "audout:u": - return new IAudioOutManager(); - - case "audren:u": - return new IAudioRendererManager(); - - case "bcat:a": - return new Bcat.IServiceCreator(); - - case "bcat:m": - return new Bcat.IServiceCreator(); - - case "bcat:u": - return new Bcat.IServiceCreator(); - - case "bcat:s": - return new Bcat.IServiceCreator(); - - case "bsd:s": - return new IClient(true); - - case "bsd:u": - return new IClient(false); - - case "caps:a": - return new IAlbumAccessorService(); - - case "caps:ss": - return new IScreenshotService(); - - case "csrng": - return new IRandomInterface(); - - case "es": - return new IeTicketService(); - - case "friend:a": - return new Friend.IServiceCreator(Friend.FriendServicePermissionLevel.Admin); - - case "friend:u": - return new Friend.IServiceCreator(Friend.FriendServicePermissionLevel.User); - - case "friend:v": - return new Friend.IServiceCreator(Friend.FriendServicePermissionLevel.Overlay); - - case "friend:m": - return new Friend.IServiceCreator(Friend.FriendServicePermissionLevel.Manager); - - case "friend:s": - return new Friend.IServiceCreator(Friend.FriendServicePermissionLevel.System); - - case "fsp-srv": - return new IFileSystemProxy(); - - case "hid": - return new IHidServer(system); - - case "irs": - return new IIrSensorServer(); - - case "ldr:ro": - return new IRoInterface(); - - case "hwopus": - return new IHardwareOpusDecoderManager(); - - case "lm": - return new ILogService(); - - case "mm:u": - return new IRequest(); - - case "ncm": - return new IContentManager(); - - case "nfp:user": - return new IUserManager(); - - case "nifm:u": - return new Nifm.IStaticService(); - - case "ns:am": - return new IApplicationManagerInterface(); - - case "ns:am2": - case "ns:ec": - return new IServiceGetterInterface(); - - case "ns:su": - return new ISystemUpdateInterface(); - - case "ns:vm": - return new IVulnerabilityManagerInterface(); - - case "nvdrv": - return new INvDrvServices(system); - - case "nvdrv:a": - return new INvDrvServices(system); - - case "pctl:s": - return new IParentalControlServiceFactory(); - - case "pctl:r": - return new IParentalControlServiceFactory(); - - case "pctl:a": - return new IParentalControlServiceFactory(); - - case "pctl": - return new IParentalControlServiceFactory(); - - case "pl:u": - return new ISharedFontManager(); - - case "pm:shell": - return new IShellInterface(); - - case "prepo:a": - return new IPrepoService(); - - case "prepo:u": - return new IPrepoService(); - - case "psm": - return new IPsmServer(); - - case "set": - return new ISettingsServer(); - - case "set:sys": - return new ISystemSettingsServer(); - - case "sfdnsres": - return new IResolver(); - - case "sm:": - return new IUserInterface(); - - case "ssl": - return new ISslService(); - - case "time:a": - return new Time.IStaticService(); - - case "time:s": - return new Time.IStaticService(); - - case "time:u": - return new Time.IStaticService(); - - case "vi:m": - return new IManagerRootService(); - - case "vi:s": - return new ISystemRootService(); - - case "vi:u": - return new IApplicationRootService(); - } - - if (ServiceConfiguration.IgnoreMissingServices) - { - Logger.PrintWarning(LogClass.Service, $"Missing service {name} ignored"); - return new DummyService(name); - } - - throw new NotImplementedException(name); - } - } -} diff --git a/Ryujinx.HLE/HOS/Services/Set/ISettingsServer.cs b/Ryujinx.HLE/HOS/Services/Set/ISettingsServer.cs index 3b8e595c44..d554d8c178 100644 --- a/Ryujinx.HLE/HOS/Services/Set/ISettingsServer.cs +++ b/Ryujinx.HLE/HOS/Services/Set/ISettingsServer.cs @@ -8,13 +8,14 @@ using static Ryujinx.HLE.HOS.ErrorCode; namespace Ryujinx.HLE.HOS.Services.Set { + [Service("set")] class ISettingsServer : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public ISettingsServer() + public ISettingsServer(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs b/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs index fd8ffe5ef6..377f484df6 100644 --- a/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs +++ b/Ryujinx.HLE/HOS/Services/Set/ISystemSettingsServer.cs @@ -11,13 +11,14 @@ using System.Text; namespace Ryujinx.HLE.HOS.Services.Set { + [Service("set:sys")] class ISystemSettingsServer : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public ISystemSettingsServer() + public ISystemSettingsServer(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Sfdnsres/IResolver.cs b/Ryujinx.HLE/HOS/Services/Sfdnsres/IResolver.cs index 5a7b9f4595..1460e2ef40 100644 --- a/Ryujinx.HLE/HOS/Services/Sfdnsres/IResolver.cs +++ b/Ryujinx.HLE/HOS/Services/Sfdnsres/IResolver.cs @@ -10,13 +10,14 @@ using static Ryujinx.HLE.HOS.ErrorCode; namespace Ryujinx.HLE.HOS.Services.Sfdnsres { + [Service("sfdnsres")] class IResolver : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IResolver() + public IResolver(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs b/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs index 914862f1c9..4a663bd7e2 100644 --- a/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs @@ -6,11 +6,16 @@ using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; +using System.Linq; +using System.Reflection; namespace Ryujinx.HLE.HOS.Services.Sm { + [Service("sm:")] class IUserInterface : IpcService { + private Dictionary _services; + private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; @@ -19,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Services.Sm private bool _isInitialized; - public IUserInterface() + public IUserInterface(ServiceCtx context = null) { _commands = new Dictionary { @@ -30,6 +35,11 @@ namespace Ryujinx.HLE.HOS.Services.Sm }; _registeredServices = new ConcurrentDictionary(); + + _services = Assembly.GetExecutingAssembly().GetTypes() + .SelectMany(type => type.GetCustomAttributes(typeof(ServiceAttribute), true) + .Select(service => (((ServiceAttribute)service).Name, type))) + .ToDictionary(service => service.Name, service => service.type); } public static void InitializePort(Horizon system) @@ -75,7 +85,26 @@ namespace Ryujinx.HLE.HOS.Services.Sm } else { - session.ClientSession.Service = ServiceFactory.MakeService(context.Device.System, name); + if (_services.TryGetValue(name, out Type type)) + { + ServiceAttribute serviceAttribute = (ServiceAttribute)type.GetCustomAttributes(typeof(ServiceAttribute)).First(service => ((ServiceAttribute)service).Name == name); + + session.ClientSession.Service = serviceAttribute.Parameter != null ? (IpcService)Activator.CreateInstance(type, context, serviceAttribute.Parameter) + : (IpcService)Activator.CreateInstance(type, context); + } + else + { + if (ServiceConfiguration.IgnoreMissingServices) + { + Logger.PrintWarning(LogClass.Service, $"Missing service {name} ignored"); + + session.ClientSession.Service = new DummyService(name); + } + else + { + throw new NotImplementedException(name); + } + } } if (context.Process.HandleTable.GenerateHandle(session.ClientSession, out int handle) != KernelResult.Success) diff --git a/Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs b/Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs index cae8d8d02e..624cb07499 100644 --- a/Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Spl/IRandomInterface.cs @@ -5,6 +5,7 @@ using System.Security.Cryptography; namespace Ryujinx.HLE.HOS.Services.Spl { + [Service("csrng")] class IRandomInterface : IpcService, IDisposable { private Dictionary _commands; @@ -13,7 +14,7 @@ namespace Ryujinx.HLE.HOS.Services.Spl private RNGCryptoServiceProvider _rng; - public IRandomInterface() + public IRandomInterface(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs b/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs index 5afc8c72eb..67e025e86c 100644 --- a/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs +++ b/Ryujinx.HLE/HOS/Services/Ssl/ISslService.cs @@ -4,13 +4,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Ssl { + [Service("ssl")] class ISslService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public ISslService() + public ISslService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Time/IStaticService.cs b/Ryujinx.HLE/HOS/Services/Time/IStaticService.cs index 107d0578d6..1406c2b563 100644 --- a/Ryujinx.HLE/HOS/Services/Time/IStaticService.cs +++ b/Ryujinx.HLE/HOS/Services/Time/IStaticService.cs @@ -5,6 +5,9 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Time { + [Service("time:a")] + [Service("time:s")] + [Service("time:u")] class IStaticService : IpcService { private int _timeSharedMemoryNativeHandle = 0; @@ -15,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Time private static readonly DateTime StartupDate = DateTime.UtcNow; - public IStaticService() + public IStaticService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Vi/IApplicationRootService.cs b/Ryujinx.HLE/HOS/Services/Vi/IApplicationRootService.cs index 66ab16bddc..27ffcc931e 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/IApplicationRootService.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/IApplicationRootService.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Vi { + [Service("vi:u")] class IApplicationRootService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IApplicationRootService() + public IApplicationRootService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Vi/IManagerRootService.cs b/Ryujinx.HLE/HOS/Services/Vi/IManagerRootService.cs index 0f0a4f2642..59f76e9330 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/IManagerRootService.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/IManagerRootService.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Vi { + [Service("vi:m")] class IManagerRootService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public IManagerRootService() + public IManagerRootService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/HOS/Services/Vi/ISystemRootService.cs b/Ryujinx.HLE/HOS/Services/Vi/ISystemRootService.cs index 5e255ce5a7..6a8aed074c 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/ISystemRootService.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/ISystemRootService.cs @@ -3,13 +3,14 @@ using System.Collections.Generic; namespace Ryujinx.HLE.HOS.Services.Vi { + [Service("vi:s")] class ISystemRootService : IpcService { private Dictionary _commands; public override IReadOnlyDictionary Commands => _commands; - public ISystemRootService() + public ISystemRootService(ServiceCtx context) { _commands = new Dictionary { diff --git a/Ryujinx.HLE/Ryujinx.HLE.csproj b/Ryujinx.HLE/Ryujinx.HLE.csproj index 50d84c3fd7..099a2cd98c 100644 --- a/Ryujinx.HLE/Ryujinx.HLE.csproj +++ b/Ryujinx.HLE/Ryujinx.HLE.csproj @@ -4,6 +4,7 @@ netcoreapp2.1 win10-x64;osx-x64;linux-x64 Debug;Release;Profile Debug;Profile Release + 7.1