diff options
author | Isaac Marovitz <42140194+IsaacMarovitz@users.noreply.github.com> | 2022-12-15 12:07:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-15 18:07:31 +0100 |
commit | 0fbcd630bc57885d6b94fd3c4b3546493e09059e (patch) | |
tree | 8e1f74775d3393d85e86a845c119a43907459884 /Ryujinx.Tests.Unicorn | |
parent | f4d731ae2094128dcd1dc4a4be60b068047a77a7 (diff) |
Replace `DllImport` usage with `LibraryImport` (#4084)1.1.472
* Replace usage of `DllImport` with `LibraryImport`
* Mark methods as `partial`
* Marshalling
* More `partial` & marshalling
* More `partial` and marshalling
* More partial and marshalling
* Update GdiPlusHelper to LibraryImport
* Unicorn
* More Partial
* Marshal
* Specify EntryPoint
* Specify EntryPoint
* Change GlobalMemoryStatusEx to LibraryImport
* Change RegisterClassEx to LibraryImport
* Define EntryPoints
* Update Ryujinx.Ava/Ui/Controls/Win32NativeInterop.cs
Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
* Update Ryujinx.Graphics.Nvdec.FFmpeg/Native/FFmpegApi.cs
Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
* Move return mashal
* Remove calling convention specification
* Remove calling conventions
* Update Ryujinx.Common/SystemInfo/WindowsSystemInfo.cs
Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
* Update Ryujinx/Modules/Updater/Updater.cs
Co-authored-by: Mary-nyan <thog@protonmail.com>
* Update Ryujinx.Ava/Modules/Updater/Updater.cs
Co-authored-by: Mary-nyan <thog@protonmail.com>
Co-authored-by: TSRBerry <20988865+TSRBerry@users.noreply.github.com>
Co-authored-by: Mary-nyan <thog@protonmail.com>
Diffstat (limited to 'Ryujinx.Tests.Unicorn')
-rw-r--r-- | Ryujinx.Tests.Unicorn/Native/Interface.cs | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/Ryujinx.Tests.Unicorn/Native/Interface.cs b/Ryujinx.Tests.Unicorn/Native/Interface.cs index 889441ab..4e34ee8b 100644 --- a/Ryujinx.Tests.Unicorn/Native/Interface.cs +++ b/Ryujinx.Tests.Unicorn/Native/Interface.cs @@ -3,11 +3,12 @@ using System; using System.Diagnostics.CodeAnalysis; using System.IO; using System.Reflection; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; namespace Ryujinx.Tests.Unicorn.Native { - public static class Interface + public static partial class Interface { public static bool IsUnicornAvailable { get; private set; } = true; @@ -58,43 +59,43 @@ namespace Ryujinx.Tests.Unicorn.Native } } - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern uint uc_version(out uint major, out uint minor); + [LibraryImport("unicorn")] + public static partial uint uc_version(out uint major, out uint minor); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern Error uc_open(Arch arch, Mode mode, out IntPtr uc); + [LibraryImport("unicorn")] + public static partial Error uc_open(Arch arch, Mode mode, out IntPtr uc); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern Error uc_close(IntPtr uc); + [LibraryImport("unicorn")] + public static partial Error uc_close(IntPtr uc); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr uc_strerror(Error err); + [LibraryImport("unicorn")] + public static partial IntPtr uc_strerror(Error err); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern Error uc_reg_write(IntPtr uc, int regid, byte[] value); + [LibraryImport("unicorn")] + public static partial Error uc_reg_write(IntPtr uc, int regid, byte[] value); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern Error uc_reg_read(IntPtr uc, int regid, byte[] value); + [LibraryImport("unicorn")] + public static partial Error uc_reg_read(IntPtr uc, int regid, byte[] value); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern Error uc_mem_write(IntPtr uc, ulong address, byte[] bytes, ulong size); + [LibraryImport("unicorn")] + public static partial Error uc_mem_write(IntPtr uc, ulong address, byte[] bytes, ulong size); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern Error uc_mem_read(IntPtr uc, ulong address, byte[] bytes, ulong size); + [LibraryImport("unicorn")] + public static partial Error uc_mem_read(IntPtr uc, ulong address, byte[] bytes, ulong size); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern Error uc_emu_start(IntPtr uc, ulong begin, ulong until, ulong timeout, ulong count); + [LibraryImport("unicorn")] + public static partial Error uc_emu_start(IntPtr uc, ulong begin, ulong until, ulong timeout, ulong count); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern Error uc_mem_map(IntPtr uc, ulong address, ulong size, uint perms); + [LibraryImport("unicorn")] + public static partial Error uc_mem_map(IntPtr uc, ulong address, ulong size, uint perms); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern Error uc_mem_unmap(IntPtr uc, ulong address, ulong size); + [LibraryImport("unicorn")] + public static partial Error uc_mem_unmap(IntPtr uc, ulong address, ulong size); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern Error uc_mem_protect(IntPtr uc, ulong address, ulong size, uint perms); + [LibraryImport("unicorn")] + public static partial Error uc_mem_protect(IntPtr uc, ulong address, ulong size, uint perms); - [DllImport("unicorn", CallingConvention = CallingConvention.Cdecl)] - public static extern Error uc_mem_regions(IntPtr uc, out IntPtr regions, out uint count); + [LibraryImport("unicorn")] + public static partial Error uc_mem_regions(IntPtr uc, out IntPtr regions, out uint count); } }
\ No newline at end of file |