1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2025-01-19 15:18:38 +01:00

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 049f1b4564
commit e4126500ef
3 changed files with 21 additions and 0 deletions

View File

@ -15,6 +15,7 @@ src_util := \
msg-thread.c \
net.c \
os.c \
proc.c \
signal.c \
str.c \
thread.c \

15
src/main/util/proc.c Normal file
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
src/main/util/proc.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <stdint.h>
void proc_terminate_current_process(uint32_t exit_code);