Fix Services

it can have multiple items of one Service
This commit is contained in:
jonnysp 2019-02-21 18:26:07 +01:00 committed by Alex Barney
parent f3d7054c79
commit 7904772fc0
2 changed files with 14 additions and 5 deletions

View file

@ -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<KernelAccessControlMmio>();
PageMmio = new List<KernelAccessControlMmio>();
Irq = new List<KernelAccessControlIrq>();
}
}
}

View file

@ -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<string, bool> Services { get; } = new Dictionary<string, bool>();
public List<Tuple<string, bool>> Services { get; } = new List<Tuple<string, bool>>();
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<string, bool>(reader.ReadAscii(length), registerAllowed));
bytesRead += length + 1;
}