@bun-win32/wtsapi32 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI.md +2 -2
- package/README.md +1 -1
- package/package.json +2 -2
- package/structs/Wtsapi32.ts +6 -6
- package/types/Wtsapi32.ts +1 -1
package/AI.md
CHANGED
|
@@ -65,8 +65,8 @@ const value = out.readUInt32LE(0);
|
|
|
65
65
|
|
|
66
66
|
Nullability is encoded in the **type** via two representation-aware markers — the null sentinel is derived from `T` (`null` for pointer types `LP*`/`P*`, `0n` for handles and by-value addresses):
|
|
67
67
|
|
|
68
|
-
- `
|
|
69
|
-
- `
|
|
68
|
+
- `Optional<T>` — the parameter is formally optional (SAL `_*opt_` / `[*, optional]` / `_Reserved_` that still takes a value). Pass a value, or the null sentinel to omit.
|
|
69
|
+
- `Nullable<T>` — a plain `[in]`/`[out]` param whose docs say it can be NULL ("This parameter can be NULL" / "Specify NULL to …", including sizing-call buffers).
|
|
70
70
|
- A **required** param is bare; a **must-be-null reserved** param is typed `NULL`. A by-value **scalar** (`DWORD`/`ULONG`/`UINT`/`BOOL`) is never wrapped — its "optional" means pass `0`/a default.
|
|
71
71
|
## Errors and Cleanup
|
|
72
72
|
|
package/README.md
CHANGED
|
@@ -79,4 +79,4 @@ bun run example:session-monitor
|
|
|
79
79
|
|
|
80
80
|
- Either rely on lazy binding or call `Wtsapi32.Preload()`.
|
|
81
81
|
- Windows only. Bun runtime required.
|
|
82
|
-
- **SAL types & naming:** nullability is in the **type** — `
|
|
82
|
+
- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"url": "https://github.com/ObscuritySRL/bun-win32/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@bun-win32/core": "2.0.
|
|
7
|
+
"@bun-win32/core": "2.0.1"
|
|
8
8
|
},
|
|
9
9
|
"description": "Zero-dependency, zero-overhead Win32 WTSAPI32 bindings for Bun (FFI) on Windows.",
|
|
10
10
|
"devDependencies": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"directory": "packages/wtsapi32"
|
|
28
28
|
},
|
|
29
29
|
"type": "module",
|
|
30
|
-
"version": "2.0.
|
|
30
|
+
"version": "2.0.1",
|
|
31
31
|
"main": "./index.ts",
|
|
32
32
|
"keywords": [
|
|
33
33
|
"bun",
|
package/structs/Wtsapi32.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
LPSTR,
|
|
14
14
|
LPWSTR,
|
|
15
15
|
NULL,
|
|
16
|
-
|
|
16
|
+
Optional,
|
|
17
17
|
PBOOL,
|
|
18
18
|
PBYTE,
|
|
19
19
|
PCHAR,
|
|
@@ -164,12 +164,12 @@ class Wtsapi32 extends Win32 {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumeratelistenersa
|
|
167
|
-
public static WTSEnumerateListenersA(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListeners_out:
|
|
167
|
+
public static WTSEnumerateListenersA(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListeners_out: Optional<PWTSLISTENERNAMEA>, pCount_in_out: LPDWORD): BOOL {
|
|
168
168
|
return Wtsapi32.Load('WTSEnumerateListenersA')(hServer, pReserved, Reserved, pListeners_out, pCount_in_out);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumeratelistenersw
|
|
172
|
-
public static WTSEnumerateListenersW(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListeners_out:
|
|
172
|
+
public static WTSEnumerateListenersW(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListeners_out: Optional<PWTSLISTENERNAMEW>, pCount_in_out: LPDWORD): BOOL {
|
|
173
173
|
return Wtsapi32.Load('WTSEnumerateListenersW')(hServer, pReserved, Reserved, pListeners_out, pCount_in_out);
|
|
174
174
|
}
|
|
175
175
|
|
|
@@ -250,7 +250,7 @@ class Wtsapi32 extends Win32 {
|
|
|
250
250
|
Reserved: DWORD,
|
|
251
251
|
pListenerName: LPSTR,
|
|
252
252
|
SecurityInformation: SECURITY_INFORMATION,
|
|
253
|
-
pSecurityDescriptor_out:
|
|
253
|
+
pSecurityDescriptor_out: Optional<PSECURITY_DESCRIPTOR>,
|
|
254
254
|
nLength: DWORD,
|
|
255
255
|
lpnLengthNeeded_out: LPDWORD,
|
|
256
256
|
): BOOL {
|
|
@@ -264,7 +264,7 @@ class Wtsapi32 extends Win32 {
|
|
|
264
264
|
Reserved: DWORD,
|
|
265
265
|
pListenerName: LPWSTR,
|
|
266
266
|
SecurityInformation: SECURITY_INFORMATION,
|
|
267
|
-
pSecurityDescriptor_out:
|
|
267
|
+
pSecurityDescriptor_out: Optional<PSECURITY_DESCRIPTOR>,
|
|
268
268
|
nLength: DWORD,
|
|
269
269
|
lpnLengthNeeded_out: LPDWORD,
|
|
270
270
|
): BOOL {
|
|
@@ -367,7 +367,7 @@ class Wtsapi32 extends Win32 {
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtshintapi/nf-wtshintapi-wtssetrenderhint
|
|
370
|
-
public static WTSSetRenderHint(pRenderHintID_in_out: PVOID, hwndOwner: HWND, renderHintType: DWORD, cbHintDataLength: DWORD, pHintData:
|
|
370
|
+
public static WTSSetRenderHint(pRenderHintID_in_out: PVOID, hwndOwner: HWND, renderHintType: DWORD, cbHintDataLength: DWORD, pHintData: Optional<PBYTE>): HRESULT {
|
|
371
371
|
return Wtsapi32.Load('WTSSetRenderHint')(pRenderHintID_in_out, hwndOwner, renderHintType, cbHintDataLength, pHintData);
|
|
372
372
|
}
|
|
373
373
|
|
package/types/Wtsapi32.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Pointer } from 'bun:ffi';
|
|
2
2
|
|
|
3
3
|
import type { DWORD, HANDLE } from '@bun-win32/core';
|
|
4
|
-
export type { BOOL, BYTE, DWORD, HANDLE, HRESULT, HWND, LPDWORD, LPSTR, LPWSTR, NULL,
|
|
4
|
+
export type { BOOL, BYTE, DWORD, HANDLE, HRESULT, HWND, LPDWORD, LPSTR, LPWSTR, NULL, Optional, PBYTE, PHANDLE, PULONG, PVOID, ULONG, USHORT } from '@bun-win32/core';
|
|
5
5
|
|
|
6
6
|
export const WTS_ANY_SESSION: DWORD = 0xffff_fffe;
|
|
7
7
|
export const WTS_CHANNEL_OPTION_DYNAMIC: DWORD = 0x0000_0001;
|