Ryujinx/src/Ryujinx.HLE/Loaders/Npdm/KernelAccessControl.cs
TSRBerry c6dc00815a
Make sure TryGetApplicationsFromFile() doesn't throw exceptions anymore (#7046)
* Add docstrings for exceptions to methods near TryGetApplicationsFromFile()

* Make sure TryGetApplicationsFromFile() doesn't throw exceptions anymore

* Add missing filePath to ApplicationData when loading applications from ExeFS

* Fix typo

Co-authored-by: riperiperi <rhy3756547@hotmail.com>

---------

Co-authored-by: riperiperi <rhy3756547@hotmail.com>
2024-07-20 16:35:43 -03:00

27 lines
980 B
C#

using System.IO;
namespace Ryujinx.HLE.Loaders.Npdm
{
public class KernelAccessControl
{
public int[] Capabilities { get; private set; }
/// <exception cref="System.ArgumentException">The stream does not support reading, is <see langword="null"/>, or is already closed.</exception>
/// <exception cref="EndOfStreamException">The end of the stream is reached.</exception>
/// <exception cref="System.ObjectDisposedException">The stream is closed.</exception>
/// <exception cref="IOException">An I/O error occurred.</exception>
public KernelAccessControl(Stream stream, int offset, int size)
{
stream.Seek(offset, SeekOrigin.Begin);
Capabilities = new int[size / 4];
BinaryReader reader = new(stream);
for (int index = 0; index < Capabilities.Length; index++)
{
Capabilities[index] = reader.ReadInt32();
}
}
}
}