mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-26 01:36:59 +00:00
Merge branch ryujinx:master into ui-userprofiles-and-misc
This commit is contained in:
commit
e7e0d4d877
3 changed files with 40 additions and 11 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.Exceptions;
|
||||
using Ryujinx.HLE.HOS.Applets;
|
||||
using Ryujinx.HLE.HOS.Ipc;
|
||||
using Ryujinx.HLE.HOS.Kernel;
|
||||
|
|
@ -119,12 +120,19 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Lib
|
|||
}
|
||||
|
||||
[CommandCmif(90)]
|
||||
// ILibraryAppletAccessor:90
|
||||
// Unknown90(ulong[4])
|
||||
public ResultCode Unknown90(ServiceCtx context)
|
||||
{
|
||||
// NOTE: This call is performed on SDK 20+ when applet is called.
|
||||
// Since we don't support applets for now, it's fine to stub it.
|
||||
|
||||
// Since we don't support most applets for now, it's fine to stub it.
|
||||
// Throw if values are not 0 to learn more about what this function does.
|
||||
|
||||
if (context.RequestData.ReadUInt64() != 0 || context.RequestData.ReadUInt64() != 0 ||
|
||||
context.RequestData.ReadUInt64() != 0 || context.RequestData.ReadUInt64() != 0)
|
||||
{
|
||||
throw new ServiceNotImplementedException(this, context, $"{GetType().FullName}: 90");
|
||||
}
|
||||
|
||||
Logger.Stub?.PrintStub(LogClass.ServiceAm);
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,11 +24,12 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava
|
||||
{
|
||||
internal partial class Program
|
||||
internal static class Program
|
||||
{
|
||||
public static double WindowScaleFactor { get; set; }
|
||||
public static double DesktopScaleFactor { get; set; } = 1.0;
|
||||
|
|
@ -40,19 +41,36 @@ namespace Ryujinx.Ava
|
|||
public static bool UseHardwareAcceleration { get; private set; }
|
||||
public static string BackendThreadingArg { get; private set; }
|
||||
|
||||
[LibraryImport("user32.dll", SetLastError = true)]
|
||||
public static partial int MessageBoxA(nint hWnd, [MarshalAs(UnmanagedType.LPStr)] string text, [MarshalAs(UnmanagedType.LPStr)] string caption, uint type);
|
||||
|
||||
private const uint MbIconwarning = 0x30;
|
||||
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
Version = ReleaseInformation.Version;
|
||||
|
||||
if (OperatingSystem.IsWindows() && !OperatingSystem.IsWindowsVersionAtLeast(10, 0, 19041))
|
||||
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
_ = MessageBoxA(nint.Zero, "You are running an outdated version of Windows.\n\nRyujinx supports Windows 10 version 20H1 and newer.\n", $"Ryujinx {Version}", MbIconwarning);
|
||||
return 0;
|
||||
if (!OperatingSystem.IsWindowsVersionAtLeast(10, 0, 19041))
|
||||
{
|
||||
_ = Win32NativeInterop.MessageBoxA(nint.Zero, "You are running an outdated version of Windows.\n\nRyujinx supports Windows 10 version 20H1 and newer.\n", $"Ryujinx {Version}", MbIconwarning);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (Environment.CurrentDirectory.StartsWithIgnoreCase("C:\\Program Files") ||
|
||||
Environment.CurrentDirectory.StartsWithIgnoreCase("C:\\Program Files (x86)"))
|
||||
{
|
||||
_ = Win32NativeInterop.MessageBoxA(nint.Zero, "Ryujinx is not intended to be run from the Program Files folder. Please move it out and relaunch.", $"Ryujinx {Version}", MbIconwarning);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// The names of everything here makes no sense for what this actually checks for. Thanks, Microsoft.
|
||||
// If you can't tell by the error string,
|
||||
// this actually checks if the current process was run with "Run as Administrator"
|
||||
// ...but this reads like it checks if the current is in/has the Windows admin role? lol
|
||||
if (new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator))
|
||||
{
|
||||
_ = Win32NativeInterop.MessageBoxA(nint.Zero, "Ryujinx is not intended to be run as administrator.", $"Ryujinx {Version}", MbIconwarning);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
PreviewerDetached = true;
|
||||
|
|
|
|||
|
|
@ -112,5 +112,8 @@ namespace Ryujinx.Ava.UI.Helpers
|
|||
|
||||
[LibraryImport("user32.dll", SetLastError = true)]
|
||||
public static partial ushort GetAsyncKeyState(int nVirtKey);
|
||||
|
||||
[LibraryImport("user32.dll", SetLastError = true)]
|
||||
public static partial int MessageBoxA(nint hWnd, [MarshalAs(UnmanagedType.LPStr)] string text, [MarshalAs(UnmanagedType.LPStr)] string caption, uint type);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue