diff options
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs b/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs index 37f0a23c..d8f31faf 100644 --- a/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs +++ b/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs @@ -18,9 +18,11 @@ namespace Ryujinx.HLE.HOS.Services.Sm private ConcurrentDictionary<string, KPort> _registeredServices; + private readonly ServerBase _commonServer; + private bool _isInitialized; - public IUserInterface(ServiceCtx context = null) + public IUserInterface(ServiceCtx context = null) : base(new ServerBase("SmServer")) { _registeredServices = new ConcurrentDictionary<string, KPort>(); @@ -28,6 +30,8 @@ namespace Ryujinx.HLE.HOS.Services.Sm .SelectMany(type => type.GetCustomAttributes(typeof(ServiceAttribute), true) .Select(service => (((ServiceAttribute)service).Name, type))) .ToDictionary(service => service.Name, service => service.type); + + _commonServer = new ServerBase("CommonServer"); } public static void InitializePort(Horizon system) @@ -36,7 +40,9 @@ namespace Ryujinx.HLE.HOS.Services.Sm port.ClientPort.SetName("sm:"); - port.ClientPort.Service = new IUserInterface(); + IUserInterface smService = new IUserInterface(); + + port.ClientPort.Service = smService; } [Command(0)] @@ -81,8 +87,13 @@ namespace Ryujinx.HLE.HOS.Services.Sm { 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); + IpcService service = serviceAttribute.Parameter != null + ? (IpcService)Activator.CreateInstance(type, context, serviceAttribute.Parameter) + : (IpcService)Activator.CreateInstance(type, context); + + service.TrySetServer(_commonServer); + + session.ClientSession.Service = service; } else { |
