forked from MeloNX/MeloNX
* 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
26 lines
665 B
C#
26 lines
665 B
C#
using System;
|
|
using System.Runtime.Versioning;
|
|
|
|
namespace Ryujinx.Memory.WindowsShared
|
|
{
|
|
[SupportedOSPlatform("windows")]
|
|
class WindowsApiException : Exception
|
|
{
|
|
public WindowsApiException()
|
|
{
|
|
}
|
|
|
|
public WindowsApiException(string functionName) : base(CreateMessage(functionName))
|
|
{
|
|
}
|
|
|
|
public WindowsApiException(string functionName, Exception inner) : base(CreateMessage(functionName), inner)
|
|
{
|
|
}
|
|
|
|
private static string CreateMessage(string functionName)
|
|
{
|
|
return $"{functionName} returned error code 0x{WindowsApi.GetLastError():X}.";
|
|
}
|
|
}
|
|
} |