From 7904772fc045a02ba231b7d0eb0d7d12e6c16cdf Mon Sep 17 00:00:00 2001 From: jonnysp Date: Thu, 21 Feb 2019 18:26:07 +0100 Subject: [PATCH] Fix Services it can have multiple items of one Service --- src/LibHac/Npdm/KernelAccessItem.cs | 12 ++++++++++-- src/LibHac/Npdm/ServiceAccessControl.cs | 7 ++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/LibHac/Npdm/KernelAccessItem.cs b/src/LibHac/Npdm/KernelAccessItem.cs index 3b7e2dc9..fd5199f2 100644 --- a/src/LibHac/Npdm/KernelAccessItem.cs +++ b/src/LibHac/Npdm/KernelAccessItem.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; namespace LibHac.Npdm { - public struct KernelAccessControlItem + public class KernelAccessControlItem { public bool HasKernelFlags { get; set; } public uint LowestThreadPriority { get; set; } @@ -29,5 +29,13 @@ namespace LibHac.Npdm public bool HasDebugFlags { get; set; } public bool AllowDebug { get; set; } public bool ForceDebug { get; set; } + + public KernelAccessControlItem() + { + NormalMmio = new List(); + PageMmio = new List(); + Irq = new List(); + } } -} \ No newline at end of file + +} diff --git a/src/LibHac/Npdm/ServiceAccessControl.cs b/src/LibHac/Npdm/ServiceAccessControl.cs index 1a11d225..b6e323ee 100644 --- a/src/LibHac/Npdm/ServiceAccessControl.cs +++ b/src/LibHac/Npdm/ServiceAccessControl.cs @@ -1,11 +1,12 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; namespace LibHac.Npdm { public class ServiceAccessControl { - public Dictionary Services { get; } = new Dictionary(); + public List> Services { get; } = new List>(); public ServiceAccessControl(Stream stream, int offset, int size) { @@ -27,7 +28,7 @@ namespace LibHac.Npdm int length = ((controlByte & 0x07)) + 1; bool registerAllowed = ((controlByte & 0x80) != 0); - Services.Add(reader.ReadAscii(length), registerAllowed); + Services.Add(new Tuple(reader.ReadAscii(length), registerAllowed)); bytesRead += length + 1; }