1 /***********************************************************************\
2 *                               lmwksta.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                                                                       *
8 *                       Placed into public domain                       *
9 \***********************************************************************/
10 module win32.lmwksta;
11 pragma(lib, "netapi32.lib");
12 
13 import win32.lmuseflg;
14 private import win32.lmcons, win32.windef;
15 
16 pragma(lib, "Netapi32.lib");
17 
18 enum {
19 	WKSTA_COMPUTERNAME_PARMNUM     = 1,
20 	WKSTA_LANGROUP_PARMNUM,     // = 2
21 	WKSTA_VER_MAJOR_PARMNUM        = 4,
22 	WKSTA_VER_MINOR_PARMNUM,
23 	WKSTA_LOGGED_ON_USERS_PARMNUM,
24 	WKSTA_LANROOT_PARMNUM,
25 	WKSTA_LOGON_DOMAIN_PARMNUM,
26 	WKSTA_LOGON_SERVER_PARMNUM,
27 	WKSTA_CHARWAIT_PARMNUM,
28 	WKSTA_CHARTIME_PARMNUM,
29 	WKSTA_CHARCOUNT_PARMNUM,
30 	WKSTA_KEEPCONN_PARMNUM,
31 	WKSTA_KEEPSEARCH_PARMNUM,
32 	WKSTA_MAXCMDS_PARMNUM,
33 	WKSTA_NUMWORKBUF_PARMNUM,
34 	WKSTA_MAXWRKCACHE_PARMNUM,
35 	WKSTA_SESSTIMEOUT_PARMNUM,
36 	WKSTA_SIZERROR_PARMNUM,
37 	WKSTA_NUMALERTS_PARMNUM,
38 	WKSTA_NUMSERVICES_PARMNUM,
39 	WKSTA_NUMCHARBUF_PARMNUM,
40 	WKSTA_SIZCHARBUF_PARMNUM,     // = 23
41 	WKSTA_ERRLOGSZ_PARMNUM           = 27,
42 	WKSTA_PRINTBUFTIME_PARMNUM,
43 	WKSTA_SIZWORKBUF_PARMNUM,
44 	WKSTA_MAILSLOTS_PARMNUM,
45 	WKSTA_NUMDGRAMBUF_PARMNUM,
46 	WKSTA_WRKHEURISTICS_PARMNUM,
47 	WKSTA_MAXTHREADS_PARMNUM,     // = 33
48 	WKSTA_LOCKQUOTA_PARMNUM          = 41,
49 	WKSTA_LOCKINCREMENT_PARMNUM,
50 	WKSTA_LOCKMAXIMUM_PARMNUM,
51 	WKSTA_PIPEINCREMENT_PARMNUM,
52 	WKSTA_PIPEMAXIMUM_PARMNUM,
53 	WKSTA_DORMANTFILELIMIT_PARMNUM,
54 	WKSTA_CACHEFILETIMEOUT_PARMNUM,
55 	WKSTA_USEOPPORTUNISTICLOCKING_PARMNUM,
56 	WKSTA_USEUNLOCKBEHIND_PARMNUM,
57 	WKSTA_USECLOSEBEHIND_PARMNUM,
58 	WKSTA_BUFFERNAMEDPIPES_PARMNUM,
59 	WKSTA_USELOCKANDREADANDUNLOCK_PARMNUM,
60 	WKSTA_UTILIZENTCACHING_PARMNUM,
61 	WKSTA_USERAWREAD_PARMNUM,
62 	WKSTA_USERAWWRITE_PARMNUM,
63 	WKSTA_USEWRITERAWWITHDATA_PARMNUM,
64 	WKSTA_USEENCRYPTION_PARMNUM,
65 	WKSTA_BUFFILESWITHDENYWRITE_PARMNUM,
66 	WKSTA_BUFFERREADONLYFILES_PARMNUM,
67 	WKSTA_FORCECORECREATEMODE_PARMNUM,
68 	WKSTA_USE512BYTESMAXTRANSFER_PARMNUM,
69 	WKSTA_READAHEADTHRUPUT_PARMNUM,    // = 62
70 	WKSTA_PLATFORM_ID_PARMNUM             = 100,
71 	WKSTA_OTH_DOMAINS_PARMNUM             = 101,
72 	TRANSPORT_QUALITYOFSERVICE_PARMNUM    = 201,
73 	TRANSPORT_NAME_PARMNUM                = 202
74 }
75 
76 struct WKSTA_INFO_100{
77 	DWORD wki100_platform_id;
78 	LPWSTR wki100_computername;
79 	LPWSTR wki100_langroup;
80 	DWORD wki100_ver_major;
81 	DWORD wki100_ver_minor;
82 }
83 alias WKSTA_INFO_100* PWKSTA_INFO_100, LPWKSTA_INFO_100;
84 
85 struct WKSTA_INFO_101{
86 	DWORD wki101_platform_id;
87 	LPWSTR wki101_computername;
88 	LPWSTR wki101_langroup;
89 	DWORD wki101_ver_major;
90 	DWORD wki101_ver_minor;
91 	LPWSTR wki101_lanroot;
92 }
93 alias WKSTA_INFO_101* PWKSTA_INFO_101, LPWKSTA_INFO_101;
94 
95 struct WKSTA_INFO_102{
96 	DWORD wki102_platform_id;
97 	LPWSTR wki102_computername;
98 	LPWSTR wki102_langroup;
99 	DWORD wki102_ver_major;
100 	DWORD wki102_ver_minor;
101 	LPWSTR wki102_lanroot;
102 	DWORD wki102_logged_on_users;
103 }
104 alias WKSTA_INFO_102* PWKSTA_INFO_102, LPWKSTA_INFO_102;
105 
106 struct WKSTA_INFO_302{
107 	DWORD wki302_char_wait;
108 	DWORD wki302_collection_time;
109 	DWORD wki302_maximum_collection_count;
110 	DWORD wki302_keep_conn;
111 	DWORD wki302_keep_search;
112 	DWORD wki302_max_cmds;
113 	DWORD wki302_num_work_buf;
114 	DWORD wki302_siz_work_buf;
115 	DWORD wki302_max_wrk_cache;
116 	DWORD wki302_sess_timeout;
117 	DWORD wki302_siz_error;
118 	DWORD wki302_num_alerts;
119 	DWORD wki302_num_services;
120 	DWORD wki302_errlog_sz;
121 	DWORD wki302_print_buf_time;
122 	DWORD wki302_num_char_buf;
123 	DWORD wki302_siz_char_buf;
124 	LPWSTR wki302_wrk_heuristics;
125 	DWORD wki302_mailslots;
126 	DWORD wki302_num_dgram_buf;
127 }
128 alias WKSTA_INFO_302* PWKSTA_INFO_302, LPWKSTA_INFO_302;
129 
130 struct WKSTA_INFO_402{
131 	DWORD wki402_char_wait;
132 	DWORD wki402_collection_time;
133 	DWORD wki402_maximum_collection_count;
134 	DWORD wki402_keep_conn;
135 	DWORD wki402_keep_search;
136 	DWORD wki402_max_cmds;
137 	DWORD wki402_num_work_buf;
138 	DWORD wki402_siz_work_buf;
139 	DWORD wki402_max_wrk_cache;
140 	DWORD wki402_sess_timeout;
141 	DWORD wki402_siz_error;
142 	DWORD wki402_num_alerts;
143 	DWORD wki402_num_services;
144 	DWORD wki402_errlog_sz;
145 	DWORD wki402_print_buf_time;
146 	DWORD wki402_num_char_buf;
147 	DWORD wki402_siz_char_buf;
148 	LPWSTR wki402_wrk_heuristics;
149 	DWORD wki402_mailslots;
150 	DWORD wki402_num_dgram_buf;
151 	DWORD wki402_max_threads;
152 }
153 alias WKSTA_INFO_402* PWKSTA_INFO_402, LPWKSTA_INFO_402;
154 
155 struct WKSTA_INFO_502{
156 	DWORD wki502_char_wait;
157 	DWORD wki502_collection_time;
158 	DWORD wki502_maximum_collection_count;
159 	DWORD wki502_keep_conn;
160 	DWORD wki502_max_cmds;
161 	DWORD wki502_sess_timeout;
162 	DWORD wki502_siz_char_buf;
163 	DWORD wki502_max_threads;
164 	DWORD wki502_lock_quota;
165 	DWORD wki502_lock_increment;
166 	DWORD wki502_lock_maximum;
167 	DWORD wki502_pipe_increment;
168 	DWORD wki502_pipe_maximum;
169 	DWORD wki502_cache_file_timeout;
170 	DWORD wki502_dormant_file_limit;
171 	DWORD wki502_read_ahead_throughput;
172 	DWORD wki502_num_mailslot_buffers;
173 	DWORD wki502_num_srv_announce_buffers;
174 	DWORD wki502_max_illegal_datagram_events;
175 	DWORD wki502_illegal_datagram_event_reset_frequency;
176 	BOOL wki502_log_election_packets;
177 	BOOL wki502_use_opportunistic_locking;
178 	BOOL wki502_use_unlock_behind;
179 	BOOL wki502_use_close_behind;
180 	BOOL wki502_buf_named_pipes;
181 	BOOL wki502_use_lock_read_unlock;
182 	BOOL wki502_utilize_nt_caching;
183 	BOOL wki502_use_raw_read;
184 	BOOL wki502_use_raw_write;
185 	BOOL wki502_use_write_raw_data;
186 	BOOL wki502_use_encryption;
187 	BOOL wki502_buf_files_deny_write;
188 	BOOL wki502_buf_read_only_files;
189 	BOOL wki502_force_core_create_mode;
190 	BOOL wki502_use_512_byte_max_transfer;
191 }
192 alias WKSTA_INFO_502* PWKSTA_INFO_502, LPWKSTA_INFO_502;
193 
194 struct WKSTA_INFO_1010 {
195 	DWORD wki1010_char_wait;
196 }
197 alias WKSTA_INFO_1010* PWKSTA_INFO_1010, LPWKSTA_INFO_1010;
198 
199 struct WKSTA_INFO_1011 {
200 	DWORD wki1011_collection_time;
201 }
202 alias WKSTA_INFO_1011* PWKSTA_INFO_1011, LPWKSTA_INFO_1011;
203 
204 struct WKSTA_INFO_1012 {
205 	DWORD wki1012_maximum_collection_count;
206 }
207 alias WKSTA_INFO_1012* PWKSTA_INFO_1012, LPWKSTA_INFO_1012;
208 
209 struct WKSTA_INFO_1027 {
210 	DWORD wki1027_errlog_sz;
211 }
212 alias WKSTA_INFO_1027* PWKSTA_INFO_1027, LPWKSTA_INFO_1027;
213 
214 struct WKSTA_INFO_1028 {
215 	DWORD wki1028_print_buf_time;
216 }
217 alias WKSTA_INFO_1028* PWKSTA_INFO_1028, LPWKSTA_INFO_1028;
218 
219 struct WKSTA_INFO_1032 {
220 	DWORD wki1032_wrk_heuristics;
221 }
222 alias WKSTA_INFO_1032* PWKSTA_INFO_1032, LPWKSTA_INFO_1032;
223 
224 struct WKSTA_INFO_1013 {
225 	DWORD wki1013_keep_conn;
226 }
227 alias WKSTA_INFO_1013* PWKSTA_INFO_1013, LPWKSTA_INFO_1013;
228 
229 struct WKSTA_INFO_1018 {
230 	DWORD wki1018_sess_timeout;
231 }
232 alias WKSTA_INFO_1018* PWKSTA_INFO_1018, LPWKSTA_INFO_1018;
233 
234 struct WKSTA_INFO_1023 {
235 	DWORD wki1023_siz_char_buf;
236 }
237 alias WKSTA_INFO_1023* PWKSTA_INFO_1023, LPWKSTA_INFO_1023;
238 
239 struct WKSTA_INFO_1033 {
240 	DWORD wki1033_max_threads;
241 }
242 alias WKSTA_INFO_1033* PWKSTA_INFO_1033, LPWKSTA_INFO_1033;
243 
244 struct WKSTA_INFO_1041 {
245 	DWORD wki1041_lock_quota;
246 }
247 alias WKSTA_INFO_1041* PWKSTA_INFO_1041, LPWKSTA_INFO_1041;
248 
249 struct WKSTA_INFO_1042 {
250 	DWORD wki1042_lock_increment;
251 }
252 alias WKSTA_INFO_1042* PWKSTA_INFO_1042, LPWKSTA_INFO_1042;
253 
254 struct WKSTA_INFO_1043 {
255 	DWORD wki1043_lock_maximum;
256 }
257 alias WKSTA_INFO_1043* PWKSTA_INFO_1043, LPWKSTA_INFO_1043;
258 
259 struct WKSTA_INFO_1044 {
260 	DWORD wki1044_pipe_increment;
261 }
262 alias WKSTA_INFO_1044* PWKSTA_INFO_1044, LPWKSTA_INFO_1044;
263 
264 struct WKSTA_INFO_1045 {
265 	DWORD wki1045_pipe_maximum;
266 }
267 alias WKSTA_INFO_1045* PWKSTA_INFO_1045, LPWKSTA_INFO_1045;
268 
269 struct WKSTA_INFO_1046 {
270 	DWORD wki1046_dormant_file_limit;
271 }
272 alias WKSTA_INFO_1046* PWKSTA_INFO_1046, LPWKSTA_INFO_1046;
273 
274 struct WKSTA_INFO_1047 {
275 	DWORD wki1047_cache_file_timeout;
276 }
277 alias WKSTA_INFO_1047* PWKSTA_INFO_1047, LPWKSTA_INFO_1047;
278 
279 struct WKSTA_INFO_1048 {
280 	BOOL wki1048_use_opportunistic_locking;
281 }
282 alias WKSTA_INFO_1048* PWKSTA_INFO_1048, LPWKSTA_INFO_1048;
283 
284 struct WKSTA_INFO_1049 {
285 	BOOL wki1049_use_unlock_behind;
286 }
287 alias WKSTA_INFO_1049* PWKSTA_INFO_1049, LPWKSTA_INFO_1049;
288 
289 struct WKSTA_INFO_1050 {
290 	BOOL wki1050_use_close_behind;
291 }
292 alias WKSTA_INFO_1050* PWKSTA_INFO_1050, LPWKSTA_INFO_1050;
293 
294 struct WKSTA_INFO_1051 {
295 	BOOL wki1051_buf_named_pipes;
296 }
297 alias WKSTA_INFO_1051* PWKSTA_INFO_1051, LPWKSTA_INFO_1051;
298 
299 struct WKSTA_INFO_1052 {
300 	BOOL wki1052_use_lock_read_unlock;
301 }
302 alias WKSTA_INFO_1052* PWKSTA_INFO_1052, LPWKSTA_INFO_1052;
303 
304 struct WKSTA_INFO_1053 {
305 	BOOL wki1053_utilize_nt_caching;
306 }
307 alias WKSTA_INFO_1053* PWKSTA_INFO_1053, LPWKSTA_INFO_1053;
308 
309 struct WKSTA_INFO_1054 {
310 	BOOL wki1054_use_raw_read;
311 }
312 alias WKSTA_INFO_1054* PWKSTA_INFO_1054, LPWKSTA_INFO_1054;
313 
314 struct WKSTA_INFO_1055 {
315 	BOOL wki1055_use_raw_write;
316 }
317 alias WKSTA_INFO_1055* PWKSTA_INFO_1055, LPWKSTA_INFO_1055;
318 
319 struct WKSTA_INFO_1056 {
320 	BOOL wki1056_use_write_raw_data;
321 }
322 alias WKSTA_INFO_1056* PWKSTA_INFO_1056, LPWKSTA_INFO_1056;
323 
324 struct WKSTA_INFO_1057 {
325 	BOOL wki1057_use_encryption;
326 }
327 alias WKSTA_INFO_1057* PWKSTA_INFO_1057, LPWKSTA_INFO_1057;
328 
329 struct WKSTA_INFO_1058 {
330 	BOOL wki1058_buf_files_deny_write;
331 }
332 alias WKSTA_INFO_1058* PWKSTA_INFO_1058, LPWKSTA_INFO_1058;
333 
334 struct WKSTA_INFO_1059 {
335 	BOOL wki1059_buf_read_only_files;
336 }
337 alias WKSTA_INFO_1059* PWKSTA_INFO_1059, LPWKSTA_INFO_1059;
338 
339 struct WKSTA_INFO_1060 {
340 	BOOL wki1060_force_core_create_mode;
341 }
342 alias WKSTA_INFO_1060* PWKSTA_INFO_1060, LPWKSTA_INFO_1060;
343 
344 struct WKSTA_INFO_1061 {
345 	BOOL wki1061_use_512_byte_max_transfer;
346 }
347 alias WKSTA_INFO_1061* PWKSTA_INFO_1061, LPWKSTA_INFO_1061;
348 
349 struct WKSTA_INFO_1062 {
350 	DWORD wki1062_read_ahead_throughput;
351 }
352 alias WKSTA_INFO_1062* PWKSTA_INFO_1062, LPWKSTA_INFO_1062;
353 
354 struct WKSTA_USER_INFO_0 {
355 	LPWSTR wkui0_username;
356 }
357 alias WKSTA_USER_INFO_0* PWKSTA_USER_INFO_0, LPWKSTA_USER_INFO_0;
358 
359 struct WKSTA_USER_INFO_1{
360 	LPWSTR wkui1_username;
361 	LPWSTR wkui1_logon_domain;
362 	LPWSTR wkui1_oth_domains;
363 	LPWSTR wkui1_logon_server;
364 }
365 alias WKSTA_USER_INFO_1* PWKSTA_USER_INFO_1, LPWKSTA_USER_INFO_1;
366 
367 struct WKSTA_USER_INFO_1101 {
368 	LPWSTR wkui1101_oth_domains;
369 }
370 alias WKSTA_USER_INFO_1101* PWKSTA_USER_INFO_1101, LPWKSTA_USER_INFO_1101;
371 
372 struct WKSTA_TRANSPORT_INFO_0{
373 	DWORD wkti0_quality_of_service;
374 	DWORD wkti0_number_of_vcs;
375 	LPWSTR wkti0_transport_name;
376 	LPWSTR wkti0_transport_address;
377 	BOOL wkti0_wan_ish;
378 }
379 alias WKSTA_TRANSPORT_INFO_0* PWKSTA_TRANSPORT_INFO_0, LPWKSTA_TRANSPORT_INFO_0;
380 
381 extern (Windows) {
382 NET_API_STATUS NetWkstaGetInfo(LPWSTR,DWORD,PBYTE*);
383 NET_API_STATUS NetWkstaSetInfo(LPWSTR,DWORD,PBYTE,PDWORD);
384 NET_API_STATUS NetWkstaUserGetInfo(LPWSTR,DWORD,PBYTE*);
385 NET_API_STATUS NetWkstaUserSetInfo(LPWSTR,DWORD,PBYTE,PDWORD);
386 NET_API_STATUS NetWkstaUserEnum(LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD);
387 NET_API_STATUS NetWkstaTransportAdd(LPWSTR,DWORD,PBYTE,PDWORD);
388 NET_API_STATUS NetWkstaTransportDel(LPWSTR,LPWSTR,DWORD);
389 NET_API_STATUS NetWkstaTransportEnum(LPWSTR,DWORD,PBYTE*,DWORD,PDWORD,PDWORD,PDWORD);
390 }