Skip to content

Commit 01a3df8

Browse files
committed
feat(def): change HANDLE def to 'void*'
1 parent 4d0fbd9 commit 01a3df8

1 file changed

Lines changed: 40 additions & 40 deletions

File tree

packages/win32-def/src/lib/common.def.ts

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ export const ACCESS_MASK: Def.int32 = Def.int32
1414
export const ATOM: Def.uint16 = Def.uint16
1515
export const DWORD: Def.uint32 = Def.uint32
1616
export const ptr: Def.uint32Ptr | Def.uint64Ptr = _WIN64 ? Def.uint64Ptr : Def.uint32Ptr
17-
export const PVOID: Def.uint32Ptr | Def.uint64Ptr = _WIN64 ? Def.uint64Ptr : Def.uint32Ptr
17+
export const PVOID: Def.voidPtr = Def.voidPtr
1818
/**
1919
* `uint32` or `uint64` used as value usage (memory address) instead of PVOID (Buffer),
2020
* Use `HANDLE` (number) for params definition of the api,
2121
* @see https://stackoverflow.com/questions/18266626/what-is-the-range-of-a-windows-handle-on-a-64-bits-application/29526711#29526711
2222
*/
23-
export const HANDLE: Def.uint32 | Def.uint64 = _WIN64 ? Def.uint64 : Def.uint32
23+
export const HANDLE: Def.voidPtr = Def.voidPtr
2424
/**
2525
* `HANDLE_PVOID` (Buffer) can be used for definition of Struct,
2626
*/
27-
export const HANDLE_PVOID: Def.uint32Ptr | Def.uint64Ptr = PVOID
27+
export const HANDLE_PVOID: Def.voidPtr = PVOID
2828
export const LONG_PTR: Def.int32 | Def.int64 = _WIN64 ? Def.int64 : Def.int32
2929
export const ULONG_PTR: Def.int32 | Def.int64 = _WIN64 ? Def.int64 : Def.int32
3030
export const VOID: Def.void = Def.void
@@ -44,43 +44,43 @@ export const DWORD_PTR: Def.int32 | Def.int64 = ULONG_PTR
4444
export const DWORD32: Def.uint32 = Def.uint32
4545
export const DWORD64: Def.uint64 = Def.uint64
4646
export const FLOAT: Def.float = Def.float
47-
export const HACCEL: Def.uint32 | Def.uint64 = HANDLE
47+
export const HACCEL: Def.voidPtr = HANDLE
4848
export const HALF_PTR: Def.int16 | Def.int32 = _WIN64 ? Def.int32 : Def.int16
49-
export const HBITMAP: Def.uint32 | Def.uint64 = HANDLE
50-
export const HBRUSH: Def.uint32 | Def.uint64 = HANDLE
51-
export const HCOLORSPACE: Def.uint32 | Def.uint64 = HANDLE
52-
export const HCONV: Def.uint32 | Def.uint64 = HANDLE
53-
export const HCONVLIST: Def.uint32 | Def.uint64 = HANDLE
54-
export const HCURSOR: Def.uint32 | Def.uint64 = HANDLE
55-
export const HDC: Def.uint32 | Def.uint64 = HANDLE
56-
export const HDDEDATA: Def.uint32 | Def.uint64 = HANDLE
57-
export const HDESK: Def.uint32 | Def.uint64 = HANDLE
58-
export const HDROP: Def.uint32 | Def.uint64 = HANDLE
59-
export const HDWP: Def.uint32 | Def.uint64 = HANDLE
60-
export const HENHMETAFILE: Def.uint32 | Def.uint64 = HANDLE
61-
export const HFILE: Def.uint32 | Def.uint64 = HANDLE
62-
export const HFONT: Def.uint32 | Def.uint64 = HANDLE
63-
export const HGDIOBJ: Def.uint32 | Def.uint64 = HANDLE
64-
export const HGLOBAL: Def.uint32 | Def.uint64 = HANDLE
65-
export const HHOOK: Def.uint32 | Def.uint64 = HANDLE
66-
export const HICON: Def.uint32 | Def.uint64 = HANDLE
67-
export const HINSTANCE: Def.uint32 | Def.uint64 = HANDLE
68-
export const HKEY: Def.uint32 | Def.uint64 = HANDLE
69-
export const HKL: Def.uint32 | Def.uint64 = HANDLE
70-
export const HLOCAL: Def.uint32 | Def.uint64 = HANDLE
71-
export const HMENU: Def.uint32 | Def.uint64 = HANDLE
72-
export const HMETAFILE: Def.uint32 | Def.uint64 = HANDLE
73-
export const HMODULE: Def.uint32 | Def.uint64 = HINSTANCE
74-
export const HMONITOR: Def.uint32 | Def.uint64 = HANDLE
75-
export const HPALETTE: Def.uint32 | Def.uint64 = HANDLE
76-
export const HPEN: Def.uint32 | Def.uint64 = HANDLE
49+
export const HBITMAP: Def.voidPtr = HANDLE
50+
export const HBRUSH: Def.voidPtr = HANDLE
51+
export const HCOLORSPACE: Def.voidPtr = HANDLE
52+
export const HCONV: Def.voidPtr = HANDLE
53+
export const HCONVLIST: Def.voidPtr = HANDLE
54+
export const HCURSOR: Def.voidPtr = HANDLE
55+
export const HDC: Def.voidPtr = HANDLE
56+
export const HDDEDATA: Def.voidPtr = HANDLE
57+
export const HDESK: Def.voidPtr = HANDLE
58+
export const HDROP: Def.voidPtr = HANDLE
59+
export const HDWP: Def.voidPtr = HANDLE
60+
export const HENHMETAFILE: Def.voidPtr = HANDLE
61+
export const HFILE: Def.voidPtr = HANDLE
62+
export const HFONT: Def.voidPtr = HANDLE
63+
export const HGDIOBJ: Def.voidPtr = HANDLE
64+
export const HGLOBAL: Def.voidPtr = HANDLE
65+
export const HHOOK: Def.voidPtr = HANDLE
66+
export const HICON: Def.voidPtr = HANDLE
67+
export const HINSTANCE: Def.voidPtr = HANDLE
68+
export const HKEY: Def.voidPtr = HANDLE
69+
export const HKL: Def.voidPtr = HANDLE
70+
export const HLOCAL: Def.voidPtr = HANDLE
71+
export const HMENU: Def.voidPtr = HANDLE
72+
export const HMETAFILE: Def.voidPtr = HANDLE
73+
export const HMODULE: Def.voidPtr = HINSTANCE
74+
export const HMONITOR: Def.voidPtr = HANDLE
75+
export const HPALETTE: Def.voidPtr = HANDLE
76+
export const HPEN: Def.voidPtr = HANDLE
7777
export const HRESULT: Def.long = Def.long
78-
export const HRGN: Def.uint32 | Def.uint64 = HANDLE
79-
export const HRSRC: Def.uint32 | Def.uint64 = HANDLE
80-
export const HSZ: Def.uint32 | Def.uint64 = HANDLE
81-
export const HWINEVENTHOOK: Def.uint32 | Def.uint64 = HANDLE
82-
export const HWINSTA: Def.uint32 | Def.uint64 = HANDLE
83-
export const HWND: Def.uint32 | Def.uint64 = HANDLE
78+
export const HRGN: Def.voidPtr = HANDLE
79+
export const HRSRC: Def.voidPtr = HANDLE
80+
export const HSZ: Def.voidPtr = HANDLE
81+
export const HWINEVENTHOOK: Def.voidPtr = HANDLE
82+
export const HWINSTA: Def.voidPtr = HANDLE
83+
export const HWND: Def.voidPtr = HANDLE
8484
/** A 32-bit signed integer */
8585
export const INT: Def.int = Def.int
8686
export const INT_PTR: Def.int32Ptr | Def.int64Ptr = _WIN64 ? Def.int64Ptr : Def.int32Ptr
@@ -176,9 +176,9 @@ export const PWCHAR: Def.uint16Ptr = Def.uint16Ptr
176176
export const PWORD: Def.uint16Ptr = Def.uint16Ptr
177177
export const PWSTR: Def.uint16Ptr = Def.uint16Ptr
178178
export const QWORD: Def.uint64 = Def.uint64
179-
export const SC_HANDLE: Def.uint32 | Def.uint64 = HANDLE
179+
export const SC_HANDLE: Def.voidPtr = HANDLE
180180
export const SC_LOCK: Def.voidPtr = LPVOID
181-
export const SERVICE_STATUS_HANDLE: Def.uint32 | Def.uint64 = HANDLE
181+
export const SERVICE_STATUS_HANDLE: Def.voidPtr = HANDLE
182182
export const SHORT: Def.int16 = Def.int16
183183
export const SIZE_T: Def.int32 | Def.int64 = ULONG_PTR
184184
export const SSIZE_T: Def.int32 | Def.int64 = LONG_PTR

0 commit comments

Comments
 (0)