Win forms app that imports the windows kernel32.dll for GUI process thread management.
Note
App is setup to run with admin privileges. Use with caution.
Dll imports:
[DllImport("kernel32.dll")]
static extern IntPtr OpenThread(ThreadAccess dwDesiredAccess, bool bInheritHandle, uint dwThreadId);
[DllImport("kernel32.dll")]
static extern uint SuspendThread(IntPtr hThread);
[DllImport("kernel32.dll")]
static extern int ResumeThread(IntPtr hThread);
[DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)]
static extern bool CloseHandle(IntPtr handle);
- Suspend: kernel32.dll handle for opening and suspening selected threads
- Resume: kernel32.dll handle for opening and resuming selected threads
Separate counter thread which can be used for suspend/ resume testing.
Counts to 100.
Standalone rollback service which triggers a resume operation on suspended threads.
Triggers every 10 seconds.
Getting app process, stopping and resuming mock thread execution.
//TODO
Blocking system threads, waiting for rollback thread to resume.
//TODO
Closing main window, waiting for thread cleanup.
//TODO
IDEs: Visual Studio 2022
Frameworks: ASP.NET Core
Other: