From 15287bf4949fd639118ec3bdb58af23aa697b187 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 4 Feb 2023 20:34:42 +0100 Subject: [PATCH] feat: add UnmanagedCallersOnly to OpenConsole and CloseConsole --- src/Local/NosSmooth.Comms.Inject/DllMain.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Local/NosSmooth.Comms.Inject/DllMain.cs b/src/Local/NosSmooth.Comms.Inject/DllMain.cs index 88e6fa3..a6a667a 100644 --- a/src/Local/NosSmooth.Comms.Inject/DllMain.cs +++ b/src/Local/NosSmooth.Comms.Inject/DllMain.cs @@ -26,8 +26,6 @@ namespace NosSmooth.Comms.Inject; /// public class DllMain { - private const uint StdOutputHandle = 0xFFFFFFF5; - private static bool _consoleAllocated; private static IHost? _host; @@ -51,6 +49,7 @@ public class DllMain /// /// Open a console. /// + [UnmanagedCallersOnly(EntryPoint = "OpenConsole")] public static void OpenConsole() { WinConsole.Initialize(false); @@ -59,6 +58,7 @@ public class DllMain /// /// Close a console. /// + [UnmanagedCallersOnly(EntryPoint = "CloseConsole")] public static void CloseConsole() { WinConsole.Close(); -- 2.48.1