VOID = DWORD // This one is a 'cheat' to handle function returning void in ctypes
BYTE = c_ubyte
PWSTR = LPWSTR
PCWSTR = LPWSTR
SIZE_T = c_size_t
PSIZE_T = POINTER(SIZE_T)
PVOID = c_void_p
NTSTATUS = DWORD
TDHSTATUS = ULONG
DNS_STATUS = ULONG
LSTATUS = LONG # Registry functions return value | typedef _Return_type_success_(return==ERROR_SUCCESS) LONG LSTATUS;
SECURITY_INFORMATION = DWORD
PSECURITY_INFORMATION = POINTER(SECURITY_INFORMATION)
PULONG = POINTER(ULONG)
PDWORD = POINTER(DWORD)
LPDWORD = POINTER(DWORD)
LPBYTE = POINTER(BYTE)
ULONG_PTR = PVOID
LONG_PTR = PVOID
DWORD_PTR = ULONG_PTR
KAFFINITY = ULONG_PTR
KPRIORITY = LONG
INTERNET_PORT = WORD

CHAR = c_char
PCHAR = POINTER(CHAR)
UCHAR = c_char
CSHORT = c_short
VARTYPE = c_ushort
PUSHORT = POINTER(USHORT)
PBOOL = POINTER(BOOL)
LPBOOL = PBOOL
PSTR = LPSTR
PCSTR = LPSTR

va_list = c_char_p
LPCH = c_char_p
LPWCH = c_wchar
BSTR = c_wchar_p
OLECHAR = c_wchar
POLECHAR = c_wchar_p
PZZWSTR = c_wchar_p
PUCHAR = POINTER(UCHAR)
double = c_double
DATE = double
ULONGLONG = c_ulonglong
PULONGLONG = POINTER(ULONGLONG)
LONGLONG = c_longlong
ULONG64 = c_ulonglong
UINT64 = ULONG64
LONG64 = c_longlong
PLARGE_INTEGER = POINTER(LARGE_INTEGER)
DWORD64 = ULONG64
PDWORD64 = POINTER(DWORD64)
// https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/c575fb47-166c-48cd-a37c-e44cac05c3d6
DWORDLONG = ULONGLONG
SCODE = LONG
CIMTYPE = LONG
NET_IFINDEX = ULONG
IF_INDEX = NET_IFINDEX
IFTYPE = ULONG
PLONG64 = POINTER(LONG64)
PULONG64 = POINTER(ULONG64)
PBYTE = POINTER(BYTE)
PUINT = POINTER(UINT)
PHKEY = POINTER(HKEY)
ACCESS_MASK = DWORD
REGSAM = ACCESS_MASK
PBOOLEAN = POINTER(BOOLEAN)
SECURITY_CONTEXT_TRACKING_MODE = BOOLEAN
HCRYPTPROV_LEGACY = PULONG
HCRYPTKEY = PULONG
HCRYPTPROV = PULONG
HCRYPTHASH = PULONG
ALG_ID = UINT
DISPID = LONG
MEMBERID = DISPID
LRESULT = LONG_PTR
LPUNKNOWN = POINTER(PVOID)
LPPOINT = POINTER(POINT)
LPRECT = POINTER(RECT)
SPC_UUID = BYTE * 16
DEVICE_TYPE = DWORD
PWINDBG_EXTENSION_APIS32 = PVOID
PWINDBG_EXTENSION_APIS64 = PVOID
FILEOP_FLAGS = WORD


NCRYPT_HANDLE = ULONG_PTR
NCRYPT_PROV_HANDLE = ULONG_PTR
NCRYPT_KEY_HANDLE = ULONG_PTR
NCRYPT_HASH_HANDLE = ULONG_PTR
NCRYPT_SECRET_HANDLE  = ULONG_PTR
TRACEHANDLE = ULONG64
PTRACEHANDLE = POINTER(TRACEHANDLE)



/* Symbols stuff */

 /* https://docs.microsoft.com/en-us/windows/win32/api/dbghelp/nf-dbghelp-symsetcontext
 PIMAGEHLP_CONTEXT     Context -> This parameter is ignored. (NOT GIVEN..)
 typedef VOID IMAGEHLP_CONTEXT, *PIMAGEHLP_CONTEXT;
 */

PIMAGEHLP_CONTEXT = PVOID

/* INT sized*/

INT8 = c_byte // signed | our BYTE is unsigned
INT16 = SHORT
INT32 = INT
INT64 = LONGLONG

UINT8 = BYTE
UINT16 = USHORT
UINT32 = UINT
UINT64 = ULONGLONG

/* LONG sized (lol..) */
ULONG32 = UINT32
LONG32 = INT32

/* HANDLES */

PHANDLE = POINTER(HANDLE)
HCATADMIN = HANDLE
HCATINFO = HANDLE
HCERTCHAINENGINE = HANDLE
LPHANDLE = POINTER(HANDLE)
ALPC_HANDLE = HANDLE
PALPC_HANDLE = POINTER(ALPC_HANDLE)
HCURSOR = HANDLE
HBRUSH = HANDLE
HCRYPTPROV_OR_NCRYPT_KEY_HANDLE = PULONG
EVT_HANDLE = HANDLE
EVT_OBJECT_ARRAY_PROPERTY_HANDLE = HANDLE
LSA_HANDLE = HANDLE
PLSA_HANDLE = POINTER(LSA_HANDLE)
// Define type for setup disk space list
HDSKSPC = HANDLE
// Define type for reference to device information set
HDEVINFO = HANDLE
HINTERNET = PVOID

/* Network */

IP4_ADDRESS = DWORD // Make a extended struct ?

/* Security */

PSECURITY_DESCRIPTOR = PVOID

SECURITY_DESCRIPTOR_CONTROL = WORD
PSECURITY_DESCRIPTOR_CONTROL = POINTER(SECURITY_DESCRIPTOR_CONTROL)

ACCESS_MASK = DWORD
PACCESS_MASK = POINTER(ACCESS_MASK)

SECURITY_INFORMATION = DWORD
PSECURITY_INFORMATION = POINTER(SECURITY_INFORMATION)
PSECURITY_ATTRIBUTES_OPAQUE = PVOID
SID_HASH_ENTRY = ULONG_PTR
PSID_HASH_ENTRY = POINTER(SID_HASH_ENTRY)

PSID = PVOID

/* cfgmgr32 types */

// Return value
CONFIGRET = DWORD

DEVNODE = DWORD
DEVINST = DWORD
PDEVNODE = POINTER(DEVNODE)
PDEVINST = POINTER(DEVINST)


PRIORITY = ULONG
PPRIORITY = POINTER(PRIORITY)
RES_DES = DWORD_PTR
PRES_DES = POINTER(RES_DES)
HMACHINE = HANDLE
PHMACHINE = POINTER(HMACHINE)
LOG_CONF = DWORD_PTR
PLOG_CONF = POINTER(LOG_CONF)
RESOURCEID = ULONG
PRESOURCEID = POINTER(RESOURCEID)

DEVNODEID_A = PCSTR
DEVINSTID_A = PCSTR
DEVNODEID_W = LPWSTR
DEVINSTID_W = LPWSTR





/* COM STUFF */

RPCOLEDATAREP = ULONG
HREFTYPE = DWORD
SFGAOF = ULONG

/* Function PTR */

WNDPROC = PVOID
LPPROC_THREAD_ATTRIBUTE_LIST = PVOID
PPS_POST_PROCESS_INIT_ROUTINE = PVOID
LPTHREAD_START_ROUTINE = PVOID
WNDENUMPROC = PVOID
PHANDLER_ROUTINE = PVOID
FARPROC = PVOID
PIO_APC_ROUTINE = PVOID
PVECTORED_EXCEPTION_HANDLER = PVOID
PFN_CRYPT_GET_SIGNER_CERTIFICATE = PVOID
PSYM_ENUMERATESYMBOLS_CALLBACK = PVOID
PSYM_ENUMERATESYMBOLS_CALLBACKW = PVOID
PEVENT_CALLBACK = PVOID
PEVENT_TRACE_BUFFER_CALLBACKA = PVOID
PEVENT_TRACE_BUFFER_CALLBACKW = PVOID
PEVENT_RECORD_CALLBACK = PVOID
PFN_CRYPT_ENUM_OID_FUNC = PVOID
PGET_MODULE_BASE_ROUTINE64 = PVOID # StackWalk
PGET_MODULE_BASE_ROUTINE = PVOID # StackWalk
PREAD_PROCESS_MEMORY_ROUTINE = PVOID # StackWalk
PREAD_PROCESS_MEMORY_ROUTINE64 = PVOID # StackWalk
PFUNCTION_TABLE_ACCESS_ROUTINE  = PVOID # StackWalk
PFUNCTION_TABLE_ACCESS_ROUTINE64  = PVOID # StackWalk
PTRANSLATE_ADDRESS_ROUTINE  = PVOID # StackWalk
PTRANSLATE_ADDRESS_ROUTINE64  = PVOID # StackWalk
PSYMBOL_REGISTERED_CALLBACK64 = PVOID # Symbols
PSYMBOL_REGISTERED_CALLBACK = PVOID # Symbols
PSYM_ENUMPROCESSES_CALLBACK = PVOID # Symbols
ENUMRESNAMEPROCA = PVOID # Resources
ENUMRESNAMEPROCW = PVOID # Resources
ENUMRESTYPEPROCA = PVOID # Resources
ENUMRESTYPEPROCW = PVOID # Resources
LPSERVICE_MAIN_FUNCTIONA = PVOID
LPSERVICE_MAIN_FUNCTIONW = PVOID
LPOVERLAPPED_COMPLETION_ROUTINE = PVOID
PDNS_QUERY_COMPLETION_ROUTINE = PVOID


// Will be changed at import time

LPCONTEXT = PVOID
HCERTSTORE = PVOID
HCRYPTMSG = PVOID
PALPC_PORT_ATTRIBUTES = PVOID
PPORT_MESSAGE = PVOID