aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs
diff options
context:
space:
mode:
authorAlex Barney <thealexbarney@gmail.com>2021-12-23 09:55:50 -0700
committerGitHub <noreply@github.com>2021-12-23 13:55:50 -0300
commitaa932a6df1764b7c600ae0ba4e0c7a0ba802f312 (patch)
tree24a390cf2330620aeeab1efbd42ae4099f61ca86 /Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs
parentcb43cc7e322014ce2bd0ee73b06d403be62fa8d5 (diff)
Update to LibHac v0.14.3 (#2925)
* Update to LibHac v0.14.3 * Fix loading NCAs that don't have a data partition
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs')
-rw-r--r--Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs23
1 files changed, 14 insertions, 9 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs b/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs
index 8fd6a3a8..edb4b03a 100644
--- a/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs
+++ b/Ryujinx.HLE/HOS/Services/Bcat/ServiceCreator/IDeliveryCacheStorageService.cs
@@ -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();
}
}
}