-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
29 lines (25 loc) · 913 Bytes
/
Copy pathProgram.cs
File metadata and controls
29 lines (25 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using DevMem;
using DevMem.Native;
// The program refuses to start anywhere else (see the guard below), so declaring it at the
// assembly level is the honest description - and it is what lets the platform analyser verify the
// registry and P/Invoke calls instead of warning about every one of them. This is the reason the
// TargetFramework can stay net10.0 rather than retargeting to net10.0-windows.
[assembly: SupportedOSPlatform("windows")]
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Console.Error.WriteLine("DevMem is Windows-only (it reads Windows kernel process structures).");
return 1;
}
Win32.EnableVirtualTerminal();
try
{
return Cli.Run(args);
}
catch (Exception ex)
{
Console.Write(Ansi.ShowCursor + Ansi.Reset);
Console.Error.WriteLine($"DevMem failed: {ex.Message}");
return 1;
}