1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
|
/*
wkssvc interface definitions
*/
import "srvsvc.idl", "lsa.idl";
[ uuid("6bffd098-a112-3610-9833-46c3f87e345a"),
version(1.0),
pointer_default(unique),
pointer_default_top(unique),
helpstring("Workstation Service"),
endpoint("ncacn_np:[\\pipe\\wkssvc]","ncacn_ip_tcp:","ncalrpc:")
] interface wkssvc
{
declare [v1_enum] enum srvsvc_PlatformId;
#define BOOL uint32
/******************/
/* Function: 0x00 */
typedef struct {
srvsvc_PlatformId platform_id;
[string,charset(UTF16)] uint16 *server_name;
[string,charset(UTF16)] uint16 *domain_name;
uint32 version_major;
uint32 version_minor;
} wkssvc_NetWkstaInfo100;
typedef struct {
srvsvc_PlatformId platform_id;
[string,charset(UTF16)] uint16 *server_name;
[string,charset(UTF16)] uint16 *domain_name;
uint32 version_major;
uint32 version_minor;
[string,charset(UTF16)] uint16 *lan_root;
} wkssvc_NetWkstaInfo101;
typedef struct {
srvsvc_PlatformId platform_id;
[string,charset(UTF16)] uint16 *server_name;
[string,charset(UTF16)] uint16 *domain_name;
uint32 version_major;
uint32 version_minor;
[string,charset(UTF16)] uint16 *lan_root;
uint32 logged_on_users;
} wkssvc_NetWkstaInfo102;
typedef struct {
uint32 char_wait;
uint32 collection_time;
uint32 maximum_collection_count;
uint32 keep_connection;
uint32 max_commands;
uint32 session_timeout;
uint32 size_char_buf;
uint32 max_threads;
uint32 lock_quota;
uint32 lock_increment;
uint32 lock_maximum;
uint32 pipe_increment;
uint32 pipe_maximum;
uint32 cache_file_timeout;
uint32 dormant_file_limit;
uint32 read_ahead_throughput;
uint32 num_mailslot_buffers;
uint32 num_srv_announce_buffers;
uint32 max_illegal_dgram_events;
uint32 dgram_event_reset_freq;
BOOL log_election_packets;
BOOL use_opportunistic_locking;
BOOL use_unlock_behind;
BOOL use_close_behind;
BOOL buf_named_pipes;
BOOL use_lock_read_unlock;
BOOL utilize_nt_caching;
BOOL use_raw_read;
BOOL use_raw_write;
BOOL use_write_raw_data;
BOOL use_encryption;
BOOL buf_files_deny_write;
BOOL buf_read_only_files;
BOOL force_core_create_mode;
BOOL use_512_byte_max_transfer;
} wkssvc_NetWkstaInfo502;
typedef struct {
uint32 char_wait;
} wkssvc_NetWkstaInfo1010;
typedef struct {
uint32 collection_time;
} wkssvc_NetWkstaInfo1011;
typedef struct {
uint32 maximum_collection_count;
} wkssvc_NetWkstaInfo1012;
typedef struct {
uint32 keep_connection;
} wkssvc_NetWkstaInfo1013;
typedef struct {
uint32 session_timeout;
} wkssvc_NetWkstaInfo1018;
typedef struct {
uint32 size_char_buf;
} wkssvc_NetWkstaInfo1023;
typedef struct {
uint32 errorlog_sz;
} wkssvc_NetWkstaInfo1027;
typedef struct {
uint32 max_threads;
} wkssvc_NetWkstaInfo1033;
typedef union {
[case(100)] wkssvc_NetWkstaInfo100 *info100;
[case(101)] wkssvc_NetWkstaInfo101 *info101;
[case(102)] wkssvc_NetWkstaInfo102 *info102;
[case(502)] wkssvc_NetWkstaInfo502 *info502;
[case(1010)] wkssvc_NetWkstaInfo1010 *info1010;
[case(1011)] wkssvc_NetWkstaInfo1011 *info1011;
[case(1012)] wkssvc_NetWkstaInfo1012 *info1012;
[case(1013)] wkssvc_NetWkstaInfo1013 *info1013;
[case(1018)] wkssvc_NetWkstaInfo1018 *info1018;
[case(1023)] wkssvc_NetWkstaInfo1023 *info1023;
[case(1027)] wkssvc_NetWkstaInfo1027 *info1027;
[case(1033)] wkssvc_NetWkstaInfo1033 *info1033;
[default] ;
} wkssvc_NetWkstaInfo;
WERROR wkssvc_NetWkstaGetInfo(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] uint32 level,
[out,switch_is(level),ref] wkssvc_NetWkstaInfo *info
);
/******************/
/* Function: 0x01 */
WERROR wkssvc_NetWkstaSetInfo(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] uint32 level,
[in,switch_is(level),ref] wkssvc_NetWkstaInfo *info,
[in,out,ref] uint32 *parm_error
);
/*****************************/
/* Function 0x02 */
typedef struct {
[string,charset(UTF16)] uint16 *user_name;
} wkssvc_NetrWkstaUserInfo0;
typedef struct {
uint32 entries_read;
[size_is(entries_read)] wkssvc_NetrWkstaUserInfo0 *user0;
} wkssvc_NetWkstaEnumUsersCtr0;
typedef struct {
[string,charset(UTF16)] uint16 *user_name;
[string,charset(UTF16)] uint16 *logon_domain;
[string,charset(UTF16)] uint16 *other_domains;
[string,charset(UTF16)] uint16 *logon_server;
} wkssvc_NetrWkstaUserInfo1;
typedef struct {
uint32 entries_read;
[size_is(entries_read)] wkssvc_NetrWkstaUserInfo1 *user1;
} wkssvc_NetWkstaEnumUsersCtr1;
typedef [switch_type(uint32)] union {
[case(0)] wkssvc_NetWkstaEnumUsersCtr0 *user0;
[case(1)] wkssvc_NetWkstaEnumUsersCtr1 *user1;
} wkssvc_NetWkstaEnumUsersCtr;
typedef struct {
uint32 level;
[switch_is(level)] wkssvc_NetWkstaEnumUsersCtr ctr;
} wkssvc_NetWkstaEnumUsersInfo;
WERROR wkssvc_NetWkstaEnumUsers(
[in] [string,charset(UTF16)] uint16 *server_name,
[in,out,ref] wkssvc_NetWkstaEnumUsersInfo *info,
[in] uint32 prefmaxlen,
[out,ref] uint32 *entries_read,
[in,out] uint32 *resume_handle
);
/*****************************/
/* Function 0x03 */
typedef struct {
[string,charset(UTF16)] uint16 *other_domains;
} wkssvc_NetrWkstaUserInfo1101;
typedef [switch_type(uint32)] union {
[case(0)] wkssvc_NetrWkstaUserInfo0 *info0;
[case(1)] wkssvc_NetrWkstaUserInfo1 *info1;
[case(1101)] wkssvc_NetrWkstaUserInfo1101 *info1101;
} wkssvc_NetrWkstaUserInfo;
WERROR wkssvc_NetrWkstaUserGetInfo(
[in] [string,charset(UTF16)] uint16 *unknown,
[in] uint32 level,
[out] [switch_is(level)] [ref] wkssvc_NetrWkstaUserInfo *info
);
/*****************************/
/* Function 0x04 */
WERROR wkssvc_NetrWkstaUserSetInfo(
[in] [string,charset(UTF16)] uint16 *unknown,
[in] uint32 level,
[out] [switch_is(level)] [ref] wkssvc_NetrWkstaUserInfo *info,
[in,out] uint32 *parm_err
);
/*****************************/
/* Function 0x05 */
typedef struct {
uint32 quality_of_service;
uint32 vc_count;
[string,charset(UTF16)] uint16 *name;
[string,charset(UTF16)] uint16 *address;
uint32 wan_link;
} wkssvc_NetWkstaTransportInfo0;
typedef struct {
uint32 count;
[size_is(count)] wkssvc_NetWkstaTransportInfo0 *array;
} wkssvc_NetWkstaTransportCtr0;
typedef union {
[case(0)] wkssvc_NetWkstaTransportCtr0 *ctr0;
} wkssvc_NetWkstaTransportCtr;
typedef struct {
uint32 level;
[switch_is(level)] wkssvc_NetWkstaTransportCtr ctr;
} wkssvc_NetWkstaTransportInfo;
WERROR wkssvc_NetWkstaTransportEnum (
[in] [string,charset(UTF16)] uint16 *server_name,
[in,out,ref] wkssvc_NetWkstaTransportInfo *info,
[in] uint32 max_buffer,
[out,ref] uint32 *total_entries,
[in,out] uint32 *resume_handle
);
/*****************************/
/* Function 0x06 */
/* only supported on NT */
WERROR wkssvc_NetrWkstaTransportAdd(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] uint32 level, /* must be 0 */
[in] [ref] wkssvc_NetWkstaTransportInfo0 *info0,
[in,out] uint32 *parm_err
);
/*****************************/
/* Function 0x07 */
/* only supported on NT */
WERROR wkssvc_NetrWkstaTransportDel(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] [string,charset(UTF16)] uint16 *transport_name,
[in] uint32 unknown3
);
/*****************************/
/* Function 0x08 */
typedef struct {
[string,charset(UTF16)] uint16 *unknown1;
[string,charset(UTF16)] uint16 *unknown2;
} wkssvc_NetrUseInfo3;
typedef struct {
[string,charset(UTF16)] uint16 *local;
[string,charset(UTF16)] uint16 *remote;
[string,charset(UTF16)] uint16 *password;
uint32 status;
uint32 asg_type;
uint32 ref_count;
uint32 use_count;
[string,charset(UTF16)] uint16 *user_name;
[string,charset(UTF16)] uint16 *domain_name;
} wkssvc_NetrUseInfo2;
typedef struct {
[string,charset(UTF16)] uint16 *local;
[string,charset(UTF16)] uint16 *remote;
[string,charset(UTF16)] uint16 *password;
uint32 status;
uint32 asg_type;
uint32 ref_count;
uint32 use_count;
} wkssvc_NetrUseInfo1;
typedef struct {
[string,charset(UTF16)] uint16 *local;
[string,charset(UTF16)] uint16 *remote;
} wkssvc_NetrUseInfo0;
typedef [switch_type(uint32)] union {
[case(0)] wkssvc_NetrUseInfo0 *info0;
[case(1)] wkssvc_NetrUseInfo1 *info1;
[case(2)] wkssvc_NetrUseInfo2 *info2;
[case(3)] wkssvc_NetrUseInfo3 *info3;
} wkssvc_NetrUseGetInfoCtr;
WERROR wkssvc_NetrUseAdd(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] uint32 level,
[in] [switch_is(level)] [ref] wkssvc_NetrUseGetInfoCtr *ctr,
[in,out] uint32 *parm_err
);
/*****************************/
/* Function 0x09 */
WERROR wkssvc_NetrUseGetInfo(
[in] [string,charset(UTF16)] uint16 *server_name,
[in,ref] [string,charset(UTF16)] uint16 *use_name,
[in] uint32 level,
[out] [switch_is(level)] [ref] wkssvc_NetrUseGetInfoCtr *ctr
);
/*****************************/
/* Function 0x0a */
WERROR wkssvc_NetrUseDel(
[in] [string,charset(UTF16)] uint16 *server_name,
[in,ref] [string,charset(UTF16)] uint16 *use_name,
[in] uint32 force_cond
);
/*****************************/
/* Function 0x0b */
typedef struct {
uint32 count;
[size_is(count)] wkssvc_NetrUseInfo2 *array;
} wkssvc_NetrUseEnumCtr2;
typedef struct {
uint32 count;
[size_is(count)] wkssvc_NetrUseInfo1 *array;
} wkssvc_NetrUseEnumCtr1;
typedef struct {
uint32 count;
[size_is(count)] wkssvc_NetrUseInfo0 *array;
} wkssvc_NetrUseEnumCtr0;
typedef [switch_type(uint32)] union {
[case(0)] wkssvc_NetrUseEnumCtr0 *ctr0;
[case(1)] wkssvc_NetrUseEnumCtr1 *ctr1;
[case(2)] wkssvc_NetrUseEnumCtr2 *ctr2;
} wkssvc_NetrUseEnumCtr;
typedef struct {
uint32 level;
[switch_is(level)] wkssvc_NetrUseEnumCtr ctr;
} wkssvc_NetrUseEnumInfo;
WERROR wkssvc_NetrUseEnum(
[in] [string,charset(UTF16)] uint16 *server_name,
[in,out] [ref] wkssvc_NetrUseEnumInfo *info,
[in] uint32 prefmaxlen,
[out,ref] uint32 *entries_read,
[in,out] uint32 *resume_handle
);
/*****************************/
/* Function 0x0c */
WERROR wkssvc_NetrMessageBufferSend(
[in] [string,charset(UTF16)] uint16 *server_name,
[in,ref] [string,charset(UTF16)] uint16 *message_name,
[in] [string,charset(UTF16)] uint16 *message_sender_name,
[in] [size_is(message_size)] [ref] uint8 *message_buffer,
[in] uint32 message_size
);
/*****************************/
/* Function 0x0d */
typedef struct {
hyper unknown1;
hyper unknown2;
hyper unknown3;
hyper unknown4;
hyper unknown5;
hyper unknown6;
hyper unknown7;
hyper unknown8;
hyper unknown9;
hyper unknown10;
hyper unknown11;
hyper unknown12;
hyper unknown13;
uint32 unknown14;
uint32 unknown15;
uint32 unknown16;
uint32 unknown17;
uint32 unknown18;
uint32 unknown19;
uint32 unknown20;
uint32 unknown21;
uint32 unknown22;
uint32 unknown23;
uint32 unknown24;
uint32 unknown25;
uint32 unknown26;
uint32 unknown27;
uint32 unknown28;
uint32 unknown29;
uint32 unknown30;
uint32 unknown31;
uint32 unknown32;
uint32 unknown33;
uint32 unknown34;
uint32 unknown35;
uint32 unknown36;
uint32 unknown37;
uint32 unknown38;
uint32 unknown39;
uint32 unknown40;
} wkssvc_NetrWorkstationStatistics;
WERROR wkssvc_NetrWorkstationStatisticsGet(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] [string,charset(UTF16)] uint16 *unknown2,
[in] uint32 unknown3,
[in] uint32 unknown4,
[out] [ref] wkssvc_NetrWorkstationStatistics **info
);
/*****************************/
/* Function 0x0e */
WERROR wkssvc_NetrLogonDomainNameAdd(
[in,ref] [string,charset(UTF16)] uint16 *domain_name
);
/*****************************/
/* Function 0x0f */
WERROR wkssvc_NetrLogonDomainNameDel(
[in,ref] [string,charset(UTF16)] uint16 *domain_name
);
/*****************************/
/* Function 0x10 */
WERROR WKSSVC_NETRJOINDOMAIN ();
/*****************************/
/* Function 0x11 */
WERROR WKSSVC_NETRUNJOINDOMAIN ();
/*****************************/
/* Function 0x12 */
WERROR WKSSVC_NETRRENAMEMACHINEINDOMAIN ();
/*****************************/
/* Function 0x13 */
typedef enum {
NetSetupUnknown = 0,
NetSetupMachine = 1,
NetSetupWorkgroup = 2,
NetSetupDomain = 3,
NetSetupNonExistentDomain = 4,
NetSetupDnsMachine = 5
} wkssvc_NetValidateNameType;
WERROR wkssvc_NetrValidateName(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] [ref] [string,charset(UTF16)] uint16 *name,
[in] [string,charset(UTF16)] uint16 *Account,
[in] [string,charset(UTF16)] uint16 *Password,
[in] wkssvc_NetValidateNameType name_type
);
/*****************************/
/* Function 0x14 */
WERROR WKSSVC_NETRGETJOININFORMATION ();
/*****************************/
/* Function 0x15 */
WERROR WKSSVC_NETRGETJOINABLEOUS ();
typedef struct {
uint8 data[524];
} wkssvc_PasswordBuffer;
typedef [bitmap32bit] bitmap {
/* TRUE: defer setting the SPN and dNSHostName until a rename operation */
WKSSVC_JOIN_FLAGS_DEFER_SPN = 0x00000100,
/* TRUE: set the machine password to the provided one after the join completes */
WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED = 0x00000080,
/* TRUE: perform an unsecured join */
WKSSVC_JOIN_FLAGS_JOIN_UNSECURE = 0x00000040,
/* TRUE: allow the join to complete even if the account already exists */
WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED = 0x00000020,
/* TRUE: this join is part of a w9x upgrade */
WKSSVC_JOIN_FLAGS_WIN9X_UPGRADE = 0x00000010,
/* TRUE: delete the account when the domain is left */
WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE = 0x00000004,
/* TRUE: create the account in the domain */
WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE = 0x00000002,
/* TRUE: join domain FALSE: join workgroup */
WKSSVC_JOIN_FLAGS_JOIN_TYPE = 0x00000001
} wkssvc_joinflags;
/*****************************/
/* Function 0x16 */
WERROR wkssvc_NetrJoinDomain2 (
[in] [string,charset(UTF16)] uint16 *server_name,
[in] [string,charset(UTF16),ref] uint16 *domain_name,
[in] [string,charset(UTF16)] uint16 *account_name,
[in] [string,charset(UTF16)] uint16 *admin_account,
[in] wkssvc_PasswordBuffer *encrypted_password,
[in] wkssvc_joinflags join_flags
);
/*****************************/
/* Function 0x17 */
WERROR wkssvc_NetrUnjoinDomain2 (
[in] [string,charset(UTF16)] uint16 *server_name,
[in] [string,charset(UTF16)] uint16 *account,
[in] wkssvc_PasswordBuffer *encrypted_password,
[in] wkssvc_joinflags unjoin_flags
);
typedef [bitmap32bit] bitmap {
/* TRUE: create the account in the domain */
WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE = 0x00000002
} wkssvc_renameflags;
/*****************************/
/* Function 0x18 */
WERROR wkssvc_NetrRenameMachineInDomain2(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] [string,charset(UTF16)] uint16 *NewMachineName,
[in] [string,charset(UTF16)] uint16 *Account,
[in] wkssvc_PasswordBuffer *EncryptedPassword,
[in] wkssvc_renameflags RenameOptions
);
/*****************************/
/* Function 0x19 */
WERROR wkssvc_NetrValidateName2(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] [ref] [string,charset(UTF16)] uint16 *name,
[in] [string,charset(UTF16)] uint16 *Account,
[in] wkssvc_PasswordBuffer *EncryptedPassword,
[in] wkssvc_NetValidateNameType name_type
);
/*****************************/
/* Function 0x1a */
WERROR WKSSVC_NETRGETJOINABLEOUS2 ();
/*****************************/
/* Function 0x1b */
WERROR wkssvc_NetrAddAlternateComputerName(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] [string,charset(UTF16)] uint16 *NewAlternateMachineName,
[in] [string,charset(UTF16)] uint16 *Account,
[in] wkssvc_PasswordBuffer *EncryptedPassword,
[in] uint32 Reserved
);
/*****************************/
/* Function 0x1c */
WERROR wkssvc_NetrRemoveAlternateComputerName(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] [string,charset(UTF16)] uint16 *AlternateMachineNameToRemove,
[in] [string,charset(UTF16)] uint16 *Account,
[in] wkssvc_PasswordBuffer *EncryptedPassword,
[in] uint32 Reserved
);
/*****************************/
/* Function 0x1d */
WERROR WKSSVC_NETRSETPRIMARYCOMPUTERNAME ();
/*****************************/
/* Function 0x1e */
typedef enum {
NetPrimaryComputerName = 0,
NetAlternateComputerNames = 1,
NetAllComputerNames = 2,
NetComputerNameTypeMax = 3
} wkssvc_ComputerNameType;
typedef struct {
uint32 count;
[size_is(count)] lsa_String *computer_name;
} wkssvc_ComputerNamesCtr;
WERROR wkssvc_NetrEnumerateComputerNames(
[in] [string,charset(UTF16)] uint16 *server_name,
[in] wkssvc_ComputerNameType name_type,
[in] uint32 Reserved,
[out] [ref] wkssvc_ComputerNamesCtr **ctr
);
}
|