win32-def
Version:
win32 definitions for node-ffi
254 lines (251 loc) • 10.9 kB
text/typescript
/**
* @link https://koffi.dev/input
* @link https://tootallnate.github.io/ref/
*/
declare enum Def {
bool = "bool",
byte = "uint8_t",
int = "int",
int8 = "int8_t",
int16 = "int16_t",
int32 = "int32_t",
int64 = "int64_t",
float = "float",
long = "long",
longlong = "longlong",
uchar = "uchar",
uint = "uint",
uint8 = "uint8_t",
uint16 = "uint16_t",
uint32 = "uint32_t",
uint64 = "uint64_t",
ulong = "ulong",
ulonglong = "ulonglong",
ushort = "ushort",
void = "void",
boolPtr = "bool*",
bytePtr = "uint8_t*",
charPtr = "char*",
intPtr = "int*",
int8Ptr = "int8_t*",
int16Ptr = "int16_t*",
int32Ptr = "int32_t*",
int64Ptr = "int64_t*",
floatPtr = "float*",
longPtr = "long*",
uintPtr = "uint*",
uint8Ptr = "uint8_t*",
intPtrPtr = "int**",
uint16Ptr = "uint16_t*",
uint32Ptr = "uint32_t*",
uint64Ptr = "uint64_t*",
ulonglongPtr = "ulonglong*",
voidPtr = "void*",
uintPtrPtr = "uint**",
uint16PtrPtr = "uint16_t**",
uint32PtrPtr = "uint32_t**",
uint64PtrPtr = "uint64_t**",
ulonglongPtrPtr = "ulonglong**",
voidPtrPtr = "void**"
}
/**
* @link https://docs.microsoft.com/en-us/windows/win32/secauthz/access-mask-format
*/
declare const ACCESS_MASK: Def.int32;
declare const ATOM: Def.uint16;
declare const DWORD: Def.uint32;
declare const ptr: Def.uint32Ptr | Def.uint64Ptr;
declare const PVOID: Def.voidPtr;
/**
* `uint32` or `uint64` used as value usage (memory address) instead of PVOID (Buffer),
* Use `HANDLE` (number) for params definition of the api,
* @see https://stackoverflow.com/questions/18266626/what-is-the-range-of-a-windows-handle-on-a-64-bits-application/29526711#29526711
*/
declare const HANDLE: Def.uint32 | Def.uint64;
/**
* `HANDLE_PVOID` (Buffer) can be used for definition of Struct,
*/
declare const HANDLE_PVOID: Def.voidPtr;
declare const LONG_PTR: Def.int32 | Def.int64;
declare const ULONG_PTR: Def.int32 | Def.int64;
declare const VOID: Def.void;
declare const WCHAR: Def.uint16;
declare const WORD: Def.int16;
declare const BOOL: Def.int32;
declare const BOOLEAN: Def.bool;
declare const BYTE: Def.byte;
declare const CALLBACK: Def.uint32Ptr | Def.uint64Ptr;
declare const CCHAR: Def.uint8;
declare const CHAR: Def.uint8;
declare const COLORREF: Def.uint32;
declare const DWORDLONG: Def.uint64;
declare const DWORD_PTR: Def.int32 | Def.int64;
declare const DWORD32: Def.uint32;
declare const DWORD64: Def.uint64;
declare const FLOAT: Def.float;
declare const HACCEL: Def.uint32 | Def.uint64;
declare const HALF_PTR: Def.int16 | Def.int32;
declare const HBITMAP: Def.uint32 | Def.uint64;
declare const HBRUSH: Def.uint32 | Def.uint64;
declare const HCOLORSPACE: Def.uint32 | Def.uint64;
declare const HCONV: Def.uint32 | Def.uint64;
declare const HCONVLIST: Def.uint32 | Def.uint64;
declare const HCURSOR: Def.uint32 | Def.uint64;
declare const HDC: Def.uint32 | Def.uint64;
declare const HDDEDATA: Def.uint32 | Def.uint64;
declare const HDESK: Def.uint32 | Def.uint64;
declare const HDROP: Def.uint32 | Def.uint64;
declare const HDWP: Def.uint32 | Def.uint64;
declare const HENHMETAFILE: Def.uint32 | Def.uint64;
declare const HFILE: Def.uint32 | Def.uint64;
declare const HFONT: Def.uint32 | Def.uint64;
declare const HGDIOBJ: Def.uint32 | Def.uint64;
declare const HGLOBAL: Def.uint32 | Def.uint64;
declare const HHOOK: Def.uint32 | Def.uint64;
declare const HICON: Def.uint32 | Def.uint64;
declare const HINSTANCE: Def.uint32 | Def.uint64;
declare const HKEY: Def.uint32 | Def.uint64;
declare const HKL: Def.uint32 | Def.uint64;
declare const HLOCAL: Def.uint32 | Def.uint64;
declare const HMENU: Def.uint32 | Def.uint64;
declare const HMETAFILE: Def.uint32 | Def.uint64;
declare const HMODULE: Def.uint32 | Def.uint64;
declare const HMONITOR: Def.uint32 | Def.uint64;
declare const HPALETTE: Def.uint32 | Def.uint64;
declare const HPEN: Def.uint32 | Def.uint64;
declare const HRESULT: Def.long;
declare const HRGN: Def.uint32 | Def.uint64;
declare const HRSRC: Def.uint32 | Def.uint64;
declare const HSZ: Def.uint32 | Def.uint64;
declare const HWINEVENTHOOK: Def.uint32 | Def.uint64;
declare const HWINSTA: Def.uint32 | Def.uint64;
declare const HWND: Def.uint32 | Def.uint64;
/** A 32-bit signed integer */
declare const INT: Def.int;
declare const INT_PTR: Def.int32Ptr | Def.int64Ptr;
declare const INT8: Def.int8;
declare const INT16: Def.int16;
declare const INT32: Def.int32;
declare const INT64: Def.int64;
declare const LANGID: Def.int16;
declare const LCID: Def.uint32;
declare const LCTYPE: Def.uint32;
declare const LGRPID: Def.uint32;
declare const LONG: Def.long;
declare const LONGLONG: Def.longlong;
declare const LONG32: Def.int32;
declare const LONG64: Def.int64;
declare const LPARAM: Def.int32 | Def.int64;
declare const LPBOOL: Def.int32;
declare const LPBYTE: Def.bytePtr;
declare const LPCOLORREF: Def.uint32;
declare const LPCSTR: Def.int8Ptr;
declare const LPCWSTR: Def.int16Ptr;
declare const LPCTSTR: Def.int16Ptr;
declare const LPVOID: Def.voidPtr;
declare const LPCVOID: Def.voidPtr;
declare const LPDWORD: Def.uint16Ptr;
declare const LPHANDLE: Def.int32Ptr | Def.int64Ptr;
declare const LPINT: Def.uint32Ptr | Def.uint64Ptr;
declare const LPLONG: Def.int32Ptr;
declare const LPSTR: Def.charPtr;
declare const LPWSTR: Def.uint16Ptr;
declare const LPTSTR: Def.uint16Ptr;
declare const LPWORD: Def.uint16Ptr;
declare const LRESULT: Def.int32 | Def.int64;
declare const NTSTATUS: Def.uint32;
declare const PBOOL: Def.uint32Ptr | Def.uint64Ptr;
declare const PBOOLEAN: Def.boolPtr;
declare const PBYTE: Def.bytePtr;
declare const PCHAR: Def.charPtr;
declare const PCSTR: Def.uint8Ptr;
declare const PCTSTR: Def.int8Ptr | Def.int16Ptr;
declare const PCWSTR: Def.uint16Ptr;
declare const PDWORD: Def.uint32Ptr;
declare const PDWORDLONG: Def.uint64Ptr;
declare const PDWORD_PTR: Def.int32 | Def.int64;
declare const PDWORD32: Def.uint32Ptr;
declare const PDWORD64: Def.uint64Ptr;
declare const PFLOAT: Def.floatPtr;
declare const PHALF_PTR: Def.uint32Ptr | Def.uint64Ptr;
declare const PHANDLE: Def.uint32PtrPtr | Def.uint64PtrPtr;
declare const PHKEY: Def.uint32PtrPtr | Def.uint64PtrPtr;
declare const PINT: Def.uint32Ptr | Def.uint64Ptr;
declare const PINT_PTR: Def.intPtrPtr;
declare const PINT8: Def.int8Ptr;
declare const PINT16: Def.int16Ptr;
declare const PINT32: Def.int32Ptr;
declare const PINT64: Def.int64Ptr;
declare const PLCID: Def.uint32Ptr;
declare const PLONG: Def.longPtr;
declare const PLONGLONG: Def.int64Ptr;
declare const PLONG_PTR: Def.uint32Ptr | Def.uint64Ptr;
declare const PLONG32: Def.int32Ptr;
declare const PLONG64: Def.int64Ptr;
declare const POINTER_32: Def.int32Ptr;
declare const POINTER_64: Def.int32Ptr | Def.int64Ptr;
declare const POINTER_SIGNED: Def.uint32Ptr | Def.uint64Ptr;
declare const POINTER_UNSIGNED: Def.uint32Ptr | Def.uint64Ptr;
declare const PSHORT: Def.int16Ptr;
declare const PSIZE_T: Def.int32 | Def.int64;
declare const PSSIZE_T: Def.uint32Ptr | Def.uint64Ptr;
declare const PSTR: Def.charPtr;
declare const PTBYTE: Def.int16Ptr;
declare const PTCHAR: Def.uint16Ptr;
declare const PTSTR: Def.uint16Ptr;
declare const PUCHAR: Def.uint32Ptr | Def.uint64Ptr;
declare const PUHALF_PTR: Def.uint32Ptr | Def.uint64Ptr;
declare const PUINT: Def.uintPtr;
declare const PUINT_PTR: Def.uintPtrPtr;
declare const PUINT8: Def.uint8Ptr;
declare const PUINT16: Def.uint16Ptr;
declare const PUINT32: Def.uint32Ptr;
declare const PUINT64: Def.uint64Ptr;
declare const PULONG: Def.uintPtr;
declare const PULONGLONG: Def.uint64Ptr;
declare const PULONG_PTR: Def.uint64PtrPtr;
declare const PULONG32: Def.uintPtr;
declare const PULONG64: Def.uint64Ptr;
declare const PUSHORT: Def.uint16Ptr;
declare const PWCHAR: Def.uint16Ptr;
declare const PWORD: Def.uint16Ptr;
declare const PWSTR: Def.uint16Ptr;
declare const QWORD: Def.uint64;
declare const SC_HANDLE: Def.uint32 | Def.uint64;
declare const SC_LOCK: Def.voidPtr;
declare const SERVICE_STATUS_HANDLE: Def.uint32 | Def.uint64;
declare const SHORT: Def.int16;
declare const SIZE_T: Def.int32 | Def.int64;
declare const SSIZE_T: Def.int32 | Def.int64;
declare const TBYTE: Def.int16;
declare const TCHAR: Def.uint16;
declare const UCHAR: Def.uchar;
declare const UHALF_PTR: Def.uint16 | Def.uint32;
declare const UINT: Def.uint;
declare const UINT_PTR: Def.uint32 | Def.uint64;
declare const UINT8: Def.uint8;
declare const UINT16: Def.uint16;
declare const UINT32: Def.uint32;
declare const UINT64: Def.uint64;
declare const ULONG: Def.uint;
declare const ULONGLONG: Def.uint64;
declare const ULONG32: Def.uint32;
declare const ULONG64: Def.uint64;
declare const USHORT: Def.ushort;
declare const USN: Def.longlong;
declare const WINEVENTPROC: Def.uint32Ptr | Def.uint64Ptr;
declare const WNDENUMPROC: Def.uint32Ptr | Def.uint64Ptr;
declare const WNDPROC: Def.voidPtr;
declare const DLGPROC: Def.voidPtr;
/**
* Note: original be typedef UINT_PTR WPARAM;
* CALLBACK WNDCLASSEX.lpfnWndProc may pass negative number and cause process exit.
*/
declare const WPARAM: Def.uint32 | Def.uint64;
declare const va_list = "str16";
/**
* For 'str16' from https://koffi.dev/input
*/
declare const WString = "str16";
declare const String = "str";
export { ACCESS_MASK, ATOM, BOOL, BOOLEAN, BYTE, CALLBACK, CCHAR, CHAR, COLORREF, DLGPROC, DWORD, DWORD32, DWORD64, DWORDLONG, DWORD_PTR, Def, FLOAT, HACCEL, HALF_PTR, HANDLE, HANDLE_PVOID, HBITMAP, HBRUSH, HCOLORSPACE, HCONV, HCONVLIST, HCURSOR, HDC, HDDEDATA, HDESK, HDROP, HDWP, HENHMETAFILE, HFILE, HFONT, HGDIOBJ, HGLOBAL, HHOOK, HICON, HINSTANCE, HKEY, HKL, HLOCAL, HMENU, HMETAFILE, HMODULE, HMONITOR, HPALETTE, HPEN, HRESULT, HRGN, HRSRC, HSZ, HWINEVENTHOOK, HWINSTA, HWND, INT, INT16, INT32, INT64, INT8, INT_PTR, LANGID, LCID, LCTYPE, LGRPID, LONG, LONG32, LONG64, LONGLONG, LONG_PTR, LPARAM, LPBOOL, LPBYTE, LPCOLORREF, LPCSTR, LPCTSTR, LPCVOID, LPCWSTR, LPDWORD, LPHANDLE, LPINT, LPLONG, LPSTR, LPTSTR, LPVOID, LPWORD, LPWSTR, LRESULT, NTSTATUS, PBOOL, PBOOLEAN, PBYTE, PCHAR, PCSTR, PCTSTR, PCWSTR, PDWORD, PDWORD32, PDWORD64, PDWORDLONG, PDWORD_PTR, PFLOAT, PHALF_PTR, PHANDLE, PHKEY, PINT, PINT16, PINT32, PINT64, PINT8, PINT_PTR, PLCID, PLONG, PLONG32, PLONG64, PLONGLONG, PLONG_PTR, POINTER_32, POINTER_64, POINTER_SIGNED, POINTER_UNSIGNED, PSHORT, PSIZE_T, PSSIZE_T, PSTR, PTBYTE, PTCHAR, PTSTR, PUCHAR, PUHALF_PTR, PUINT, PUINT16, PUINT32, PUINT64, PUINT8, PUINT_PTR, PULONG, PULONG32, PULONG64, PULONGLONG, PULONG_PTR, PUSHORT, PVOID, PWCHAR, PWORD, PWSTR, QWORD, SC_HANDLE, SC_LOCK, SERVICE_STATUS_HANDLE, SHORT, SIZE_T, SSIZE_T, String, TBYTE, TCHAR, UCHAR, UHALF_PTR, UINT, UINT16, UINT32, UINT64, UINT8, UINT_PTR, ULONG, ULONG32, ULONG64, ULONGLONG, ULONG_PTR, USHORT, USN, VOID, WCHAR, WINEVENTPROC, WNDENUMPROC, WNDPROC, WORD, WPARAM, WString, ptr, va_list };