mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-04-18 20:22:59 +00:00
Structural and Memory Safety Improvements, Analyzer Cleanup (ryubing/ryujinx!47)
See merge request ryubing/ryujinx!47
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user