Comparing version 2.0.2 to 2.1.0
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 2.0.2 | ||
* @version 2.1.0 | ||
* @author waiting | ||
@@ -25,2 +25,3 @@ * @license MIT | ||
const settingsDefault = { | ||
singleton: true, | ||
_UNICODE, | ||
@@ -27,0 +28,0 @@ _WIN64, |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 2.0.2 | ||
* @version 2.1.0 | ||
* @author waiting | ||
@@ -21,2 +21,3 @@ * @license MIT | ||
const settingsDefault = { | ||
singleton: true, | ||
_UNICODE, | ||
@@ -23,0 +24,0 @@ _WIN64, |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 2.0.2 | ||
* @version 2.1.0 | ||
* @author waiting | ||
@@ -12,3 +12,3 @@ * @license MIT | ||
const _WIN64_HOLDER="_WIN64_HOLDER_",_UNICODE_HOLDER="_UNICODE_HOLDER_",windefSkipKeys=new Set(["macroMap"]),_WIN64="x64"===process.arch,_UNICODE=!0,settingsDefault={_UNICODE:!0,_WIN64:_WIN64},windefSet=new Set(["bool","bool*","byte","byte*","char","uchar","char*","float","float*","int","int8","int16","int32","int64","int*","int8*","int16*","int32*","int64*","uint","uint8","uint16","uint32","uint64","uint*","uint8*","uint16*","uint32*","uint64*","int**","uint**","uint32**","uint64**","long","longlong","long*","longlong*","pointer","ushort","void","void*"]);var config=Object.freeze({_WIN64_HOLDER:_WIN64_HOLDER,_UNICODE_HOLDER:_UNICODE_HOLDER,windefSkipKeys:windefSkipKeys,_WIN64:_WIN64,_UNICODE:!0,settingsDefault:settingsDefault,windefSet:windefSet}),ffi_model=Object.freeze({});function parse_windef(O,N,L){const T=clone_filter_windef(O),R=prepare_macro(N,L);return prepare_windef_ref(T,R)}function parse_param_placeholder(O,N){if("string"==typeof O)return O;if(!O)throw new Error("parse_param_placeholder(ps, settings) value of ps invalid");if(!Array.isArray(O)||3!==O.length)throw new Error("parse_param_placeholder(ps, settings) value of ps must Array and has THREE elements");const L=parse_settings(N);let T="";switch(O[0]){case _WIN64_HOLDER:T=parse_placeholder_arch(O,L._WIN64);break;case _UNICODE_HOLDER:T=parse_placeholder_unicode(O,L._UNICODE);break;default:throw new Error("the value of param placeholder invlaid:"+O[0])}return T}function parse_placeholder_arch(O,N){if("string"==typeof O)return O;if(!O||3!==O.length)throw new Error("_WIN64 macro should be Array and has 3 items");return N?O[1]:O[2]}function parse_placeholder_unicode(O,N){if("string"==typeof O)return O;if(!O||3!==O.length)throw new Error("_UNICODE macro should be Array and has 3 items");return N?O[1]:O[2]}function prepare_macro(O,N){const L=new Map;for(const[T,R]of O.entries())L.set(T,parse_param_placeholder(R,N));return L}function prepare_windef_ref(O,N){const L=new Map;for(const T of Object.keys(O))if(!L.has(T)&&N.has(T)){const O=N.get(T);if(!O)throw new Error(`value of "${O}" blank`);validDataDef(O,windefSet),L.set(T,O)}for(const N of Object.keys(O)){if(L.has(N))continue;const T=retrieve_ref_value(O,N,L);T&&windefSet.has(T)&&L.set(N,T)}const T={};return L.forEach((O,N)=>{T[N]=O}),T}function clone_filter_windef(O){const N={};for(const L of Object.keys(O)){if("string"!=typeof O[L])throw new Error(`typeof value of ${L} NOT string`);Object.defineProperty(N,L,{value:O[L],writable:!0,enumerable:!0,configurable:!0})}return N}function parse_settings(O){const N=Object.assign({},settingsDefault);return"undefined"!=typeof O&&O&&Object.keys(O).length&&Object.assign(N,O),N}function retrieve_ref_value(O,N,L){const T=L.get(N);if(T)return T;if("undefined"==typeof O[N])return"";const R=O[N];if(!R)return"";const P=retrieve_ref_value(O,R,L);return P||R}function validDataDef(O,N){if(!O||"string"!=typeof O)throw new Error(`value of param invalid: ${O}`);if(!N.has(O))throw new Error(`conifig.windefSet not contains element of ${O}`)}const ATOM="uint16",DWORD="uint32",PVOID=_WIN64_HOLDER,HANDLE="PVOID",LONG_PTR=_WIN64_HOLDER,ULONG_PTR=_WIN64_HOLDER,VOID="void",WCHAR="uint16",WORD="int16",BOOL="int",BOOLEAN="bool",BYTE="byte",CALLBACK="pointer",CCHAR="char",CHAR="char",COLORREF="DWORD",DWORDLONG="uint64",DWORD_PTR="ULONG_PTR",DWORD32="uint32",DWORD64="uint64",FLOAT="float",HACCEL="HANDLE",HALF_PTR=_WIN64_HOLDER,HBITMAP="HANDLE",HBRUSH="HANDLE",HCOLORSPACE="HANDLE",HCONV="HANDLE",HCONVLIST="HANDLE",HCURSOR="HANDLE",HDC="HANDLE",HDDEDATA="HANDLE",HDESK="HANDLE",HDROP="HANDLE",HDWP="HANDLE",HENHMETAFILE="HANDLE",HFILE="HANDLE",HFONT="HANDLE",HGDIOBJ="HANDLE",HGLOBAL="HANDLE",HHOOK="HANDLE",HICON="HANDLE",HINSTANCE="HANDLE",HKEY="HANDLE",HKL="HANDLE",HLOCAL="HANDLE",HMENU="HANDLE",HMETAFILE="HANDLE",HMODULE="HANDLE",HMONITOR="HANDLE",HPALETTE="HANDLE",HPEN="HANDLE",HRESULT="long",HRGN="HANDLE",HRSRC="HANDLE",HSZ="HANDLE",HWINEVENTHOOK="HANDLE",HWINSTA="HANDLE",HWND="HANDLE",INT="int",INT_PTR=_WIN64_HOLDER,INT8="int8",INT16="int16",INT32="int32",INT64="int64",LANGID="WORD",LCID="DWORD",LCTYPE="DWORD",LGRPID="DWORD",LONG="long",LONGLONG="longlong",LONG32="int32",LONG64="int64",LPARAM="LONG_PTR",LPBOOL="BOOL",LPBYTE="byte*",LPCOLORREF="DWORD",LPCSTR="uint8*",LPCWSTR="uint16*",LPCTSTR=_UNICODE_HOLDER,LPVOID="void*",LPCVOID="LPVOID",LPDWORD="uint16*",LPHANDLE=_WIN64_HOLDER,LPINT="int*",LPLONG="int32*",LPMSG="pointer",LPSTR="char*",LPWSTR="uint16*",LPTSTR=_UNICODE_HOLDER,LPWORD="uint16*",LRESULT="LONG_PTR",NTSTATUS="uint32",PBOOL="int*",PBOOLEAN="bool*",PBYTE="byte*",PCHAR="char*",PCSTR="uint8*",PCTSTR=_WIN64_HOLDER,PCWSTR="uint16*",PDWORD="uint32*",PDWORDLONG="uint64*",PDWORD_PTR="DWORD_PTR",PDWORD32="uint32*",PDWORD64="uint64*",PFLOAT="float*",PHALF_PTR="pointer",PHANDLE=_WIN64_HOLDER,PHKEY=_WIN64_HOLDER,PINT="int*",PINT_PTR="int**",PINT8="int8*",PINT16="int16*",PINT32="int32*",PINT64="int64*",PLCID="uint32*",PLONG="long*",PLONGLONG="int64*",PLONG_PTR="LONG_PTR",PLONG32="int32*",PLONG64="int64*",POINTER_32=_WIN64_HOLDER,POINTER_64=_WIN64_HOLDER,POINTER_SIGNED="pointer",POINTER_UNSIGNED="pointer",PSHORT="int16*",PSIZE_T="ULONG_PTR",PSSIZE_T="pointer",PSTR="char*",PTBYTE=_UNICODE_HOLDER,PTCHAR=_UNICODE_HOLDER,PTSTR=_UNICODE_HOLDER,PUCHAR="pointer",PUHALF_PTR="pointer",PUINT="uint*",PUINT_PTR="uint**",PUINT8="uint8*",PUINT16="uint16*",PUINT32="uint32*",PUINT64="uint64*",PULONG="uint*",PULONGLONG="uint64*",PULONG_PTR="uint64**",PULONG32="uint*",PULONG64="uint64*",PUSHORT="uint16*",PWCHAR="uint16*",PWORD="uint16*",PWSTR="uint16*",QWORD="uint64",SC_HANDLE="HANDLE",SC_LOCK="LPVOID",SERVICE_STATUS_HANDLE="HANDLE",SHORT="int16",SIZE_T="ULONG_PTR",SSIZE_T="LONG_PTR",TBYTE=_UNICODE_HOLDER,TCHAR=_UNICODE_HOLDER,UCHAR="uchar",UHALF_PTR=_WIN64_HOLDER,UINT="uint",UINT_PTR="uint",UINT8="uint8",UINT16="uint16",UINT32="uint32",UINT64="uint64",ULONG="uint",ULONGLONG="uint64",ULONG32="uint32",ULONG64="uint64",USHORT="ushort",UNICODE_STRING="pointer",USN="LONGLONG",WINEVENTPROC="pointer",WNDENUMPROC="pointer",WNDPROC="pointer",WPARAM="LONG_PTR",LPINITCOMMONCONTROLSEX="pointer",LPWNDCLASSEX="pointer",PWINDOWINFO="pointer",va_list="char*",INITCOMMONCONTROLSEX="pointer",MSG="pointer",POINT="pointer",WNDCLASSEX="pointer",WINDOWINFO="pointer",RECT="pointer";var windef=Object.freeze({ATOM:ATOM,DWORD:DWORD,PVOID:PVOID,HANDLE:HANDLE,LONG_PTR:LONG_PTR,ULONG_PTR:ULONG_PTR,VOID:VOID,WCHAR:WCHAR,WORD:WORD,BOOL:BOOL,BOOLEAN:"bool",BYTE:BYTE,CALLBACK:CALLBACK,CCHAR:CCHAR,CHAR:CHAR,COLORREF:"DWORD",DWORDLONG:"uint64",DWORD_PTR:DWORD_PTR,DWORD32:DWORD32,DWORD64:DWORD64,FLOAT:FLOAT,HACCEL:HACCEL,HALF_PTR:HALF_PTR,HBITMAP:HBITMAP,HBRUSH:HBRUSH,HCOLORSPACE:"HANDLE",HCONV:HCONV,HCONVLIST:"HANDLE",HCURSOR:HCURSOR,HDC:HDC,HDDEDATA:"HANDLE",HDESK:HDESK,HDROP:HDROP,HDWP:HDWP,HENHMETAFILE:"HANDLE",HFILE:HFILE,HFONT:HFONT,HGDIOBJ:HGDIOBJ,HGLOBAL:HGLOBAL,HHOOK:HHOOK,HICON:HICON,HINSTANCE:"HANDLE",HKEY:HKEY,HKL:HKL,HLOCAL:HLOCAL,HMENU:HMENU,HMETAFILE:"HANDLE",HMODULE:HMODULE,HMONITOR:"HANDLE",HPALETTE:"HANDLE",HPEN:HPEN,HRESULT:"long",HRGN:HRGN,HRSRC:HRSRC,HSZ:HSZ,HWINEVENTHOOK:"HANDLE",HWINSTA:HWINSTA,HWND:HWND,INT:INT,INT_PTR:INT_PTR,INT8:INT8,INT16:INT16,INT32:INT32,INT64:INT64,LANGID:"WORD",LCID:LCID,LCTYPE:LCTYPE,LGRPID:LGRPID,LONG:LONG,LONGLONG:LONGLONG,LONG32:LONG32,LONG64:LONG64,LPARAM:LPARAM,LPBOOL:"BOOL",LPBYTE:LPBYTE,LPCOLORREF:"DWORD",LPCSTR:LPCSTR,LPCWSTR:LPCWSTR,LPCTSTR:LPCTSTR,LPVOID:LPVOID,LPCVOID:LPCVOID,LPDWORD:LPDWORD,LPHANDLE:LPHANDLE,LPINT:LPINT,LPLONG:LPLONG,LPMSG:LPMSG,LPSTR:LPSTR,LPWSTR:LPWSTR,LPTSTR:LPTSTR,LPWORD:LPWORD,LRESULT:LRESULT,NTSTATUS:"uint32",PBOOL:PBOOL,PBOOLEAN:"bool*",PBYTE:PBYTE,PCHAR:PCHAR,PCSTR:PCSTR,PCTSTR:PCTSTR,PCWSTR:PCWSTR,PDWORD:PDWORD,PDWORDLONG:"uint64*",PDWORD_PTR:PDWORD_PTR,PDWORD32:PDWORD32,PDWORD64:PDWORD64,PFLOAT:PFLOAT,PHALF_PTR:"pointer",PHANDLE:PHANDLE,PHKEY:PHKEY,PINT:PINT,PINT_PTR:"int**",PINT8:PINT8,PINT16:PINT16,PINT32:PINT32,PINT64:PINT64,PLCID:PLCID,PLONG:PLONG,PLONGLONG:"int64*",PLONG_PTR:PLONG_PTR,PLONG32:PLONG32,PLONG64:PLONG64,POINTER_32:POINTER_32,POINTER_64:POINTER_64,POINTER_SIGNED:"pointer",POINTER_UNSIGNED:"pointer",PSHORT:PSHORT,PSIZE_T:PSIZE_T,PSSIZE_T:PSSIZE_T,PSTR:PSTR,PTBYTE:PTBYTE,PTCHAR:PTCHAR,PTSTR:PTSTR,PUCHAR:PUCHAR,PUHALF_PTR:"pointer",PUINT:PUINT,PUINT_PTR:"uint**",PUINT8:PUINT8,PUINT16:PUINT16,PUINT32:PUINT32,PUINT64:PUINT64,PULONG:PULONG,PULONGLONG:"uint64*",PULONG_PTR:"uint64**",PULONG32:"uint*",PULONG64:PULONG64,PUSHORT:PUSHORT,PWCHAR:PWCHAR,PWORD:PWORD,PWSTR:PWSTR,QWORD:QWORD,SC_HANDLE:"HANDLE",SC_LOCK:SC_LOCK,SERVICE_STATUS_HANDLE:"HANDLE",SHORT:SHORT,SIZE_T:SIZE_T,SSIZE_T:SSIZE_T,TBYTE:TBYTE,TCHAR:TCHAR,UCHAR:UCHAR,UHALF_PTR:UHALF_PTR,UINT:UINT,UINT_PTR:"uint",UINT8:UINT8,UINT16:UINT16,UINT32:UINT32,UINT64:UINT64,ULONG:ULONG,ULONGLONG:"uint64",ULONG32:ULONG32,ULONG64:ULONG64,USHORT:USHORT,UNICODE_STRING:"pointer",USN:USN,WINEVENTPROC:"pointer",WNDENUMPROC:"pointer",WNDPROC:WNDPROC,WPARAM:WPARAM,LPINITCOMMONCONTROLSEX:"pointer",LPWNDCLASSEX:"pointer",PWINDOWINFO:"pointer",va_list:"char*",INITCOMMONCONTROLSEX:"pointer",MSG:MSG,POINT:POINT,WNDCLASSEX:"pointer",WINDOWINFO:"pointer",RECT:RECT});const macroMap=new Map([["PVOID",[_WIN64_HOLDER,"uint64*","uint32*"]],["LONG_PTR",[_WIN64_HOLDER,"int64","int32"]],["ULONG_PTR",[_WIN64_HOLDER,"uint64","uint32"]],["HALF_PTR",[_WIN64_HOLDER,"int32","int16"]],["INT_PTR",[_WIN64_HOLDER,"int64","int32"]],["LPCTSTR",[_UNICODE_HOLDER,LPCWSTR,LPCSTR]],["LPHANDLE",[_WIN64_HOLDER,"uint64*","uint32*"]],["LPTSTR",[_UNICODE_HOLDER,LPWSTR,"uint8*"]],["PCTSTR",[_WIN64_HOLDER,LPCWSTR,LPCSTR]],["PHANDLE",[_WIN64_HOLDER,"uint64**","uint32**"]],["PHKEY",[_WIN64_HOLDER,"uint64*","uint32*"]],["POINTER_32",[_WIN64_HOLDER,"uint64*","uint32*"]],["POINTER_64",[_WIN64_HOLDER,"uint64*","uint32*"]],["PTBYTE",[_UNICODE_HOLDER,"int16*","int8*"]],["PTCHAR",[_UNICODE_HOLDER,"uint16*","uint8*"]],["PTSTR",[_UNICODE_HOLDER,LPWSTR,LPSTR]],["TBYTE",[_UNICODE_HOLDER,"int16","int8"]],["TCHAR",[_UNICODE_HOLDER,WCHAR,"uint8"]],["UHALF_PTR",[_WIN64_HOLDER,"uint32","uint16"]]]),INITCOMMONCONTROLSEX$1={dwSize:DWORD,dwICC:DWORD},MSG$1={hwnd:HWND,message:UINT,wParam:WPARAM,lParam:LPARAM,time:DWORD,pt:POINT},POINT$1={x:LONG,y:LONG},PROCESS_BASIC_INFORMATION={Reserved1:PVOID,PebBaseAddress:PVOID,Reserved2:PVOID,UniqueProcessId:ULONG_PTR,InheritedFromUniqueProcessId:PVOID},UNICODE_STRING$1={Length:USHORT,MaximumLength:USHORT,Buffer:PWSTR},WINDOWINFO$1={cbSize:DWORD,rcWindow:RECT,rcClient:RECT,dwStyle:DWORD,dwExStyle:DWORD,dwWindowStatus:DWORD,cxWindowBorders:UINT,cyWindowBorders:UINT,atomWindowType:ATOM,wCreatorVersion:WORD},WNDCLASSEX$1={cbSize:UINT,style:UINT,lpfnWndProc:WNDPROC,cbClsExtra:INT,cbWndExtra:INT,hInstance:"HANDLE",hIcon:HICON,hCursor:HCURSOR,hbrBackground:HBRUSH,lpszMenuName:LPCTSTR,lpszClassName:LPCTSTR,hIconSm:HICON},RECT$1={left:LONG,top:LONG,right:LONG,bottom:LONG};var struct=Object.freeze({INITCOMMONCONTROLSEX:INITCOMMONCONTROLSEX$1,MSG:MSG$1,POINT:POINT$1,PROCESS_BASIC_INFORMATION:PROCESS_BASIC_INFORMATION,UNICODE_STRING:UNICODE_STRING$1,WINDOWINFO:WINDOWINFO$1,WNDCLASSEX:WNDCLASSEX$1,RECT:RECT$1,_RECT:RECT$1}),win_model=Object.freeze({});const DTypes=parse_windef(windef,macroMap);export{config as Config,ffi_model as FModel,win_model as DModel,struct as DStruct,DTypes}; | ||
const _WIN64_HOLDER="_WIN64_HOLDER_",_UNICODE_HOLDER="_UNICODE_HOLDER_",windefSkipKeys=new Set(["macroMap"]),_WIN64="x64"===process.arch,_UNICODE=!0,settingsDefault={singleton:!0,_UNICODE:!0,_WIN64:_WIN64},windefSet=new Set(["bool","bool*","byte","byte*","char","uchar","char*","float","float*","int","int8","int16","int32","int64","int*","int8*","int16*","int32*","int64*","uint","uint8","uint16","uint32","uint64","uint*","uint8*","uint16*","uint32*","uint64*","int**","uint**","uint32**","uint64**","long","longlong","long*","longlong*","pointer","ushort","void","void*"]);var config=Object.freeze({_WIN64_HOLDER:_WIN64_HOLDER,_UNICODE_HOLDER:_UNICODE_HOLDER,windefSkipKeys:windefSkipKeys,_WIN64:_WIN64,_UNICODE:!0,settingsDefault:settingsDefault,windefSet:windefSet}),ffi_model=Object.freeze({});function parse_windef(O,N,L){const T=clone_filter_windef(O),R=prepare_macro(N,L);return prepare_windef_ref(T,R)}function parse_param_placeholder(O,N){if("string"==typeof O)return O;if(!O)throw new Error("parse_param_placeholder(ps, settings) value of ps invalid");if(!Array.isArray(O)||3!==O.length)throw new Error("parse_param_placeholder(ps, settings) value of ps must Array and has THREE elements");const L=parse_settings(N);let T="";switch(O[0]){case _WIN64_HOLDER:T=parse_placeholder_arch(O,L._WIN64);break;case _UNICODE_HOLDER:T=parse_placeholder_unicode(O,L._UNICODE);break;default:throw new Error("the value of param placeholder invlaid:"+O[0])}return T}function parse_placeholder_arch(O,N){if("string"==typeof O)return O;if(!O||3!==O.length)throw new Error("_WIN64 macro should be Array and has 3 items");return N?O[1]:O[2]}function parse_placeholder_unicode(O,N){if("string"==typeof O)return O;if(!O||3!==O.length)throw new Error("_UNICODE macro should be Array and has 3 items");return N?O[1]:O[2]}function prepare_macro(O,N){const L=new Map;for(const[T,R]of O.entries())L.set(T,parse_param_placeholder(R,N));return L}function prepare_windef_ref(O,N){const L=new Map;for(const T of Object.keys(O))if(!L.has(T)&&N.has(T)){const O=N.get(T);if(!O)throw new Error(`value of "${O}" blank`);validDataDef(O,windefSet),L.set(T,O)}for(const N of Object.keys(O)){if(L.has(N))continue;const T=retrieve_ref_value(O,N,L);T&&windefSet.has(T)&&L.set(N,T)}const T={};return L.forEach((O,N)=>{T[N]=O}),T}function clone_filter_windef(O){const N={};for(const L of Object.keys(O)){if("string"!=typeof O[L])throw new Error(`typeof value of ${L} NOT string`);Object.defineProperty(N,L,{value:O[L],writable:!0,enumerable:!0,configurable:!0})}return N}function parse_settings(O){const N=Object.assign({},settingsDefault);return"undefined"!=typeof O&&O&&Object.keys(O).length&&Object.assign(N,O),N}function retrieve_ref_value(O,N,L){const T=L.get(N);if(T)return T;if("undefined"==typeof O[N])return"";const R=O[N];if(!R)return"";const t=retrieve_ref_value(O,R,L);return t||R}function validDataDef(O,N){if(!O||"string"!=typeof O)throw new Error(`value of param invalid: ${O}`);if(!N.has(O))throw new Error(`conifig.windefSet not contains element of ${O}`)}const ATOM="uint16",DWORD="uint32",PVOID=_WIN64_HOLDER,HANDLE="PVOID",LONG_PTR=_WIN64_HOLDER,ULONG_PTR=_WIN64_HOLDER,VOID="void",WCHAR="uint16",WORD="int16",BOOL="int",BOOLEAN="bool",BYTE="byte",CALLBACK="pointer",CCHAR="char",CHAR="char",COLORREF="DWORD",DWORDLONG="uint64",DWORD_PTR="ULONG_PTR",DWORD32="uint32",DWORD64="uint64",FLOAT="float",HACCEL="HANDLE",HALF_PTR=_WIN64_HOLDER,HBITMAP="HANDLE",HBRUSH="HANDLE",HCOLORSPACE="HANDLE",HCONV="HANDLE",HCONVLIST="HANDLE",HCURSOR="HANDLE",HDC="HANDLE",HDDEDATA="HANDLE",HDESK="HANDLE",HDROP="HANDLE",HDWP="HANDLE",HENHMETAFILE="HANDLE",HFILE="HANDLE",HFONT="HANDLE",HGDIOBJ="HANDLE",HGLOBAL="HANDLE",HHOOK="HANDLE",HICON="HANDLE",HINSTANCE="HANDLE",HKEY="HANDLE",HKL="HANDLE",HLOCAL="HANDLE",HMENU="HANDLE",HMETAFILE="HANDLE",HMODULE="HANDLE",HMONITOR="HANDLE",HPALETTE="HANDLE",HPEN="HANDLE",HRESULT="long",HRGN="HANDLE",HRSRC="HANDLE",HSZ="HANDLE",HWINEVENTHOOK="HANDLE",HWINSTA="HANDLE",HWND="HANDLE",INT="int",INT_PTR=_WIN64_HOLDER,INT8="int8",INT16="int16",INT32="int32",INT64="int64",LANGID="WORD",LCID="DWORD",LCTYPE="DWORD",LGRPID="DWORD",LONG="long",LONGLONG="longlong",LONG32="int32",LONG64="int64",LPARAM="LONG_PTR",LPBOOL="BOOL",LPBYTE="byte*",LPCOLORREF="DWORD",LPCSTR="uint8*",LPCWSTR="uint16*",LPCTSTR=_UNICODE_HOLDER,LPVOID="void*",LPCVOID="LPVOID",LPDWORD="uint16*",LPHANDLE=_WIN64_HOLDER,LPINT="int*",LPLONG="int32*",LPMSG="pointer",LPSTR="char*",LPWSTR="uint16*",LPTSTR=_UNICODE_HOLDER,LPWORD="uint16*",LRESULT="LONG_PTR",NTSTATUS="uint32",PBOOL="int*",PBOOLEAN="bool*",PBYTE="byte*",PCHAR="char*",PCSTR="uint8*",PCTSTR=_WIN64_HOLDER,PCWSTR="uint16*",PDWORD="uint32*",PDWORDLONG="uint64*",PDWORD_PTR="DWORD_PTR",PDWORD32="uint32*",PDWORD64="uint64*",PFLOAT="float*",PHALF_PTR="pointer",PHANDLE=_WIN64_HOLDER,PHKEY=_WIN64_HOLDER,PINT="int*",PINT_PTR="int**",PINT8="int8*",PINT16="int16*",PINT32="int32*",PINT64="int64*",PLCID="uint32*",PLONG="long*",PLONGLONG="int64*",PLONG_PTR="LONG_PTR",PLONG32="int32*",PLONG64="int64*",POINTER_32=_WIN64_HOLDER,POINTER_64=_WIN64_HOLDER,POINTER_SIGNED="pointer",POINTER_UNSIGNED="pointer",PSHORT="int16*",PSIZE_T="ULONG_PTR",PSSIZE_T="pointer",PSTR="char*",PTBYTE=_UNICODE_HOLDER,PTCHAR=_UNICODE_HOLDER,PTSTR=_UNICODE_HOLDER,PUCHAR="pointer",PUHALF_PTR="pointer",PUINT="uint*",PUINT_PTR="uint**",PUINT8="uint8*",PUINT16="uint16*",PUINT32="uint32*",PUINT64="uint64*",PULONG="uint*",PULONGLONG="uint64*",PULONG_PTR="uint64**",PULONG32="uint*",PULONG64="uint64*",PUSHORT="uint16*",PWCHAR="uint16*",PWORD="uint16*",PWSTR="uint16*",QWORD="uint64",SC_HANDLE="HANDLE",SC_LOCK="LPVOID",SERVICE_STATUS_HANDLE="HANDLE",SHORT="int16",SIZE_T="ULONG_PTR",SSIZE_T="LONG_PTR",TBYTE=_UNICODE_HOLDER,TCHAR=_UNICODE_HOLDER,UCHAR="uchar",UHALF_PTR=_WIN64_HOLDER,UINT="uint",UINT_PTR="uint",UINT8="uint8",UINT16="uint16",UINT32="uint32",UINT64="uint64",ULONG="uint",ULONGLONG="uint64",ULONG32="uint32",ULONG64="uint64",USHORT="ushort",UNICODE_STRING="pointer",USN="LONGLONG",WINEVENTPROC="pointer",WNDENUMPROC="pointer",WNDPROC="pointer",WPARAM="LONG_PTR",LPINITCOMMONCONTROLSEX="pointer",LPWNDCLASSEX="pointer",PWINDOWINFO="pointer",va_list="char*",INITCOMMONCONTROLSEX="pointer",MSG="pointer",POINT="pointer",WNDCLASSEX="pointer",WINDOWINFO="pointer",RECT="pointer";var windef=Object.freeze({ATOM:ATOM,DWORD:DWORD,PVOID:PVOID,HANDLE:HANDLE,LONG_PTR:LONG_PTR,ULONG_PTR:ULONG_PTR,VOID:VOID,WCHAR:WCHAR,WORD:WORD,BOOL:BOOL,BOOLEAN:"bool",BYTE:BYTE,CALLBACK:CALLBACK,CCHAR:CCHAR,CHAR:CHAR,COLORREF:"DWORD",DWORDLONG:"uint64",DWORD_PTR:DWORD_PTR,DWORD32:DWORD32,DWORD64:DWORD64,FLOAT:FLOAT,HACCEL:HACCEL,HALF_PTR:HALF_PTR,HBITMAP:HBITMAP,HBRUSH:HBRUSH,HCOLORSPACE:"HANDLE",HCONV:HCONV,HCONVLIST:"HANDLE",HCURSOR:HCURSOR,HDC:HDC,HDDEDATA:"HANDLE",HDESK:HDESK,HDROP:HDROP,HDWP:HDWP,HENHMETAFILE:"HANDLE",HFILE:HFILE,HFONT:HFONT,HGDIOBJ:HGDIOBJ,HGLOBAL:HGLOBAL,HHOOK:HHOOK,HICON:HICON,HINSTANCE:"HANDLE",HKEY:HKEY,HKL:HKL,HLOCAL:HLOCAL,HMENU:HMENU,HMETAFILE:"HANDLE",HMODULE:HMODULE,HMONITOR:"HANDLE",HPALETTE:"HANDLE",HPEN:HPEN,HRESULT:"long",HRGN:HRGN,HRSRC:HRSRC,HSZ:HSZ,HWINEVENTHOOK:"HANDLE",HWINSTA:HWINSTA,HWND:HWND,INT:INT,INT_PTR:INT_PTR,INT8:INT8,INT16:INT16,INT32:INT32,INT64:INT64,LANGID:"WORD",LCID:LCID,LCTYPE:LCTYPE,LGRPID:LGRPID,LONG:LONG,LONGLONG:LONGLONG,LONG32:LONG32,LONG64:LONG64,LPARAM:LPARAM,LPBOOL:"BOOL",LPBYTE:LPBYTE,LPCOLORREF:"DWORD",LPCSTR:LPCSTR,LPCWSTR:LPCWSTR,LPCTSTR:LPCTSTR,LPVOID:LPVOID,LPCVOID:LPCVOID,LPDWORD:LPDWORD,LPHANDLE:LPHANDLE,LPINT:LPINT,LPLONG:LPLONG,LPMSG:LPMSG,LPSTR:LPSTR,LPWSTR:LPWSTR,LPTSTR:LPTSTR,LPWORD:LPWORD,LRESULT:LRESULT,NTSTATUS:"uint32",PBOOL:PBOOL,PBOOLEAN:"bool*",PBYTE:PBYTE,PCHAR:PCHAR,PCSTR:PCSTR,PCTSTR:PCTSTR,PCWSTR:PCWSTR,PDWORD:PDWORD,PDWORDLONG:"uint64*",PDWORD_PTR:PDWORD_PTR,PDWORD32:PDWORD32,PDWORD64:PDWORD64,PFLOAT:PFLOAT,PHALF_PTR:"pointer",PHANDLE:PHANDLE,PHKEY:PHKEY,PINT:PINT,PINT_PTR:"int**",PINT8:PINT8,PINT16:PINT16,PINT32:PINT32,PINT64:PINT64,PLCID:PLCID,PLONG:PLONG,PLONGLONG:"int64*",PLONG_PTR:PLONG_PTR,PLONG32:PLONG32,PLONG64:PLONG64,POINTER_32:POINTER_32,POINTER_64:POINTER_64,POINTER_SIGNED:"pointer",POINTER_UNSIGNED:"pointer",PSHORT:PSHORT,PSIZE_T:PSIZE_T,PSSIZE_T:PSSIZE_T,PSTR:PSTR,PTBYTE:PTBYTE,PTCHAR:PTCHAR,PTSTR:PTSTR,PUCHAR:PUCHAR,PUHALF_PTR:"pointer",PUINT:PUINT,PUINT_PTR:"uint**",PUINT8:PUINT8,PUINT16:PUINT16,PUINT32:PUINT32,PUINT64:PUINT64,PULONG:PULONG,PULONGLONG:"uint64*",PULONG_PTR:"uint64**",PULONG32:"uint*",PULONG64:PULONG64,PUSHORT:PUSHORT,PWCHAR:PWCHAR,PWORD:PWORD,PWSTR:PWSTR,QWORD:QWORD,SC_HANDLE:"HANDLE",SC_LOCK:SC_LOCK,SERVICE_STATUS_HANDLE:"HANDLE",SHORT:SHORT,SIZE_T:SIZE_T,SSIZE_T:SSIZE_T,TBYTE:TBYTE,TCHAR:TCHAR,UCHAR:UCHAR,UHALF_PTR:UHALF_PTR,UINT:UINT,UINT_PTR:"uint",UINT8:UINT8,UINT16:UINT16,UINT32:UINT32,UINT64:UINT64,ULONG:ULONG,ULONGLONG:"uint64",ULONG32:ULONG32,ULONG64:ULONG64,USHORT:USHORT,UNICODE_STRING:"pointer",USN:USN,WINEVENTPROC:"pointer",WNDENUMPROC:"pointer",WNDPROC:WNDPROC,WPARAM:WPARAM,LPINITCOMMONCONTROLSEX:"pointer",LPWNDCLASSEX:"pointer",PWINDOWINFO:"pointer",va_list:"char*",INITCOMMONCONTROLSEX:"pointer",MSG:MSG,POINT:POINT,WNDCLASSEX:"pointer",WINDOWINFO:"pointer",RECT:RECT});const macroMap=new Map([["PVOID",[_WIN64_HOLDER,"uint64*","uint32*"]],["LONG_PTR",[_WIN64_HOLDER,"int64","int32"]],["ULONG_PTR",[_WIN64_HOLDER,"uint64","uint32"]],["HALF_PTR",[_WIN64_HOLDER,"int32","int16"]],["INT_PTR",[_WIN64_HOLDER,"int64","int32"]],["LPCTSTR",[_UNICODE_HOLDER,LPCWSTR,LPCSTR]],["LPHANDLE",[_WIN64_HOLDER,"uint64*","uint32*"]],["LPTSTR",[_UNICODE_HOLDER,LPWSTR,"uint8*"]],["PCTSTR",[_WIN64_HOLDER,LPCWSTR,LPCSTR]],["PHANDLE",[_WIN64_HOLDER,"uint64**","uint32**"]],["PHKEY",[_WIN64_HOLDER,"uint64*","uint32*"]],["POINTER_32",[_WIN64_HOLDER,"uint64*","uint32*"]],["POINTER_64",[_WIN64_HOLDER,"uint64*","uint32*"]],["PTBYTE",[_UNICODE_HOLDER,"int16*","int8*"]],["PTCHAR",[_UNICODE_HOLDER,"uint16*","uint8*"]],["PTSTR",[_UNICODE_HOLDER,LPWSTR,LPSTR]],["TBYTE",[_UNICODE_HOLDER,"int16","int8"]],["TCHAR",[_UNICODE_HOLDER,WCHAR,"uint8"]],["UHALF_PTR",[_WIN64_HOLDER,"uint32","uint16"]]]),INITCOMMONCONTROLSEX$1={dwSize:DWORD,dwICC:DWORD},MSG$1={hwnd:HWND,message:UINT,wParam:WPARAM,lParam:LPARAM,time:DWORD,pt:POINT},POINT$1={x:LONG,y:LONG},PROCESS_BASIC_INFORMATION={Reserved1:PVOID,PebBaseAddress:PVOID,Reserved2:PVOID,UniqueProcessId:ULONG_PTR,InheritedFromUniqueProcessId:PVOID},UNICODE_STRING$1={Length:USHORT,MaximumLength:USHORT,Buffer:PWSTR},WINDOWINFO$1={cbSize:DWORD,rcWindow:RECT,rcClient:RECT,dwStyle:DWORD,dwExStyle:DWORD,dwWindowStatus:DWORD,cxWindowBorders:UINT,cyWindowBorders:UINT,atomWindowType:ATOM,wCreatorVersion:WORD},WNDCLASSEX$1={cbSize:UINT,style:UINT,lpfnWndProc:WNDPROC,cbClsExtra:INT,cbWndExtra:INT,hInstance:"HANDLE",hIcon:HICON,hCursor:HCURSOR,hbrBackground:HBRUSH,lpszMenuName:LPCTSTR,lpszClassName:LPCTSTR,hIconSm:HICON},RECT$1={left:LONG,top:LONG,right:LONG,bottom:LONG};var struct=Object.freeze({INITCOMMONCONTROLSEX:INITCOMMONCONTROLSEX$1,MSG:MSG$1,POINT:POINT$1,PROCESS_BASIC_INFORMATION:PROCESS_BASIC_INFORMATION,UNICODE_STRING:UNICODE_STRING$1,WINDOWINFO:WINDOWINFO$1,WNDCLASSEX:WNDCLASSEX$1,RECT:RECT$1,_RECT:RECT$1}),win_model=Object.freeze({});const DTypes=parse_windef(windef,macroMap);export{config as Config,ffi_model as FModel,win_model as DModel,struct as DStruct,DTypes}; | ||
//# sourceMappingURL=index.esm.min.js.map |
@@ -10,2 +10,3 @@ // dict of windef value | ||
export const settingsDefault = { | ||
singleton: true, | ||
_UNICODE, | ||
@@ -12,0 +13,0 @@ _WIN64, |
@@ -11,2 +11,3 @@ /// <reference types="node" /> | ||
export interface LoadSettings { | ||
singleton: boolean; | ||
_UNICODE?: boolean; | ||
@@ -13,0 +14,0 @@ _WIN64?: boolean; |
{ | ||
"name": "win32-def", | ||
"author": "waiting", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "win32 definitions for node-ffi", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
134630
2986
0