@bun-win32/wtsapi32 1.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 +5 -3
- package/README.md +1 -0
- package/package.json +3 -3
- package/structs/Wtsapi32.ts +71 -70
- package/types/Wtsapi32.ts +1 -1
package/AI.md
CHANGED
|
@@ -53,7 +53,7 @@ const text = new TextDecoder('utf-16').decode(buf).replace(/\0.*$/, '');
|
|
|
53
53
|
|
|
54
54
|
- **Pointer** params (`LP*`, `P*`, `Pointer`): pass `buffer.ptr` from a caller-allocated `Buffer`.
|
|
55
55
|
- **Handle** params (`HANDLE`, `HWND`, etc.): pass a `bigint` value.
|
|
56
|
-
- **Out-parameters
|
|
56
|
+
- **Out-parameters** carry a direction suffix on the parameter **name** — `_out` for an `_Out_` param (the function writes through it), `_in_out` for `_Inout_` (you seed it, the function updates it); an `_In_` param is bare. Allocate a `Buffer`, pass `.ptr`, read the result after the call.
|
|
57
57
|
|
|
58
58
|
```ts
|
|
59
59
|
const out = Buffer.alloc(4);
|
|
@@ -63,9 +63,11 @@ const value = out.readUInt32LE(0);
|
|
|
63
63
|
|
|
64
64
|
### Nullability
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
- `| 0n` in a signature -> pass `0n` (optional handle).
|
|
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):
|
|
68
67
|
|
|
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
|
+
- 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.
|
|
69
71
|
## Errors and Cleanup
|
|
70
72
|
|
|
71
73
|
Return values are raw. If the Win32 function uses last-error semantics, read via `GetLastError()`. Resource cleanup is your responsibility - same as raw Win32.
|
package/README.md
CHANGED
|
@@ -79,3 +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** — `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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"author": "Stev Peifer <stev@
|
|
2
|
+
"author": "Stev Peifer <stev.p@outlook.com>",
|
|
3
3
|
"bugs": {
|
|
4
4
|
"url": "https://github.com/ObscuritySRL/bun-win32/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@bun-win32/core": "
|
|
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": "
|
|
30
|
+
"version": "2.0.1",
|
|
31
31
|
"main": "./index.ts",
|
|
32
32
|
"keywords": [
|
|
33
33
|
"bun",
|
package/structs/Wtsapi32.ts
CHANGED
|
@@ -13,6 +13,7 @@ import type {
|
|
|
13
13
|
LPSTR,
|
|
14
14
|
LPWSTR,
|
|
15
15
|
NULL,
|
|
16
|
+
Optional,
|
|
16
17
|
PBOOL,
|
|
17
18
|
PBYTE,
|
|
18
19
|
PCHAR,
|
|
@@ -143,12 +144,12 @@ class Wtsapi32 extends Win32 {
|
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtscreatelistenera
|
|
146
|
-
public static WTSCreateListenerA(hServer: HANDLE, pReserved:
|
|
147
|
+
public static WTSCreateListenerA(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListenerName: LPSTR, pBuffer: PWTSLISTENERCONFIGA, flag: DWORD): BOOL {
|
|
147
148
|
return Wtsapi32.Load('WTSCreateListenerA')(hServer, pReserved, Reserved, pListenerName, pBuffer, flag);
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtscreatelistenerw
|
|
151
|
-
public static WTSCreateListenerW(hServer: HANDLE, pReserved:
|
|
152
|
+
public static WTSCreateListenerW(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListenerName: LPWSTR, pBuffer: PWTSLISTENERCONFIGW, flag: DWORD): BOOL {
|
|
152
153
|
return Wtsapi32.Load('WTSCreateListenerW')(hServer, pReserved, Reserved, pListenerName, pBuffer, flag);
|
|
153
154
|
}
|
|
154
155
|
|
|
@@ -163,63 +164,63 @@ class Wtsapi32 extends Win32 {
|
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumeratelistenersa
|
|
166
|
-
public static WTSEnumerateListenersA(hServer: HANDLE, pReserved:
|
|
167
|
-
return Wtsapi32.Load('WTSEnumerateListenersA')(hServer, pReserved, Reserved,
|
|
167
|
+
public static WTSEnumerateListenersA(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListeners_out: Optional<PWTSLISTENERNAMEA>, pCount_in_out: LPDWORD): BOOL {
|
|
168
|
+
return Wtsapi32.Load('WTSEnumerateListenersA')(hServer, pReserved, Reserved, pListeners_out, pCount_in_out);
|
|
168
169
|
}
|
|
169
170
|
|
|
170
171
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumeratelistenersw
|
|
171
|
-
public static WTSEnumerateListenersW(hServer: HANDLE, pReserved:
|
|
172
|
-
return Wtsapi32.Load('WTSEnumerateListenersW')(hServer, pReserved, Reserved,
|
|
172
|
+
public static WTSEnumerateListenersW(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListeners_out: Optional<PWTSLISTENERNAMEW>, pCount_in_out: LPDWORD): BOOL {
|
|
173
|
+
return Wtsapi32.Load('WTSEnumerateListenersW')(hServer, pReserved, Reserved, pListeners_out, pCount_in_out);
|
|
173
174
|
}
|
|
174
175
|
|
|
175
176
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumerateprocessesa
|
|
176
|
-
public static WTSEnumerateProcessesA(hServer: HANDLE, Reserved: DWORD, Version: DWORD,
|
|
177
|
-
return Wtsapi32.Load('WTSEnumerateProcessesA')(hServer, Reserved, Version,
|
|
177
|
+
public static WTSEnumerateProcessesA(hServer: HANDLE, Reserved: DWORD, Version: DWORD, ppProcessInfo_out: PVOID, pCount_out: LPDWORD): BOOL {
|
|
178
|
+
return Wtsapi32.Load('WTSEnumerateProcessesA')(hServer, Reserved, Version, ppProcessInfo_out, pCount_out);
|
|
178
179
|
}
|
|
179
180
|
|
|
180
181
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumerateprocessesexa
|
|
181
|
-
public static WTSEnumerateProcessesExA(hServer: HANDLE,
|
|
182
|
-
return Wtsapi32.Load('WTSEnumerateProcessesExA')(hServer,
|
|
182
|
+
public static WTSEnumerateProcessesExA(hServer: HANDLE, pLevel_in_out: LPDWORD, SessionId: DWORD, ppProcessInfo_out: PVOID, pCount_out: LPDWORD): BOOL {
|
|
183
|
+
return Wtsapi32.Load('WTSEnumerateProcessesExA')(hServer, pLevel_in_out, SessionId, ppProcessInfo_out, pCount_out);
|
|
183
184
|
}
|
|
184
185
|
|
|
185
186
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumerateprocessesexw
|
|
186
|
-
public static WTSEnumerateProcessesExW(hServer: HANDLE,
|
|
187
|
-
return Wtsapi32.Load('WTSEnumerateProcessesExW')(hServer,
|
|
187
|
+
public static WTSEnumerateProcessesExW(hServer: HANDLE, pLevel_in_out: LPDWORD, SessionId: DWORD, ppProcessInfo_out: PVOID, pCount_out: LPDWORD): BOOL {
|
|
188
|
+
return Wtsapi32.Load('WTSEnumerateProcessesExW')(hServer, pLevel_in_out, SessionId, ppProcessInfo_out, pCount_out);
|
|
188
189
|
}
|
|
189
190
|
|
|
190
191
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumerateprocessesw
|
|
191
|
-
public static WTSEnumerateProcessesW(hServer: HANDLE, Reserved: DWORD, Version: DWORD,
|
|
192
|
-
return Wtsapi32.Load('WTSEnumerateProcessesW')(hServer, Reserved, Version,
|
|
192
|
+
public static WTSEnumerateProcessesW(hServer: HANDLE, Reserved: DWORD, Version: DWORD, ppProcessInfo_out: PVOID, pCount_out: LPDWORD): BOOL {
|
|
193
|
+
return Wtsapi32.Load('WTSEnumerateProcessesW')(hServer, Reserved, Version, ppProcessInfo_out, pCount_out);
|
|
193
194
|
}
|
|
194
195
|
|
|
195
196
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumerateserversa
|
|
196
|
-
public static WTSEnumerateServersA(pDomainName:
|
|
197
|
-
return Wtsapi32.Load('WTSEnumerateServersA')(pDomainName, Reserved, Version,
|
|
197
|
+
public static WTSEnumerateServersA(pDomainName: NULL, Reserved: DWORD, Version: DWORD, ppServerInfo_out: PVOID, pCount_out: LPDWORD): BOOL {
|
|
198
|
+
return Wtsapi32.Load('WTSEnumerateServersA')(pDomainName, Reserved, Version, ppServerInfo_out, pCount_out);
|
|
198
199
|
}
|
|
199
200
|
|
|
200
201
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumerateserversw
|
|
201
|
-
public static WTSEnumerateServersW(pDomainName:
|
|
202
|
-
return Wtsapi32.Load('WTSEnumerateServersW')(pDomainName, Reserved, Version,
|
|
202
|
+
public static WTSEnumerateServersW(pDomainName: NULL, Reserved: DWORD, Version: DWORD, ppServerInfo_out: PVOID, pCount_out: LPDWORD): BOOL {
|
|
203
|
+
return Wtsapi32.Load('WTSEnumerateServersW')(pDomainName, Reserved, Version, ppServerInfo_out, pCount_out);
|
|
203
204
|
}
|
|
204
205
|
|
|
205
206
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumeratesessionsa
|
|
206
|
-
public static WTSEnumerateSessionsA(hServer: HANDLE, Reserved: DWORD, Version: DWORD,
|
|
207
|
-
return Wtsapi32.Load('WTSEnumerateSessionsA')(hServer, Reserved, Version,
|
|
207
|
+
public static WTSEnumerateSessionsA(hServer: HANDLE, Reserved: DWORD, Version: DWORD, ppSessionInfo_out: PVOID, pCount_out: LPDWORD): BOOL {
|
|
208
|
+
return Wtsapi32.Load('WTSEnumerateSessionsA')(hServer, Reserved, Version, ppSessionInfo_out, pCount_out);
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumeratesessionsexa
|
|
211
|
-
public static WTSEnumerateSessionsExA(hServer: HANDLE,
|
|
212
|
-
return Wtsapi32.Load('WTSEnumerateSessionsExA')(hServer,
|
|
212
|
+
public static WTSEnumerateSessionsExA(hServer: HANDLE, pLevel_in_out: LPDWORD, Filter: DWORD, ppSessionInfo_out: PVOID, pCount_out: LPDWORD): BOOL {
|
|
213
|
+
return Wtsapi32.Load('WTSEnumerateSessionsExA')(hServer, pLevel_in_out, Filter, ppSessionInfo_out, pCount_out);
|
|
213
214
|
}
|
|
214
215
|
|
|
215
216
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumeratesessionsexw
|
|
216
|
-
public static WTSEnumerateSessionsExW(hServer: HANDLE,
|
|
217
|
-
return Wtsapi32.Load('WTSEnumerateSessionsExW')(hServer,
|
|
217
|
+
public static WTSEnumerateSessionsExW(hServer: HANDLE, pLevel_in_out: LPDWORD, Filter: DWORD, ppSessionInfo_out: PVOID, pCount_out: LPDWORD): BOOL {
|
|
218
|
+
return Wtsapi32.Load('WTSEnumerateSessionsExW')(hServer, pLevel_in_out, Filter, ppSessionInfo_out, pCount_out);
|
|
218
219
|
}
|
|
219
220
|
|
|
220
221
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsenumeratesessionsw
|
|
221
|
-
public static WTSEnumerateSessionsW(hServer: HANDLE, Reserved: DWORD, Version: DWORD,
|
|
222
|
-
return Wtsapi32.Load('WTSEnumerateSessionsW')(hServer, Reserved, Version,
|
|
222
|
+
public static WTSEnumerateSessionsW(hServer: HANDLE, Reserved: DWORD, Version: DWORD, ppSessionInfo_out: PVOID, pCount_out: LPDWORD): BOOL {
|
|
223
|
+
return Wtsapi32.Load('WTSEnumerateSessionsW')(hServer, Reserved, Version, ppSessionInfo_out, pCount_out);
|
|
223
224
|
}
|
|
224
225
|
|
|
225
226
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsfreememory
|
|
@@ -238,41 +239,41 @@ class Wtsapi32 extends Win32 {
|
|
|
238
239
|
}
|
|
239
240
|
|
|
240
241
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsgetchildsessionid
|
|
241
|
-
public static WTSGetChildSessionId(
|
|
242
|
-
return Wtsapi32.Load('WTSGetChildSessionId')(
|
|
242
|
+
public static WTSGetChildSessionId(pSessionId_out: PULONG): BOOL {
|
|
243
|
+
return Wtsapi32.Load('WTSGetChildSessionId')(pSessionId_out);
|
|
243
244
|
}
|
|
244
245
|
|
|
245
246
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsgetlistenersecuritya
|
|
246
247
|
public static WTSGetListenerSecurityA(
|
|
247
248
|
hServer: HANDLE,
|
|
248
|
-
pReserved:
|
|
249
|
+
pReserved: NULL,
|
|
249
250
|
Reserved: DWORD,
|
|
250
251
|
pListenerName: LPSTR,
|
|
251
252
|
SecurityInformation: SECURITY_INFORMATION,
|
|
252
|
-
|
|
253
|
+
pSecurityDescriptor_out: Optional<PSECURITY_DESCRIPTOR>,
|
|
253
254
|
nLength: DWORD,
|
|
254
|
-
|
|
255
|
+
lpnLengthNeeded_out: LPDWORD,
|
|
255
256
|
): BOOL {
|
|
256
|
-
return Wtsapi32.Load('WTSGetListenerSecurityA')(hServer, pReserved, Reserved, pListenerName, SecurityInformation,
|
|
257
|
+
return Wtsapi32.Load('WTSGetListenerSecurityA')(hServer, pReserved, Reserved, pListenerName, SecurityInformation, pSecurityDescriptor_out, nLength, lpnLengthNeeded_out);
|
|
257
258
|
}
|
|
258
259
|
|
|
259
260
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsgetlistenersecurityw
|
|
260
261
|
public static WTSGetListenerSecurityW(
|
|
261
262
|
hServer: HANDLE,
|
|
262
|
-
pReserved:
|
|
263
|
+
pReserved: NULL,
|
|
263
264
|
Reserved: DWORD,
|
|
264
265
|
pListenerName: LPWSTR,
|
|
265
266
|
SecurityInformation: SECURITY_INFORMATION,
|
|
266
|
-
|
|
267
|
+
pSecurityDescriptor_out: Optional<PSECURITY_DESCRIPTOR>,
|
|
267
268
|
nLength: DWORD,
|
|
268
|
-
|
|
269
|
+
lpnLengthNeeded_out: LPDWORD,
|
|
269
270
|
): BOOL {
|
|
270
|
-
return Wtsapi32.Load('WTSGetListenerSecurityW')(hServer, pReserved, Reserved, pListenerName, SecurityInformation,
|
|
271
|
+
return Wtsapi32.Load('WTSGetListenerSecurityW')(hServer, pReserved, Reserved, pListenerName, SecurityInformation, pSecurityDescriptor_out, nLength, lpnLengthNeeded_out);
|
|
271
272
|
}
|
|
272
273
|
|
|
273
274
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsischildsessionsenabled
|
|
274
|
-
public static WTSIsChildSessionsEnabled(
|
|
275
|
-
return Wtsapi32.Load('WTSIsChildSessionsEnabled')(
|
|
275
|
+
public static WTSIsChildSessionsEnabled(pbEnabled_out: PBOOL): BOOL {
|
|
276
|
+
return Wtsapi32.Load('WTSIsChildSessionsEnabled')(pbEnabled_out);
|
|
276
277
|
}
|
|
277
278
|
|
|
278
279
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtslogoffsession
|
|
@@ -301,38 +302,38 @@ class Wtsapi32 extends Win32 {
|
|
|
301
302
|
}
|
|
302
303
|
|
|
303
304
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsquerylistenerconfiga
|
|
304
|
-
public static WTSQueryListenerConfigA(hServer: HANDLE, pReserved:
|
|
305
|
-
return Wtsapi32.Load('WTSQueryListenerConfigA')(hServer, pReserved, Reserved, pListenerName,
|
|
305
|
+
public static WTSQueryListenerConfigA(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListenerName: LPSTR, pBuffer_out: PWTSLISTENERCONFIGA): BOOL {
|
|
306
|
+
return Wtsapi32.Load('WTSQueryListenerConfigA')(hServer, pReserved, Reserved, pListenerName, pBuffer_out);
|
|
306
307
|
}
|
|
307
308
|
|
|
308
309
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsquerylistenerconfigw
|
|
309
|
-
public static WTSQueryListenerConfigW(hServer: HANDLE, pReserved:
|
|
310
|
-
return Wtsapi32.Load('WTSQueryListenerConfigW')(hServer, pReserved, Reserved, pListenerName,
|
|
310
|
+
public static WTSQueryListenerConfigW(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListenerName: LPWSTR, pBuffer_out: PWTSLISTENERCONFIGW): BOOL {
|
|
311
|
+
return Wtsapi32.Load('WTSQueryListenerConfigW')(hServer, pReserved, Reserved, pListenerName, pBuffer_out);
|
|
311
312
|
}
|
|
312
313
|
|
|
313
314
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsquerysessioninformationa
|
|
314
|
-
public static WTSQuerySessionInformationA(hServer: HANDLE, SessionId: DWORD, WTSInfoClass: WTS_INFO_CLASS,
|
|
315
|
-
return Wtsapi32.Load('WTSQuerySessionInformationA')(hServer, SessionId, WTSInfoClass,
|
|
315
|
+
public static WTSQuerySessionInformationA(hServer: HANDLE, SessionId: DWORD, WTSInfoClass: WTS_INFO_CLASS, ppBuffer_out: PVOID, pBytesReturned_out: LPDWORD): BOOL {
|
|
316
|
+
return Wtsapi32.Load('WTSQuerySessionInformationA')(hServer, SessionId, WTSInfoClass, ppBuffer_out, pBytesReturned_out);
|
|
316
317
|
}
|
|
317
318
|
|
|
318
319
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsquerysessioninformationw
|
|
319
|
-
public static WTSQuerySessionInformationW(hServer: HANDLE, SessionId: DWORD, WTSInfoClass: WTS_INFO_CLASS,
|
|
320
|
-
return Wtsapi32.Load('WTSQuerySessionInformationW')(hServer, SessionId, WTSInfoClass,
|
|
320
|
+
public static WTSQuerySessionInformationW(hServer: HANDLE, SessionId: DWORD, WTSInfoClass: WTS_INFO_CLASS, ppBuffer_out: PVOID, pBytesReturned_out: LPDWORD): BOOL {
|
|
321
|
+
return Wtsapi32.Load('WTSQuerySessionInformationW')(hServer, SessionId, WTSInfoClass, ppBuffer_out, pBytesReturned_out);
|
|
321
322
|
}
|
|
322
323
|
|
|
323
324
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsqueryuserconfiga
|
|
324
|
-
public static WTSQueryUserConfigA(pServerName:
|
|
325
|
-
return Wtsapi32.Load('WTSQueryUserConfigA')(pServerName, pUserName, WTSConfigClass,
|
|
325
|
+
public static WTSQueryUserConfigA(pServerName: NULL, pUserName: LPSTR, WTSConfigClass: WTS_CONFIG_CLASS, ppBuffer_out: PVOID, pBytesReturned_out: LPDWORD): BOOL {
|
|
326
|
+
return Wtsapi32.Load('WTSQueryUserConfigA')(pServerName, pUserName, WTSConfigClass, ppBuffer_out, pBytesReturned_out);
|
|
326
327
|
}
|
|
327
328
|
|
|
328
329
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsqueryuserconfigw
|
|
329
|
-
public static WTSQueryUserConfigW(pServerName:
|
|
330
|
-
return Wtsapi32.Load('WTSQueryUserConfigW')(pServerName, pUserName, WTSConfigClass,
|
|
330
|
+
public static WTSQueryUserConfigW(pServerName: NULL, pUserName: LPWSTR, WTSConfigClass: WTS_CONFIG_CLASS, ppBuffer_out: PVOID, pBytesReturned_out: LPDWORD): BOOL {
|
|
331
|
+
return Wtsapi32.Load('WTSQueryUserConfigW')(pServerName, pUserName, WTSConfigClass, ppBuffer_out, pBytesReturned_out);
|
|
331
332
|
}
|
|
332
333
|
|
|
333
334
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsqueryusertoken
|
|
334
|
-
public static WTSQueryUserToken(SessionId: ULONG,
|
|
335
|
-
return Wtsapi32.Load('WTSQueryUserToken')(SessionId,
|
|
335
|
+
public static WTSQueryUserToken(SessionId: ULONG, phToken_out: PHANDLE): BOOL {
|
|
336
|
+
return Wtsapi32.Load('WTSQueryUserToken')(SessionId, phToken_out);
|
|
336
337
|
}
|
|
337
338
|
|
|
338
339
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsregistersessionnotification
|
|
@@ -346,28 +347,28 @@ class Wtsapi32 extends Win32 {
|
|
|
346
347
|
}
|
|
347
348
|
|
|
348
349
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssendmessagea
|
|
349
|
-
public static WTSSendMessageA(hServer: HANDLE, SessionId: DWORD, pTitle: LPSTR, TitleLength: DWORD, pMessage: LPSTR, MessageLength: DWORD, Style: DWORD, Timeout: DWORD,
|
|
350
|
-
return Wtsapi32.Load('WTSSendMessageA')(hServer, SessionId, pTitle, TitleLength, pMessage, MessageLength, Style, Timeout,
|
|
350
|
+
public static WTSSendMessageA(hServer: HANDLE, SessionId: DWORD, pTitle: LPSTR, TitleLength: DWORD, pMessage: LPSTR, MessageLength: DWORD, Style: DWORD, Timeout: DWORD, pResponse_out: LPDWORD, bWait: BOOL): BOOL {
|
|
351
|
+
return Wtsapi32.Load('WTSSendMessageA')(hServer, SessionId, pTitle, TitleLength, pMessage, MessageLength, Style, Timeout, pResponse_out, bWait);
|
|
351
352
|
}
|
|
352
353
|
|
|
353
354
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssendmessagew
|
|
354
|
-
public static WTSSendMessageW(hServer: HANDLE, SessionId: DWORD, pTitle: LPWSTR, TitleLength: DWORD, pMessage: LPWSTR, MessageLength: DWORD, Style: DWORD, Timeout: DWORD,
|
|
355
|
-
return Wtsapi32.Load('WTSSendMessageW')(hServer, SessionId, pTitle, TitleLength, pMessage, MessageLength, Style, Timeout,
|
|
355
|
+
public static WTSSendMessageW(hServer: HANDLE, SessionId: DWORD, pTitle: LPWSTR, TitleLength: DWORD, pMessage: LPWSTR, MessageLength: DWORD, Style: DWORD, Timeout: DWORD, pResponse_out: LPDWORD, bWait: BOOL): BOOL {
|
|
356
|
+
return Wtsapi32.Load('WTSSendMessageW')(hServer, SessionId, pTitle, TitleLength, pMessage, MessageLength, Style, Timeout, pResponse_out, bWait);
|
|
356
357
|
}
|
|
357
358
|
|
|
358
359
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssetlistenersecuritya
|
|
359
|
-
public static WTSSetListenerSecurityA(hServer: HANDLE, pReserved:
|
|
360
|
+
public static WTSSetListenerSecurityA(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListenerName: LPSTR, SecurityInformation: SECURITY_INFORMATION, pSecurityDescriptor: PSECURITY_DESCRIPTOR): BOOL {
|
|
360
361
|
return Wtsapi32.Load('WTSSetListenerSecurityA')(hServer, pReserved, Reserved, pListenerName, SecurityInformation, pSecurityDescriptor);
|
|
361
362
|
}
|
|
362
363
|
|
|
363
364
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssetlistenersecurityw
|
|
364
|
-
public static WTSSetListenerSecurityW(hServer: HANDLE, pReserved:
|
|
365
|
+
public static WTSSetListenerSecurityW(hServer: HANDLE, pReserved: NULL, Reserved: DWORD, pListenerName: LPWSTR, SecurityInformation: SECURITY_INFORMATION, pSecurityDescriptor: PSECURITY_DESCRIPTOR): BOOL {
|
|
365
366
|
return Wtsapi32.Load('WTSSetListenerSecurityW')(hServer, pReserved, Reserved, pListenerName, SecurityInformation, pSecurityDescriptor);
|
|
366
367
|
}
|
|
367
368
|
|
|
368
369
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtshintapi/nf-wtshintapi-wtssetrenderhint
|
|
369
|
-
public static WTSSetRenderHint(
|
|
370
|
-
return Wtsapi32.Load('WTSSetRenderHint')(
|
|
370
|
+
public static WTSSetRenderHint(pRenderHintID_in_out: PVOID, hwndOwner: HWND, renderHintType: DWORD, cbHintDataLength: DWORD, pHintData: Optional<PBYTE>): HRESULT {
|
|
371
|
+
return Wtsapi32.Load('WTSSetRenderHint')(pRenderHintID_in_out, hwndOwner, renderHintType, cbHintDataLength, pHintData);
|
|
371
372
|
}
|
|
372
373
|
|
|
373
374
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssetsessioninformationa
|
|
@@ -381,12 +382,12 @@ class Wtsapi32 extends Win32 {
|
|
|
381
382
|
}
|
|
382
383
|
|
|
383
384
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssetuserconfiga
|
|
384
|
-
public static WTSSetUserConfigA(pServerName:
|
|
385
|
+
public static WTSSetUserConfigA(pServerName: NULL, pUserName: LPSTR, WTSConfigClass: WTS_CONFIG_CLASS, pBuffer: LPSTR, DataLength: DWORD): BOOL {
|
|
385
386
|
return Wtsapi32.Load('WTSSetUserConfigA')(pServerName, pUserName, WTSConfigClass, pBuffer, DataLength);
|
|
386
387
|
}
|
|
387
388
|
|
|
388
389
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtssetuserconfigw
|
|
389
|
-
public static WTSSetUserConfigW(pServerName:
|
|
390
|
+
public static WTSSetUserConfigW(pServerName: NULL, pUserName: LPWSTR, WTSConfigClass: WTS_CONFIG_CLASS, pBuffer: LPWSTR, DataLength: DWORD): BOOL {
|
|
390
391
|
return Wtsapi32.Load('WTSSetUserConfigW')(pServerName, pUserName, WTSConfigClass, pBuffer, DataLength);
|
|
391
392
|
}
|
|
392
393
|
|
|
@@ -451,23 +452,23 @@ class Wtsapi32 extends Win32 {
|
|
|
451
452
|
}
|
|
452
453
|
|
|
453
454
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsvirtualchannelquery
|
|
454
|
-
public static WTSVirtualChannelQuery(hChannelHandle: HANDLE, WTSVirtualClass: WTS_VIRTUAL_CLASS,
|
|
455
|
-
return Wtsapi32.Load('WTSVirtualChannelQuery')(hChannelHandle, WTSVirtualClass,
|
|
455
|
+
public static WTSVirtualChannelQuery(hChannelHandle: HANDLE, WTSVirtualClass: WTS_VIRTUAL_CLASS, ppBuffer_out: PVOID, pBytesReturned_out: LPDWORD): BOOL {
|
|
456
|
+
return Wtsapi32.Load('WTSVirtualChannelQuery')(hChannelHandle, WTSVirtualClass, ppBuffer_out, pBytesReturned_out);
|
|
456
457
|
}
|
|
457
458
|
|
|
458
459
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsvirtualchannelread
|
|
459
|
-
public static WTSVirtualChannelRead(hChannelHandle: HANDLE, TimeOut: ULONG,
|
|
460
|
-
return Wtsapi32.Load('WTSVirtualChannelRead')(hChannelHandle, TimeOut,
|
|
460
|
+
public static WTSVirtualChannelRead(hChannelHandle: HANDLE, TimeOut: ULONG, Buffer_out: PCHAR, BufferSize: ULONG, pBytesRead_out: PULONG): BOOL {
|
|
461
|
+
return Wtsapi32.Load('WTSVirtualChannelRead')(hChannelHandle, TimeOut, Buffer_out, BufferSize, pBytesRead_out);
|
|
461
462
|
}
|
|
462
463
|
|
|
463
464
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtsvirtualchannelwrite
|
|
464
|
-
public static WTSVirtualChannelWrite(hChannelHandle: HANDLE, Buffer: PCHAR, Length: ULONG,
|
|
465
|
-
return Wtsapi32.Load('WTSVirtualChannelWrite')(hChannelHandle, Buffer, Length,
|
|
465
|
+
public static WTSVirtualChannelWrite(hChannelHandle: HANDLE, Buffer: PCHAR, Length: ULONG, pBytesWritten_out: PULONG): BOOL {
|
|
466
|
+
return Wtsapi32.Load('WTSVirtualChannelWrite')(hChannelHandle, Buffer, Length, pBytesWritten_out);
|
|
466
467
|
}
|
|
467
468
|
|
|
468
469
|
// https://learn.microsoft.com/en-us/windows/win32/api/wtsapi32/nf-wtsapi32-wtswaitsystemevent
|
|
469
|
-
public static WTSWaitSystemEvent(hServer: HANDLE, EventMask: DWORD,
|
|
470
|
-
return Wtsapi32.Load('WTSWaitSystemEvent')(hServer, EventMask,
|
|
470
|
+
public static WTSWaitSystemEvent(hServer: HANDLE, EventMask: DWORD, pEventFlags_out: LPDWORD): BOOL {
|
|
471
|
+
return Wtsapi32.Load('WTSWaitSystemEvent')(hServer, EventMask, pEventFlags_out);
|
|
471
472
|
}
|
|
472
473
|
}
|
|
473
474
|
|
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, PBYTE, PHANDLE, PULONG, PVOID, ULONG, USHORT } from '@bun-win32/core';
|
|
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;
|