mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-03 22:06:26 +02:00
Expose InstallFirmware
This commit is contained in:
parent
97e3fc60ca
commit
29a0c1caed
2 changed files with 16 additions and 9 deletions
|
@ -1,6 +1,7 @@
|
|||
using ARMeilleure.Translation;
|
||||
using LibHac.Ncm;
|
||||
using LibHac.Tools.FsSystem.NcaUtils;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.HOS.SystemState;
|
||||
|
@ -67,6 +68,14 @@ namespace LibRyujinx
|
|||
return LoadApplication(path);
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "device_install_firmware")]
|
||||
public static void InstallFirmwareNative(int descriptor, bool isXci)
|
||||
{
|
||||
var stream = OpenFile(descriptor);
|
||||
|
||||
InstallFirmware(stream, isXci);
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "device_get_installed_firmware_version")]
|
||||
public static IntPtr GetInstalledFirmwareVersionNative()
|
||||
{
|
||||
|
@ -258,6 +267,13 @@ namespace LibRyujinx
|
|||
}
|
||||
}
|
||||
|
||||
private static FileStream OpenFile(int descriptor)
|
||||
{
|
||||
var safeHandle = new SafeFileHandle(descriptor, false);
|
||||
|
||||
return new FileStream(safeHandle, FileAccess.ReadWrite);
|
||||
}
|
||||
|
||||
public enum FileType
|
||||
{
|
||||
None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue