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

This reverts merge request !47
This commit is contained in:
GreemDev
2025-06-15 20:45:26 -05:00
parent faf9e3cdd7
commit 77a797f154
307 changed files with 1245 additions and 1016 deletions

View File

@@ -1,7 +1,6 @@
using LibHac.Ncm;
using LibHac.Tools.FsSystem.NcaUtils;
using Ryujinx.HLE.FileSystem;
using System;
using System.Text;
using static Ryujinx.HLE.Utilities.StringUtils;
@@ -229,16 +228,12 @@ 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
@@ -252,8 +247,9 @@ namespace Ryujinx.HLE.HOS.Services.Ncm.Lr.LocationResolverManager
private void DeleteContentPath(ServiceCtx context, ulong titleId, NcaContentType contentType)
{
ContentManager contentManager = context.Device.System.ContentManager;
//string contentPath = contentManager.GetInstalledContentPath(titleId, _storageId, NcaContentType.Manual);
#pragma warning disable IDE0059 // Remove unnecessary value assignment
string contentPath = contentManager.GetInstalledContentPath(titleId, _storageId, NcaContentType.Manual);
#pragma warning restore IDE0059
contentManager.ClearEntry(titleId, NcaContentType.Manual, _storageId);
}