Comparing version 8.0.0 to 9.0.0
@@ -6,2 +6,16 @@ # Change Log | ||
# [9.0.0](https://github.com/waitingsong/node-win32-api/compare/v8.0.0...v9.0.0) (2020-01-21) | ||
* refactor!: change type of handle from Buffer to number (uint32/uint64) ([47be79e](https://github.com/waitingsong/node-win32-api/commit/47be79e0875bb8b33575ba4cb815705a4e161d87)) | ||
### BREAKING CHANGES | ||
* the apis accept only number|bignum|string, no null any more | ||
# [8.0.0](https://github.com/waitingsong/node-win32-api/compare/v7.1.0...v8.0.0) (2020-01-10) | ||
@@ -8,0 +22,0 @@ |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 7.1.0 | ||
* @version 8.0.0 | ||
* @author waiting | ||
@@ -292,3 +292,12 @@ * @license MIT | ||
const PVOID = _WIN64_HOLDER; | ||
const HANDLE = 'PVOID'; | ||
/** | ||
* `uint32` used as value usage (memory address) instead of PVOID (Buffer), | ||
* Use `HANDLE` (number) for params defintion of the api, | ||
* @see https://stackoverflow.com/questions/18266626/what-is-the-range-of-a-windows-handle-on-a-64-bits-application/29526711#29526711 | ||
*/ | ||
const HANDLE = _WIN64_HOLDER; | ||
/** | ||
* `HANDLE_PVOID` (Buffer) can be used for definition of Struct, | ||
*/ | ||
const HANDLE_PVOID = 'PVOID'; | ||
const LONG_PTR = _WIN64_HOLDER; | ||
@@ -499,2 +508,3 @@ const ULONG_PTR = _WIN64_HOLDER; | ||
HANDLE: HANDLE, | ||
HANDLE_PVOID: HANDLE_PVOID, | ||
LONG_PTR: LONG_PTR, | ||
@@ -688,2 +698,3 @@ ULONG_PTR: ULONG_PTR, | ||
const macroMap = new Map([ | ||
['HANDLE', [_WIN64_HOLDER, 'uint64', 'uint32']], | ||
['PVOID', [_WIN64_HOLDER, 'uint64*', 'uint32*']], | ||
@@ -690,0 +701,0 @@ ['HALF_PTR', [_WIN64_HOLDER, 'int32', 'int16']], |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 7.1.0 | ||
* @version 8.0.0 | ||
* @author waiting | ||
@@ -288,3 +288,12 @@ * @license MIT | ||
const PVOID = _WIN64_HOLDER; | ||
const HANDLE = 'PVOID'; | ||
/** | ||
* `uint32` used as value usage (memory address) instead of PVOID (Buffer), | ||
* Use `HANDLE` (number) for params defintion of the api, | ||
* @see https://stackoverflow.com/questions/18266626/what-is-the-range-of-a-windows-handle-on-a-64-bits-application/29526711#29526711 | ||
*/ | ||
const HANDLE = _WIN64_HOLDER; | ||
/** | ||
* `HANDLE_PVOID` (Buffer) can be used for definition of Struct, | ||
*/ | ||
const HANDLE_PVOID = 'PVOID'; | ||
const LONG_PTR = _WIN64_HOLDER; | ||
@@ -495,2 +504,3 @@ const ULONG_PTR = _WIN64_HOLDER; | ||
HANDLE: HANDLE, | ||
HANDLE_PVOID: HANDLE_PVOID, | ||
LONG_PTR: LONG_PTR, | ||
@@ -684,2 +694,3 @@ ULONG_PTR: ULONG_PTR, | ||
const macroMap = new Map([ | ||
['HANDLE', [_WIN64_HOLDER, 'uint64', 'uint32']], | ||
['PVOID', [_WIN64_HOLDER, 'uint64*', 'uint32*']], | ||
@@ -686,0 +697,0 @@ ['HALF_PTR', [_WIN64_HOLDER, 'int32', 'int16']], |
@@ -5,3 +5,3 @@ /** | ||
* | ||
* @version 7.1.0 | ||
* @version 8.0.0 | ||
* @author waiting | ||
@@ -16,3 +16,3 @@ * @license MIT | ||
* | ||
* @version 7.1.0 | ||
* @version 8.0.0 | ||
* @author waiting | ||
@@ -22,3 +22,3 @@ * @license MIT | ||
*/ | ||
const t="_WIN64_HOLDER_",n="_UNICODE_HOLDER_",i=new Set(["macroMap"]),e="x64"===process.arch,r=!0,N={singleton:!0,_UNICODE:!0,_WIN64:e},O=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 o=Object.freeze({__proto__:null,_WIN64_HOLDER:t,_UNICODE_HOLDER:n,windefSkipKeys:i,_WIN64:e,_UNICODE:!0,settingsDefault:N,windefSet:O});function D(t,n,i){const e=u(t),r=P(n,i),N=E(e,r);return s(N,O),N}function L(i,e){if("string"==typeof i)return i;if(!i)throw new Error("parse_param_placeholder(ps, settings) value of ps invalid");if(!Array.isArray(i)||3!==i.length)throw new Error("parse_param_placeholder(ps, settings) value of ps must Array and has THREE elements");const r=H(e);let N="";switch(i[0]){case t:N=T(i,r._WIN64);break;case n:N=R(i,r._UNICODE);break;default:throw new Error("the value of param placeholder invlaid:"+i[0])}return N}function T(t,n){if("string"==typeof t)return t;if(!t||3!==t.length)throw new Error("_WIN64 macro should be Array and has 3 items");return n?t[1]:t[2]}function R(t,n){if("string"==typeof t)return t;if(!t||3!==t.length)throw new Error("_UNICODE macro should be Array and has 3 items");return n?t[1]:t[2]}function P(t,n){const i=new Map;for(const[e,r]of t.entries())i.set(e,L(r,n));return i}function E(t,n){const i={},e=new Map;for(const i of Object.keys(t))if(!e.has(i)&&n.has(i)){const t=n.get(i);if(!t)throw new Error(`Value of macroSrc item "${i}" blank`);e.set(i,t)}for(const[i,r]of Object.entries(t))if(!e.has(i)){if("string"!=typeof r)throw new Error(`prepare_windef_ref() missing entry for k/v: ${i}/${r}`);if(O.has(r))e.set(i,r);else{const N=a(r,t,n);"string"==typeof N&&N?e.set(i,N):e.set(i,r)}}return e.forEach((t,n)=>{i[n]=t}),i}function u(t){const n={};for(const i of Object.keys(t)){if("string"!=typeof t[i])throw new Error(`typeof value of ${i} NOT string`);Object.defineProperty(n,i,{value:t[i],writable:!0,enumerable:!0,configurable:!0})}return n}function H(t){const n={...N};return"undefined"!=typeof t&&t&&Object.keys(t).length&&Object.assign(n,t),n}function a(t,n,i){let e=I(t,n,i);if(!e)return"";for(let t=0,r=3;t<r;t+=1){const t=I(e,n,i);if(!t)break;e=t}return e}function I(t,n,i){if(i.has(t))return i.get(t);if("string"==typeof n[t]){const e=n[t];return e&&i.has(e)?i.get(e):e}return""}function A(t,n){return!!n.has(t)}function s(t,n){for(const[i,e]of Object.entries(t)){if(!i||!e)throw new Error(`validateWinData() k or v empty: "${i}"/"${e}"`);if("string"!=typeof e)throw new Error(`validateWinData() v not typeof string: "${i}"/"${e}"`);if(!A(e,n))throw new Error(`validateWinData() value is invalid ffi param value: "${i}"/"${e}", may extra space`)}}const W="uint16",_="uint32",S=t,p="PVOID",f=t,l=t,C="void",c="uint16",U="int16",d="int",w="bool",G="byte",h="pointer",g="uint8",b="uint8",M="DWORD",m="uint64",y="ULONG_PTR",v="uint32",B="uint64",F="float",V="HANDLE",Y=t,k="HANDLE",x="HANDLE",K="HANDLE",j="HANDLE",z="HANDLE",$="HANDLE",X="HANDLE",Z="HANDLE",q="HANDLE",J="HANDLE",Q="HANDLE",tt="HANDLE",nt="HANDLE",it="HANDLE",et="HANDLE",rt="HANDLE",Nt="HANDLE",Ot="HANDLE",ot="HANDLE",Dt="HANDLE",Lt="HANDLE",Tt="HANDLE",Rt="HANDLE",Pt="HANDLE",Et="HANDLE",ut="HANDLE",Ht="HANDLE",at="HANDLE",It="long",At="HANDLE",st="HANDLE",Wt="HANDLE",_t="HANDLE",St="HANDLE",pt="HANDLE",ft="int",lt=t,Ct="int8",ct="int16",Ut="int32",dt="int64",wt="WORD",Gt="DWORD",ht="DWORD",gt="DWORD",bt="long",Mt="longlong",mt="int32",yt="int64",vt="LONG_PTR",Bt="BOOL",Ft="byte*",Vt="DWORD",Yt="uint8*",kt="uint16*",xt=n,Kt="void*",jt="LPVOID",zt="uint16*",$t=t,Xt="int*",Zt="int32*",qt="pointer",Jt="pointer",Qt="char*",tn="uint16*",nn=n,en="uint16*",rn="LONG_PTR",Nn="uint32",On="int*",on="bool*",Dn="byte*",Ln="char*",Tn="uint8*",Rn=t,Pn="uint16*",En="uint32*",un="uint64*",Hn="DWORD_PTR",an="uint32*",In="uint64*",An="float*",sn="pointer",Wn=t,_n=t,Sn="int*",pn="int**",fn="int8*",ln="int16*",Cn="int32*",cn="int64*",Un="uint32*",dn="long*",wn="int64*",Gn="pointer",hn="int32*",gn="int64*",bn=t,Mn=t,mn="pointer",yn="pointer",vn="int16*",Bn="ULONG_PTR",Fn="pointer",Vn="char*",Yn=n,kn=n,xn=n,Kn="pointer",jn="pointer",zn="uint*",$n="uint**",Xn="uint8*",Zn="uint16*",qn="uint32*",Jn="uint64*",Qn="uint*",ti="uint64*",ni="uint64**",ii="uint*",ei="uint64*",ri="uint16*",Ni="uint16*",Oi="uint16*",oi="uint16*",Di="uint64",Li="HANDLE",Ti="LPVOID",Ri="HANDLE",Pi="int16",Ei="ULONG_PTR",ui="LONG_PTR",Hi=n,ai=n,Ii="uchar",Ai=t,si="uint",Wi=t,_i="uint8",Si="uint16",pi="uint32",fi="uint64",li="uint",Ci="uint64",ci="uint32",Ui="uint64",di="pointer",wi="ushort",Gi=Mt,hi="pointer",gi="pointer",bi="pointer",Mi="UINT_PTR",mi="pointer",yi="pointer",vi="pointer",Bi="pointer",Fi="pointer",Vi="char*",Yi="pointer",ki="pointer",xi="pointer",Ki="pointer",ji="pointer",zi="pointer";var $i=Object.freeze({__proto__:null,ATOM:W,DWORD:_,PVOID:S,HANDLE:p,LONG_PTR:f,ULONG_PTR:l,VOID:C,WCHAR:c,WORD:U,BOOL:d,BOOLEAN:"bool",BYTE:G,CALLBACK:h,CCHAR:g,CHAR:b,COLORREF:"DWORD",DWORDLONG:"uint64",DWORD_PTR:y,DWORD32:v,DWORD64:B,FLOAT:F,HACCEL:V,HALF_PTR:Y,HBITMAP:k,HBRUSH:x,HCOLORSPACE:"HANDLE",HCONV:j,HCONVLIST:"HANDLE",HCURSOR:$,HDC:X,HDDEDATA:"HANDLE",HDESK:q,HDROP:J,HDWP:Q,HENHMETAFILE:"HANDLE",HFILE:nt,HFONT:it,HGDIOBJ:et,HGLOBAL:rt,HHOOK:Nt,HICON:Ot,HINSTANCE:"HANDLE",HKEY:Dt,HKL:Lt,HLOCAL:Tt,HMENU:Rt,HMETAFILE:"HANDLE",HMODULE:Et,HMONITOR:"HANDLE",HPALETTE:"HANDLE",HPEN:at,HRESULT:"long",HRGN:At,HRSRC:st,HSZ:Wt,HWINEVENTHOOK:"HANDLE",HWINSTA:St,HWND:pt,INT:ft,INT_PTR:lt,INT8:Ct,INT16:ct,INT32:Ut,INT64:dt,LANGID:"WORD",LCID:Gt,LCTYPE:ht,LGRPID:gt,LONG:bt,LONGLONG:Mt,LONG32:mt,LONG64:yt,LPARAM:vt,LPBOOL:"BOOL",LPBYTE:Ft,LPCOLORREF:"DWORD",LPCSTR:Yt,LPCWSTR:kt,LPCTSTR:xt,LPVOID:Kt,LPCVOID:jt,LPDWORD:zt,LPHANDLE:$t,LPINT:Xt,LPLONG:Zt,LPMSG:qt,LPPOINT:Jt,LPSTR:Qt,LPWSTR:tn,LPTSTR:nn,LPWORD:en,LRESULT:rn,NTSTATUS:"uint32",PBOOL:On,PBOOLEAN:"bool*",PBYTE:Dn,PCHAR:Ln,PCSTR:Tn,PCTSTR:Rn,PCWSTR:Pn,PDWORD:En,PDWORDLONG:"uint64*",PDWORD_PTR:Hn,PDWORD32:an,PDWORD64:In,PFLOAT:An,PHALF_PTR:"pointer",PHANDLE:Wn,PHKEY:_n,PINT:Sn,PINT_PTR:"int**",PINT8:fn,PINT16:ln,PINT32:Cn,PINT64:cn,PLCID:Un,PLONG:dn,PLONGLONG:"int64*",PLONG_PTR:"pointer",PLONG32:hn,PLONG64:gn,POINTER_32:bn,POINTER_64:Mn,POINTER_SIGNED:"pointer",POINTER_UNSIGNED:"pointer",PSHORT:vn,PSIZE_T:Bn,PSSIZE_T:Fn,PSTR:Vn,PTBYTE:Yn,PTCHAR:kn,PTSTR:xn,PUCHAR:Kn,PUHALF_PTR:"pointer",PUINT:zn,PUINT_PTR:"uint**",PUINT8:Xn,PUINT16:Zn,PUINT32:qn,PUINT64:Jn,PULONG:Qn,PULONGLONG:"uint64*",PULONG_PTR:"uint64**",PULONG32:"uint*",PULONG64:ei,PUSHORT:ri,PWCHAR:Ni,PWORD:Oi,PWSTR:oi,QWORD:Di,SC_HANDLE:"HANDLE",SC_LOCK:Ti,SERVICE_STATUS_HANDLE:"HANDLE",SHORT:Pi,SIZE_T:Ei,SSIZE_T:ui,TBYTE:Hi,TCHAR:ai,UCHAR:Ii,UHALF_PTR:Ai,UINT:si,UINT_PTR:Wi,UINT8:_i,UINT16:Si,UINT32:pi,UINT64:fi,ULONG:li,ULONGLONG:"uint64",ULONG32:ci,ULONG64:Ui,UNICODE_STRING:"pointer",USHORT:wi,USN:Gi,WINEVENTPROC:"pointer",WNDENUMPROC:"pointer",WNDPROC:bi,WPARAM:Mi,LPINITCOMMONCONTROLSEX:"pointer",LPWNDCLASSEX:"pointer",PWINDOWINFO:"pointer",PFILETIME:"pointer",LPFILETIME:"pointer",va_list:"char*",INITCOMMONCONTROLSEX:"pointer",MSG:ki,POINT:xi,WNDCLASSEX:"pointer",WINDOWINFO:"pointer",RECT:zi});const Xi=new Map([["PVOID",[t,"uint64*","uint32*"]],["HALF_PTR",[t,"int32","int16"]],["INT_PTR",[t,"int64","int32"]],["LONG_PTR",[t,"int64","int32"]],["LPCTSTR",[n,kt,Yt]],["LPHANDLE",[t,"uint64*","uint32*"]],["LPTSTR",[n,tn,"uint8*"]],["PCTSTR",[t,kt,Yt]],["PHANDLE",[t,"uint64**","uint32**"]],["PHKEY",[t,"uint64*","uint32*"]],["POINTER_32",[t,"uint32*","uint32*"]],["POINTER_64",[t,"uint64*","uint32*"]],["PTBYTE",[n,"int16*","int8*"]],["PTCHAR",[n,"uint16*","uint8*"]],["PTSTR",[n,tn,Qt]],["TBYTE",[n,"int16","int8"]],["TCHAR",[n,c,"uint8"]],["UHALF_PTR",[t,"uint32","uint16"]],["UINT_PTR",[t,"uint64","uint32"]],["ULONG_PTR",[t,"uint64","uint32"]]]),Zi=D($i,Xi),qi={uMsg:Zi.DWORD,wParamL:Zi.WORD,wParamH:Zi.WORD},Ji={dwSize:Zi.DWORD,dwICC:Zi.DWORD},Qi={wVk:Zi.WORD,wScan:Zi.WORD,dwFlags:Zi.DWORD,time:Zi.DWORD,dwExtraInfo:Zi.ULONG_PTR},te={dx:Zi.LONG,dy:Zi.LONG,mouseData:Zi.DWORD,dwFlags:Zi.DWORD,time:Zi.DWORD,dwExtraInfo:Zi.ULONG_PTR},ne={hwnd:Zi.HWND,message:Zi.UINT,wParam:Zi.WPARAM,lParam:Zi.LPARAM,time:Zi.DWORD,pt:Zi.POINT,lPrivate:Zi.DWORD},ie={x:Zi.LONG,y:Zi.LONG},ee={Reserved1:Zi.PVOID,PebBaseAddress:Zi.PVOID,Reserved2:Zi.PVOID,UniqueProcessId:Zi.ULONG_PTR,InheritedFromUniqueProcessId:Zi.PVOID},re={Length:Zi.USHORT,MaximumLength:Zi.USHORT,Buffer:Zi.PWSTR},Ne={dwSizeHid:Zi.DWORD,dwCount:Zi.DWORD,bRawData:Zi.BYTE},Oe={dwType:Zi.DWORD,dwSize:Zi.DWORD,hDevice:Zi.HANDLE,wParam:Zi.WPARAM},oe={MakeCode:Zi.USHORT,Flags:Zi.USHORT,Reserved:Zi.USHORT,VKey:Zi.USHORT,Message:Zi.UINT,ExtraInformation:Zi.ULONG},De={cbSize:Zi.DWORD,rcWindow:Zi.RECT,rcClient:Zi.RECT,dwStyle:Zi.DWORD,dwExStyle:Zi.DWORD,dwWindowStatus:Zi.DWORD,cxWindowBorders:Zi.UINT,cyWindowBorders:Zi.UINT,atomWindowType:Zi.ATOM,wCreatorVersion:Zi.WORD},Le={cbSize:Zi.UINT,style:Zi.UINT,lpfnWndProc:Zi.WNDPROC,cbClsExtra:Zi.INT,cbWndExtra:Zi.INT,hInstance:Zi.HINSTANCE,hIcon:Zi.HICON,hCursor:Zi.HCURSOR,hbrBackground:Zi.HBRUSH,lpszMenuName:Zi.LPCTSTR,lpszClassName:Zi.LPCTSTR,hIconSm:Zi.HICON},Te={left:Zi.LONG,top:Zi.LONG,right:Zi.LONG,bottom:Zi.LONG},Re={dwLowDateTime:Zi.DWORD,dwHighDateTime:Zi.DWORD};var Pe=Object.freeze({__proto__:null,HARDWAREINPUT:qi,INITCOMMONCONTROLSEX:Ji,KEYBDINPUT:Qi,MOUSEINPUT:te,MSG:ne,POINT:ie,PROCESS_BASIC_INFORMATION:ee,UNICODE_STRING:re,RAWHID:Ne,RAWINPUTHEADER:Oe,RAWKEYBOARD:oe,WINDOWINFO:De,WNDCLASSEX:Le,RECT:Te,_RECT:Te,FILETIME:Re}),Ee=Object.freeze({__proto__:null}),ue=Object.freeze({__proto__:null}); | ||
const t="_WIN64_HOLDER_",n="_UNICODE_HOLDER_",i=new Set(["macroMap"]),e="x64"===process.arch,r=!0,N={singleton:!0,_UNICODE:!0,_WIN64:e},O=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 o=Object.freeze({__proto__:null,_WIN64_HOLDER:t,_UNICODE_HOLDER:n,windefSkipKeys:i,_WIN64:e,_UNICODE:!0,settingsDefault:N,windefSet:O});function D(t,n,i){const e=u(t),r=P(n,i),N=E(e,r);return s(N,O),N}function L(i,e){if("string"==typeof i)return i;if(!i)throw new Error("parse_param_placeholder(ps, settings) value of ps invalid");if(!Array.isArray(i)||3!==i.length)throw new Error("parse_param_placeholder(ps, settings) value of ps must Array and has THREE elements");const r=H(e);let N="";switch(i[0]){case t:N=T(i,r._WIN64);break;case n:N=R(i,r._UNICODE);break;default:throw new Error("the value of param placeholder invlaid:"+i[0])}return N}function T(t,n){if("string"==typeof t)return t;if(!t||3!==t.length)throw new Error("_WIN64 macro should be Array and has 3 items");return n?t[1]:t[2]}function R(t,n){if("string"==typeof t)return t;if(!t||3!==t.length)throw new Error("_UNICODE macro should be Array and has 3 items");return n?t[1]:t[2]}function P(t,n){const i=new Map;for(const[e,r]of t.entries())i.set(e,L(r,n));return i}function E(t,n){const i={},e=new Map;for(const i of Object.keys(t))if(!e.has(i)&&n.has(i)){const t=n.get(i);if(!t)throw new Error(`Value of macroSrc item "${i}" blank`);e.set(i,t)}for(const[i,r]of Object.entries(t))if(!e.has(i)){if("string"!=typeof r)throw new Error(`prepare_windef_ref() missing entry for k/v: ${i}/${r}`);if(O.has(r))e.set(i,r);else{const N=a(r,t,n);"string"==typeof N&&N?e.set(i,N):e.set(i,r)}}return e.forEach((t,n)=>{i[n]=t}),i}function u(t){const n={};for(const i of Object.keys(t)){if("string"!=typeof t[i])throw new Error(`typeof value of ${i} NOT string`);Object.defineProperty(n,i,{value:t[i],writable:!0,enumerable:!0,configurable:!0})}return n}function H(t){const n={...N};return"undefined"!=typeof t&&t&&Object.keys(t).length&&Object.assign(n,t),n}function a(t,n,i){let e=I(t,n,i);if(!e)return"";for(let t=0,r=3;t<r;t+=1){const t=I(e,n,i);if(!t)break;e=t}return e}function I(t,n,i){if(i.has(t))return i.get(t);if("string"==typeof n[t]){const e=n[t];return e&&i.has(e)?i.get(e):e}return""}function A(t,n){return!!n.has(t)}function s(t,n){for(const[i,e]of Object.entries(t)){if(!i||!e)throw new Error(`validateWinData() k or v empty: "${i}"/"${e}"`);if("string"!=typeof e)throw new Error(`validateWinData() v not typeof string: "${i}"/"${e}"`);if(!A(e,n))throw new Error(`validateWinData() value is invalid ffi param value: "${i}"/"${e}", may extra space`)}}const W="uint16",_="uint32",S=t,p=t,f="PVOID",l=t,C=t,c="void",U="uint16",d="int16",w="int",G="bool",h="byte",g="pointer",b="uint8",M="uint8",m="DWORD",y="uint64",v="ULONG_PTR",B="uint32",F="uint64",V="float",Y="HANDLE",k=t,x="HANDLE",K="HANDLE",j="HANDLE",z="HANDLE",$="HANDLE",X="HANDLE",Z="HANDLE",q="HANDLE",J="HANDLE",Q="HANDLE",tt="HANDLE",nt="HANDLE",it="HANDLE",et="HANDLE",rt="HANDLE",Nt="HANDLE",Ot="HANDLE",ot="HANDLE",Dt="HANDLE",Lt="HANDLE",Tt="HANDLE",Rt="HANDLE",Pt="HANDLE",Et="HANDLE",ut="HANDLE",Ht="HANDLE",at="HANDLE",It="HANDLE",At="long",st="HANDLE",Wt="HANDLE",_t="HANDLE",St="HANDLE",pt="HANDLE",ft="HANDLE",lt="int",Ct=t,ct="int8",Ut="int16",dt="int32",wt="int64",Gt="WORD",ht="DWORD",gt="DWORD",bt="DWORD",Mt="long",mt="longlong",yt="int32",vt="int64",Bt="LONG_PTR",Ft="BOOL",Vt="byte*",Yt="DWORD",kt="uint8*",xt="uint16*",Kt=n,jt="void*",zt="LPVOID",$t="uint16*",Xt=t,Zt="int*",qt="int32*",Jt="pointer",Qt="pointer",tn="char*",nn="uint16*",en=n,rn="uint16*",Nn="LONG_PTR",On="uint32",on="int*",Dn="bool*",Ln="byte*",Tn="char*",Rn="uint8*",Pn=t,En="uint16*",un="uint32*",Hn="uint64*",an="DWORD_PTR",In="uint32*",An="uint64*",sn="float*",Wn="pointer",_n=t,Sn=t,pn="int*",fn="int**",ln="int8*",Cn="int16*",cn="int32*",Un="int64*",dn="uint32*",wn="long*",Gn="int64*",hn="pointer",gn="int32*",bn="int64*",Mn=t,mn=t,yn="pointer",vn="pointer",Bn="int16*",Fn="ULONG_PTR",Vn="pointer",Yn="char*",kn=n,xn=n,Kn=n,jn="pointer",zn="pointer",$n="uint*",Xn="uint**",Zn="uint8*",qn="uint16*",Jn="uint32*",Qn="uint64*",ti="uint*",ni="uint64*",ii="uint64**",ei="uint*",ri="uint64*",Ni="uint16*",Oi="uint16*",oi="uint16*",Di="uint16*",Li="uint64",Ti="HANDLE",Ri="LPVOID",Pi="HANDLE",Ei="int16",ui="ULONG_PTR",Hi="LONG_PTR",ai=n,Ii=n,Ai="uchar",si=t,Wi="uint",_i=t,Si="uint8",pi="uint16",fi="uint32",li="uint64",Ci="uint",ci="uint64",Ui="uint32",di="uint64",wi="pointer",Gi="ushort",hi=mt,gi="pointer",bi="pointer",Mi="pointer",mi="UINT_PTR",yi="pointer",vi="pointer",Bi="pointer",Fi="pointer",Vi="pointer",Yi="char*",ki="pointer",xi="pointer",Ki="pointer",ji="pointer",zi="pointer",$i="pointer";var Xi=Object.freeze({__proto__:null,ATOM:W,DWORD:_,PVOID:S,HANDLE:p,HANDLE_PVOID:"PVOID",LONG_PTR:l,ULONG_PTR:C,VOID:c,WCHAR:U,WORD:d,BOOL:w,BOOLEAN:"bool",BYTE:h,CALLBACK:g,CCHAR:b,CHAR:M,COLORREF:"DWORD",DWORDLONG:"uint64",DWORD_PTR:v,DWORD32:B,DWORD64:F,FLOAT:V,HACCEL:Y,HALF_PTR:k,HBITMAP:x,HBRUSH:K,HCOLORSPACE:"HANDLE",HCONV:z,HCONVLIST:"HANDLE",HCURSOR:X,HDC:Z,HDDEDATA:"HANDLE",HDESK:J,HDROP:Q,HDWP:tt,HENHMETAFILE:"HANDLE",HFILE:it,HFONT:et,HGDIOBJ:rt,HGLOBAL:Nt,HHOOK:Ot,HICON:ot,HINSTANCE:"HANDLE",HKEY:Lt,HKL:Tt,HLOCAL:Rt,HMENU:Pt,HMETAFILE:"HANDLE",HMODULE:ut,HMONITOR:"HANDLE",HPALETTE:"HANDLE",HPEN:It,HRESULT:"long",HRGN:st,HRSRC:Wt,HSZ:_t,HWINEVENTHOOK:"HANDLE",HWINSTA:pt,HWND:ft,INT:lt,INT_PTR:Ct,INT8:ct,INT16:Ut,INT32:dt,INT64:wt,LANGID:"WORD",LCID:ht,LCTYPE:gt,LGRPID:bt,LONG:Mt,LONGLONG:mt,LONG32:yt,LONG64:vt,LPARAM:Bt,LPBOOL:"BOOL",LPBYTE:Vt,LPCOLORREF:"DWORD",LPCSTR:kt,LPCWSTR:xt,LPCTSTR:Kt,LPVOID:jt,LPCVOID:zt,LPDWORD:$t,LPHANDLE:Xt,LPINT:Zt,LPLONG:qt,LPMSG:Jt,LPPOINT:Qt,LPSTR:tn,LPWSTR:nn,LPTSTR:en,LPWORD:rn,LRESULT:Nn,NTSTATUS:"uint32",PBOOL:on,PBOOLEAN:"bool*",PBYTE:Ln,PCHAR:Tn,PCSTR:Rn,PCTSTR:Pn,PCWSTR:En,PDWORD:un,PDWORDLONG:"uint64*",PDWORD_PTR:an,PDWORD32:In,PDWORD64:An,PFLOAT:sn,PHALF_PTR:"pointer",PHANDLE:_n,PHKEY:Sn,PINT:pn,PINT_PTR:"int**",PINT8:ln,PINT16:Cn,PINT32:cn,PINT64:Un,PLCID:dn,PLONG:wn,PLONGLONG:"int64*",PLONG_PTR:"pointer",PLONG32:gn,PLONG64:bn,POINTER_32:Mn,POINTER_64:mn,POINTER_SIGNED:"pointer",POINTER_UNSIGNED:"pointer",PSHORT:Bn,PSIZE_T:Fn,PSSIZE_T:Vn,PSTR:Yn,PTBYTE:kn,PTCHAR:xn,PTSTR:Kn,PUCHAR:jn,PUHALF_PTR:"pointer",PUINT:$n,PUINT_PTR:"uint**",PUINT8:Zn,PUINT16:qn,PUINT32:Jn,PUINT64:Qn,PULONG:ti,PULONGLONG:"uint64*",PULONG_PTR:"uint64**",PULONG32:"uint*",PULONG64:ri,PUSHORT:Ni,PWCHAR:Oi,PWORD:oi,PWSTR:Di,QWORD:Li,SC_HANDLE:"HANDLE",SC_LOCK:Ri,SERVICE_STATUS_HANDLE:"HANDLE",SHORT:Ei,SIZE_T:ui,SSIZE_T:Hi,TBYTE:ai,TCHAR:Ii,UCHAR:Ai,UHALF_PTR:si,UINT:Wi,UINT_PTR:_i,UINT8:Si,UINT16:pi,UINT32:fi,UINT64:li,ULONG:Ci,ULONGLONG:"uint64",ULONG32:Ui,ULONG64:di,UNICODE_STRING:"pointer",USHORT:Gi,USN:hi,WINEVENTPROC:"pointer",WNDENUMPROC:"pointer",WNDPROC:Mi,WPARAM:mi,LPINITCOMMONCONTROLSEX:"pointer",LPWNDCLASSEX:"pointer",PWINDOWINFO:"pointer",PFILETIME:"pointer",LPFILETIME:"pointer",va_list:"char*",INITCOMMONCONTROLSEX:"pointer",MSG:xi,POINT:Ki,WNDCLASSEX:"pointer",WINDOWINFO:"pointer",RECT:$i});const Zi=new Map([["HANDLE",[t,"uint64","uint32"]],["PVOID",[t,"uint64*","uint32*"]],["HALF_PTR",[t,"int32","int16"]],["INT_PTR",[t,"int64","int32"]],["LONG_PTR",[t,"int64","int32"]],["LPCTSTR",[n,xt,kt]],["LPHANDLE",[t,"uint64*","uint32*"]],["LPTSTR",[n,nn,"uint8*"]],["PCTSTR",[t,xt,kt]],["PHANDLE",[t,"uint64**","uint32**"]],["PHKEY",[t,"uint64*","uint32*"]],["POINTER_32",[t,"uint32*","uint32*"]],["POINTER_64",[t,"uint64*","uint32*"]],["PTBYTE",[n,"int16*","int8*"]],["PTCHAR",[n,"uint16*","uint8*"]],["PTSTR",[n,nn,tn]],["TBYTE",[n,"int16","int8"]],["TCHAR",[n,U,"uint8"]],["UHALF_PTR",[t,"uint32","uint16"]],["UINT_PTR",[t,"uint64","uint32"]],["ULONG_PTR",[t,"uint64","uint32"]]]),qi=D(Xi,Zi),Ji={uMsg:qi.DWORD,wParamL:qi.WORD,wParamH:qi.WORD},Qi={dwSize:qi.DWORD,dwICC:qi.DWORD},te={wVk:qi.WORD,wScan:qi.WORD,dwFlags:qi.DWORD,time:qi.DWORD,dwExtraInfo:qi.ULONG_PTR},ne={dx:qi.LONG,dy:qi.LONG,mouseData:qi.DWORD,dwFlags:qi.DWORD,time:qi.DWORD,dwExtraInfo:qi.ULONG_PTR},ie={hwnd:qi.HWND,message:qi.UINT,wParam:qi.WPARAM,lParam:qi.LPARAM,time:qi.DWORD,pt:qi.POINT,lPrivate:qi.DWORD},ee={x:qi.LONG,y:qi.LONG},re={Reserved1:qi.PVOID,PebBaseAddress:qi.PVOID,Reserved2:qi.PVOID,UniqueProcessId:qi.ULONG_PTR,InheritedFromUniqueProcessId:qi.PVOID},Ne={Length:qi.USHORT,MaximumLength:qi.USHORT,Buffer:qi.PWSTR},Oe={dwSizeHid:qi.DWORD,dwCount:qi.DWORD,bRawData:qi.BYTE},oe={dwType:qi.DWORD,dwSize:qi.DWORD,hDevice:qi.HANDLE,wParam:qi.WPARAM},De={MakeCode:qi.USHORT,Flags:qi.USHORT,Reserved:qi.USHORT,VKey:qi.USHORT,Message:qi.UINT,ExtraInformation:qi.ULONG},Le={cbSize:qi.DWORD,rcWindow:qi.RECT,rcClient:qi.RECT,dwStyle:qi.DWORD,dwExStyle:qi.DWORD,dwWindowStatus:qi.DWORD,cxWindowBorders:qi.UINT,cyWindowBorders:qi.UINT,atomWindowType:qi.ATOM,wCreatorVersion:qi.WORD},Te={cbSize:qi.UINT,style:qi.UINT,lpfnWndProc:qi.WNDPROC,cbClsExtra:qi.INT,cbWndExtra:qi.INT,hInstance:qi.HINSTANCE,hIcon:qi.HICON,hCursor:qi.HCURSOR,hbrBackground:qi.HBRUSH,lpszMenuName:qi.LPCTSTR,lpszClassName:qi.LPCTSTR,hIconSm:qi.HICON},Re={left:qi.LONG,top:qi.LONG,right:qi.LONG,bottom:qi.LONG},Pe={dwLowDateTime:qi.DWORD,dwHighDateTime:qi.DWORD};var Ee=Object.freeze({__proto__:null,HARDWAREINPUT:Ji,INITCOMMONCONTROLSEX:Qi,KEYBDINPUT:te,MOUSEINPUT:ne,MSG:ie,POINT:ee,PROCESS_BASIC_INFORMATION:re,UNICODE_STRING:Ne,RAWHID:Oe,RAWINPUTHEADER:oe,RAWKEYBOARD:De,WINDOWINFO:Le,WNDCLASSEX:Te,RECT:Re,_RECT:Re,FILETIME:Pe}),ue=Object.freeze({__proto__:null}),He=Object.freeze({__proto__:null}); | ||
/** | ||
@@ -31,3 +31,3 @@ * node-win32-def | ||
*/ | ||
const He=D($i,Xi);export{o as Config,ue as DModel,Pe as DStruct,He as DTypes,Ee as FModel}; | ||
const ae=D(Xi,Zi);export{o as Config,He as DModel,Ee as DStruct,ae as DTypes,ue as FModel}; | ||
//# sourceMappingURL=index.esm.min.js.map |
import { _UNICODE_HOLDER, _WIN64_HOLDER, } from './config'; | ||
import { LPCSTR, LPCWSTR, LPSTR, LPWSTR, WCHAR, } from './windef'; | ||
export const macroMap = new Map([ | ||
['HANDLE', [_WIN64_HOLDER, 'uint64', 'uint32']], | ||
['PVOID', [_WIN64_HOLDER, 'uint64*', 'uint32*']], | ||
@@ -5,0 +6,0 @@ ['HALF_PTR', [_WIN64_HOLDER, 'int32', 'int16']], |
@@ -7,3 +7,12 @@ /// <reference types="node" /> | ||
export declare type PVOID = Buffer; | ||
export declare type HANDLE = Buffer; | ||
/** | ||
* `uint32` or `uint64` used as value usage (memory address) instead of PVOID (Buffer), | ||
* Use `HANDLE` (number) for params defintion of the api, | ||
* @see https://stackoverflow.com/questions/18266626/what-is-the-range-of-a-windows-handle-on-a-64-bits-application/29526711#29526711 | ||
*/ | ||
export declare type HANDLE = number | BigIntStr; | ||
/** | ||
* `HANDLE_PVOID` (Buffer) can be used for definition of Struct, | ||
*/ | ||
export declare type HANDLE_PVOID = _POINTER; | ||
export declare type LONG_PTR = number | BigIntStr; | ||
@@ -10,0 +19,0 @@ export declare type ULONG_PTR = number | BigIntStr; |
@@ -10,3 +10,12 @@ /** | ||
export declare const PVOID = "_WIN64_HOLDER_"; | ||
export declare const HANDLE = "PVOID"; | ||
/** | ||
* `uint32` used as value usage (memory address) instead of PVOID (Buffer), | ||
* Use `HANDLE` (number) for params defintion of the api, | ||
* @see https://stackoverflow.com/questions/18266626/what-is-the-range-of-a-windows-handle-on-a-64-bits-application/29526711#29526711 | ||
*/ | ||
export declare const HANDLE = "_WIN64_HOLDER_"; | ||
/** | ||
* `HANDLE_PVOID` (Buffer) can be used for definition of Struct, | ||
*/ | ||
export declare const HANDLE_PVOID = "PVOID"; | ||
export declare const LONG_PTR = "_WIN64_HOLDER_"; | ||
@@ -13,0 +22,0 @@ export declare const ULONG_PTR = "_WIN64_HOLDER_"; |
@@ -13,3 +13,12 @@ // windows data types for ref module https://github.com/TooTallNate/ref | ||
export const PVOID = _WIN64_HOLDER; | ||
export const HANDLE = 'PVOID'; | ||
/** | ||
* `uint32` used as value usage (memory address) instead of PVOID (Buffer), | ||
* Use `HANDLE` (number) for params defintion of the api, | ||
* @see https://stackoverflow.com/questions/18266626/what-is-the-range-of-a-windows-handle-on-a-64-bits-application/29526711#29526711 | ||
*/ | ||
export const HANDLE = _WIN64_HOLDER; | ||
/** | ||
* `HANDLE_PVOID` (Buffer) can be used for definition of Struct, | ||
*/ | ||
export const HANDLE_PVOID = 'PVOID'; | ||
export const LONG_PTR = _WIN64_HOLDER; | ||
@@ -16,0 +25,0 @@ export const ULONG_PTR = _WIN64_HOLDER; |
{ | ||
"name": "win32-def", | ||
"author": "waiting", | ||
"version": "8.0.0", | ||
"version": "9.0.0", | ||
"description": "win32 definitions for node-ffi", | ||
@@ -82,3 +82,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "8d297dd50e8f2c9b67fa132f147a063ec2311cb5" | ||
"gitHead": "4bb8a46ed558ca06563ae931ed00799eb17b120b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
267422
38
3988