-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Nefarius.DsHidMini.Setup.Util; | ||
|
||
public static class ArchitectureInfo | ||
{ | ||
public static bool IsArm64 | ||
{ | ||
get | ||
{ | ||
IntPtr handle = Process.GetCurrentProcess().Handle; | ||
IsWow64Process2(handle, out ushort processMachine, out ushort nativeMachine); | ||
|
||
return nativeMachine == 0xaa64; | ||
} | ||
} | ||
|
||
[DllImport("kernel32.dll", SetLastError = true)] | ||
private static extern bool IsWow64Process2( | ||
IntPtr process, | ||
out ushort processMachine, | ||
out ushort nativeMachine | ||
); | ||
} |