Update to LibHac v0.14.3 (#2925)
* Update to LibHac v0.14.3 * Fix loading NCAs that don't have a data partition
This commit is contained in:
parent
cb43cc7e32
commit
aa932a6df1
33 changed files with 554 additions and 406 deletions
|
@ -1,27 +1,30 @@
|
|||
using LibHac;
|
||||
using LibHac.Bcat;
|
||||
using LibHac.Common;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
|
||||
{
|
||||
class IDeliveryCacheStorageService : DisposableIpcService
|
||||
{
|
||||
private LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService _base;
|
||||
private SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService> _base;
|
||||
|
||||
public IDeliveryCacheStorageService(ServiceCtx context, LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService baseService)
|
||||
public IDeliveryCacheStorageService(ServiceCtx context, ref SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService> baseService)
|
||||
{
|
||||
_base = baseService;
|
||||
_base = SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheStorageService>.CreateMove(ref baseService);
|
||||
}
|
||||
|
||||
[CommandHipc(0)]
|
||||
// CreateFileService() -> object<nn::bcat::detail::ipc::IDeliveryCacheFileService>
|
||||
public ResultCode CreateFileService(ServiceCtx context)
|
||||
{
|
||||
Result result = _base.CreateFileService(out LibHac.Bcat.Impl.Ipc.IDeliveryCacheFileService service);
|
||||
using var service = new SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheFileService>();
|
||||
|
||||
Result result = _base.Get.CreateFileService(ref service.Ref());
|
||||
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
MakeObject(context, new IDeliveryCacheFileService(service));
|
||||
MakeObject(context, new IDeliveryCacheFileService(ref service.Ref()));
|
||||
}
|
||||
|
||||
return (ResultCode)result.Value;
|
||||
|
@ -31,11 +34,13 @@ namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
|
|||
// CreateDirectoryService() -> object<nn::bcat::detail::ipc::IDeliveryCacheDirectoryService>
|
||||
public ResultCode CreateDirectoryService(ServiceCtx context)
|
||||
{
|
||||
Result result = _base.CreateDirectoryService(out LibHac.Bcat.Impl.Ipc.IDeliveryCacheDirectoryService service);
|
||||
using var service = new SharedRef<LibHac.Bcat.Impl.Ipc.IDeliveryCacheDirectoryService>();
|
||||
|
||||
Result result = _base.Get.CreateDirectoryService(ref service.Ref());
|
||||
|
||||
if (result.IsSuccess())
|
||||
{
|
||||
MakeObject(context, new IDeliveryCacheDirectoryService(service));
|
||||
MakeObject(context, new IDeliveryCacheDirectoryService(ref service.Ref()));
|
||||
}
|
||||
|
||||
return (ResultCode)result.Value;
|
||||
|
@ -50,7 +55,7 @@ namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
|
|||
|
||||
byte[] data = new byte[size];
|
||||
|
||||
Result result = _base.EnumerateDeliveryCacheDirectory(out int count, MemoryMarshal.Cast<byte, DirectoryName>(data));
|
||||
Result result = _base.Get.EnumerateDeliveryCacheDirectory(out int count, MemoryMarshal.Cast<byte, DirectoryName>(data));
|
||||
|
||||
context.Memory.Write(position, data);
|
||||
|
||||
|
@ -63,7 +68,7 @@ namespace Ryujinx.HLE.HOS.Services.Bcat.ServiceCreator
|
|||
{
|
||||
if (isDisposing)
|
||||
{
|
||||
_base?.Dispose();
|
||||
_base.Destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue