util/proc: Create util module for handling process related stuff

This commit is contained in:
icex2
2020-12-20 16:37:40 +01:00
parent e49b1e05c1
commit 34c501ccee
3 changed files with 21 additions and 0 deletions
+1
View File
@@ -15,6 +15,7 @@ src_util := \
msg-thread.c \
net.c \
os.c \
proc.c \
signal.c \
str.c \
thread.c \
+15
View File
@@ -0,0 +1,15 @@
#include <windows.h>
#include <stdint.h>
void proc_terminate_current_process(uint32_t exit_code)
{
HANDLE hnd;
hnd = OpenProcess(
SYNCHRONIZE | PROCESS_TERMINATE,
TRUE,
GetCurrentProcessId());
TerminateProcess(hnd, 0);
}
+5
View File
@@ -0,0 +1,5 @@
#pragma once
#include <stdint.h>
void proc_terminate_current_process(uint32_t exit_code);