#![allow(non_snake_case, non_camel_case_types)]
use core::ffi::c_void;
use crate::os::windows::types::{BOOL, DWORD, HANDLE, LPCWSTR, LPDWORD, LPVOID, LPWSTR};
use super::structs::{ProcessInformation, StartupInfoW};
pub type CreateThread_t = unsafe extern "system" fn(
lpThreadSecurityAttributes: *mut c_void,
dwStackSize: usize,
lpStartAddress: unsafe extern "system" fn(*mut c_void) -> u32,
lpParameter: *mut c_void,
dwCreationflags: u32,
lpThreadId: *mut u32,
) -> HANDLE;
pub type ExitThread_t = unsafe extern "system" fn(code: u32) -> !;
pub type ExitProcess_t = unsafe extern "system" fn(code: u32) -> !;
pub type TlsAlloc_t = unsafe extern "system" fn() -> DWORD;
pub type TlsSetValue_t = unsafe extern "system" fn(dwTlsIndex: DWORD, lpTlsValue: LPVOID) -> BOOL;
pub type TlsGetValue_t = unsafe extern "system" fn(dwTlsIndex: DWORD) -> LPVOID;
pub type GetLastError_t = unsafe extern "system" fn() -> DWORD;
pub type OpenProcess_t = unsafe extern "system" fn(
dwDesiredAccess: u32,
bInheritHandle: i32,
dwProcessId: u32,
) -> HANDLE;
pub type InitializeProcThreadAttributeList_t = unsafe extern "system" fn(
lpAttributeList: *mut u8,
dwAttributeCount: u32,
dwFlags: u32,
lpSize: *mut usize,
) -> i32;
pub type UpdateProcThreadAttribute_t = unsafe extern "system" fn(
lpAttributeList: *mut u8,
dwFlags: u32,
Attribute: usize,
lpValue: HANDLE,
cbSize: usize,
lpPreviousValue: HANDLE,
lpReturnSize: *mut usize,
) -> i32;
pub type ResumeThread_t = unsafe extern "system" fn(hThread: HANDLE) -> u32;
pub type CloseHandle_t = unsafe extern "system" fn(hHandle: HANDLE) -> i32;
pub type WaitForSingleObject_t = unsafe extern "system" fn(hHandle: HANDLE, dwMilliseconds: u32) -> u32;
pub type GetExitCodeProcess_t = unsafe extern "system" fn(hHandle: HANDLE, lpExitCode: *mut u32) -> i32;
pub type GetStdHandle_t = unsafe extern "system" fn(nStdHandle: DWORD) -> HANDLE;
pub type WriteConsoleA_t = unsafe extern "system" fn(
hConsoleOutput: HANDLE,
lpBuffer: *const c_void,
nNumberOfCharsToWrite: DWORD,
lpNumberOfCharsWritten: LPDWORD,
lpReserved: LPVOID,
) -> BOOL;
pub type AllocConsole_t = unsafe extern "system" fn() -> BOOL;
#[allow(unused)]
pub type GetCommandLineW_t = unsafe extern "system" fn() -> LPWSTR;
#[allow(unused)]
pub type CommandLineToArgvW_t = unsafe extern "system" fn(lpCmdLine: LPCWSTR, pNumArgs: *mut i32) -> LPWSTR;
pub type CreateProcess_t = unsafe extern "system" fn(
lpApplicationName: *const u16,
lpCommandLine: *mut u16,
lpProcessAttributes: HANDLE,
lpThreadAttributes: HANDLE,
bInheritHandles: i32,
dwCreationFlags: u32,
lpEnvironment: HANDLE,
lpCurrentDirectory: *mut u16,
lpStartupInfo: *mut StartupInfoW,
lpProcessInformation: *mut ProcessInformation,
) -> i32;