mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-06-28 03:16:23 +02:00
Replace DllImport
usage with LibraryImport
(#4084)
* 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>
This commit is contained in:
parent
f4d731ae20
commit
0fbcd630bc
30 changed files with 308 additions and 299 deletions
|
@ -4,7 +4,7 @@ using Ryujinx.Common;
|
|||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.GraphicsDriver;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Common.System;
|
||||
using Ryujinx.Common.SystemInterop;
|
||||
using Ryujinx.Common.SystemInfo;
|
||||
using Ryujinx.Modules;
|
||||
using Ryujinx.SDL2.Common;
|
||||
|
@ -23,7 +23,7 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace Ryujinx
|
||||
{
|
||||
class Program
|
||||
partial class Program
|
||||
{
|
||||
public static double WindowScaleFactor { get; private set; }
|
||||
|
||||
|
@ -35,17 +35,17 @@ namespace Ryujinx
|
|||
|
||||
private const string X11LibraryName = "libX11";
|
||||
|
||||
[DllImport(X11LibraryName)]
|
||||
private extern static int XInitThreads();
|
||||
[LibraryImport(X11LibraryName)]
|
||||
private static partial int XInitThreads();
|
||||
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
public static extern int MessageBoxA(IntPtr hWnd, string text, string caption, uint type);
|
||||
[LibraryImport("user32.dll", SetLastError = true)]
|
||||
public static partial int MessageBoxA(IntPtr hWnd, [MarshalAs(UnmanagedType.LPStr)] string text, [MarshalAs(UnmanagedType.LPStr)] string caption, uint type);
|
||||
|
||||
[DllImport("libc", SetLastError = true)]
|
||||
static extern int setenv(string name, string value, int overwrite);
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
private static partial int setenv([MarshalAs(UnmanagedType.LPStr)] string name, [MarshalAs(UnmanagedType.LPStr)] string value, int overwrite);
|
||||
|
||||
[DllImport("libc")]
|
||||
static extern IntPtr getenv(string name);
|
||||
[LibraryImport("libc")]
|
||||
private static partial IntPtr getenv([MarshalAs(UnmanagedType.LPStr)] string name);
|
||||
|
||||
private const uint MB_ICONWARNING = 0x30;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue