From 35d91a0e58cb0b2916b7a4f138c63fcc12b71112 Mon Sep 17 00:00:00 2001 From: TSRBerry <20988865+TSRBerry@users.noreply.github.com> Date: Tue, 30 May 2023 01:48:37 +0200 Subject: Linux: Automatically increase vm.max_map_count if it's too low (#4702) * memory: Check results of pinvoke calls * Increase vm.max_map_count when running Ryujinx * Add SupportedOSPlatform attribute for WindowsApiException * Revert increasing vm.max_map_count via script * Add LinuxHelper to detect and increase vm.max_map_count With GUI dialogs, this should be a bit more user-friendly. * Supply arguments as a list to RunPkExec * Add error logging in case RunPkExec() fails * Prevent Gtk from crashing --- src/Ryujinx.Memory/WindowsShared/WindowsApi.cs | 2 ++ src/Ryujinx.Memory/WindowsShared/WindowsApiException.cs | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src/Ryujinx.Memory/WindowsShared') diff --git a/src/Ryujinx.Memory/WindowsShared/WindowsApi.cs b/src/Ryujinx.Memory/WindowsShared/WindowsApi.cs index 67e704ea..c554e320 100644 --- a/src/Ryujinx.Memory/WindowsShared/WindowsApi.cs +++ b/src/Ryujinx.Memory/WindowsShared/WindowsApi.cs @@ -1,8 +1,10 @@ using System; using System.Runtime.InteropServices; +using System.Runtime.Versioning; namespace Ryujinx.Memory.WindowsShared { + [SupportedOSPlatform("windows")] static partial class WindowsApi { public static readonly IntPtr InvalidHandleValue = new IntPtr(-1); diff --git a/src/Ryujinx.Memory/WindowsShared/WindowsApiException.cs b/src/Ryujinx.Memory/WindowsShared/WindowsApiException.cs index 3140d705..330c1842 100644 --- a/src/Ryujinx.Memory/WindowsShared/WindowsApiException.cs +++ b/src/Ryujinx.Memory/WindowsShared/WindowsApiException.cs @@ -1,7 +1,9 @@ using System; +using System.Runtime.Versioning; namespace Ryujinx.Memory.WindowsShared { + [SupportedOSPlatform("windows")] class WindowsApiException : Exception { public WindowsApiException() -- cgit v1.2.3