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:
parent
049f1b4564
commit
e4126500ef
@ -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
15
src/main/util/proc.c
Normal 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
5
src/main/util/proc.h
Normal file
@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void proc_terminate_current_process(uint32_t exit_code);
|
Loading…
x
Reference in New Issue
Block a user