Structural and Memory Safety Improvements, Analyzer Cleanup (ryubing/ryujinx!47)

See merge request ryubing/ryujinx!47
This commit is contained in:
MrKev
2025-06-11 17:58:27 -05:00
committed by LotP
parent d03ae9c164
commit ea027d65a7
309 changed files with 1018 additions and 1247 deletions

View File

@@ -1,6 +1,7 @@
using LibHac.Ncm;
using LibHac.Tools.FsSystem.NcaUtils;
using Ryujinx.HLE.FileSystem;
using System;
using System.Text;
using static Ryujinx.HLE.Utilities.StringUtils;
@@ -228,12 +229,16 @@ namespace Ryujinx.HLE.HOS.Services.Ncm.Lr.LocationResolverManager
if (!string.IsNullOrWhiteSpace(contentPath))
{
ulong position = context.Request.RecvListBuff[0].Position;
#pragma warning disable IDE0059 // Remove unnecessary value assignment
ulong size = context.Request.RecvListBuff[0].Size;
#pragma warning restore IDE0059
byte[] contentPathBuffer = Encoding.UTF8.GetBytes(contentPath);
if ((ulong)contentPathBuffer.Length > size)
{
throw new InvalidOperationException("Content path buffer size is too small.");
}
context.Memory.Write(position, contentPathBuffer);
}
else
@@ -247,9 +252,8 @@ namespace Ryujinx.HLE.HOS.Services.Ncm.Lr.LocationResolverManager
private void DeleteContentPath(ServiceCtx context, ulong titleId, NcaContentType contentType)
{
ContentManager contentManager = context.Device.System.ContentManager;
#pragma warning disable IDE0059 // Remove unnecessary value assignment
string contentPath = contentManager.GetInstalledContentPath(titleId, _storageId, NcaContentType.Manual);
#pragma warning restore IDE0059
//string contentPath = contentManager.GetInstalledContentPath(titleId, _storageId, NcaContentType.Manual);
contentManager.ClearEntry(titleId, NcaContentType.Manual, _storageId);
}