From b4c40c38854db81ec104ce8d54f6ea0440a71bf6 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 18 Feb 2023 16:54:01 +0100 Subject: [PATCH] feat(samples): update samples to receive nuint and return int in main method --- src/Samples/HighLevel/SimplePiiBot/DllMain.cs | 3 ++- src/Samples/LowLevel/InterceptNameChanger/DllMain.cs | 3 ++- src/Samples/LowLevel/SimpleChat/DllMain.cs | 3 ++- src/Samples/LowLevel/WalkCommands/DllMain.cs | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Samples/HighLevel/SimplePiiBot/DllMain.cs b/src/Samples/HighLevel/SimplePiiBot/DllMain.cs index 21a2cbc..f6eaa5b 100644 --- a/src/Samples/HighLevel/SimplePiiBot/DllMain.cs +++ b/src/Samples/HighLevel/SimplePiiBot/DllMain.cs @@ -38,7 +38,7 @@ public class DllMain /// Represents the dll entrypoint method. /// [UnmanagedCallersOnly(EntryPoint = "Main")] - public static void Main() + public static int Main(nuint data) { AllocConsole(); new Thread @@ -55,6 +55,7 @@ public class DllMain } } ).Start(); + return 0; } /// diff --git a/src/Samples/LowLevel/InterceptNameChanger/DllMain.cs b/src/Samples/LowLevel/InterceptNameChanger/DllMain.cs index 48a5c08..d49017b 100644 --- a/src/Samples/LowLevel/InterceptNameChanger/DllMain.cs +++ b/src/Samples/LowLevel/InterceptNameChanger/DllMain.cs @@ -24,7 +24,7 @@ namespace InterceptNameChanger /// The main entrypoint method of the dll. /// [UnmanagedCallersOnly(EntryPoint = "Main")] - public static void Main() + public static int Main(nuint data) { AllocConsole(); Console.WriteLine("Hello from InterceptNameChanger DllMain entry point."); @@ -40,6 +40,7 @@ namespace InterceptNameChanger Console.WriteLine(e.ToString()); } }).Start(); + return 0; } } } \ No newline at end of file diff --git a/src/Samples/LowLevel/SimpleChat/DllMain.cs b/src/Samples/LowLevel/SimpleChat/DllMain.cs index b263595..44c1a72 100644 --- a/src/Samples/LowLevel/SimpleChat/DllMain.cs +++ b/src/Samples/LowLevel/SimpleChat/DllMain.cs @@ -22,11 +22,12 @@ public class DllMain /// The main entrypoint method of the dll. /// [UnmanagedCallersOnly(EntryPoint = "Main")] - public static void Main() + public static int Main(nuint data) { AllocConsole(); Console.WriteLine("Hello from SimpleChat DllMain entry point."); new Thread(() => new SimpleChat().RunAsync().GetAwaiter().GetResult()).Start(); + return 0; } } \ No newline at end of file diff --git a/src/Samples/LowLevel/WalkCommands/DllMain.cs b/src/Samples/LowLevel/WalkCommands/DllMain.cs index 8ffc665..e287479 100644 --- a/src/Samples/LowLevel/WalkCommands/DllMain.cs +++ b/src/Samples/LowLevel/WalkCommands/DllMain.cs @@ -24,7 +24,7 @@ public class DllMain /// Represents the dll entrypoint method. /// [UnmanagedCallersOnly(EntryPoint = "Main")] - public static void Main() + public static int Main(nuint data) { AllocConsole(); new Thread(() => @@ -38,5 +38,6 @@ public class DllMain Console.WriteLine(e.ToString()); } }).Start(); + return 0; } } \ No newline at end of file -- 2.48.1