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
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
|
module srvsvc
#define BOOL uint32
#define LONG uint32
#define DWORD uint32
#define STATUS uint32
typedef struct _UNISTR2 {
uint32 max_len;
uint32 undoc;
uint32 str_len;
wchar buffer[str_len];
} UNISTR2;
struct LPWSTR {
UNISTR2 *str;
};
/* -- CHARACTER DEVICE INFORMATION -- */
typedef struct _CHARDEV_INFO_0 {
LPWSTR pszName;
} CHARDEV_INFO_0;
typedef struct _CHARDEV_INFO_1 {
LPWSTR pszName;
DWORD dwStatus;
LPWSTR pszUser;
DWORD dwTime;
} CHARDEV_INFO_1;
typedef union _CHARDEV_INFO switch (DWORD dwLevel) ctr {
case 1: CHARDEV_INFO_0 *ci0;
case 2: CHARDEV_INFO_1 *ci1;
} CHARDEV_INFO;
typedef struct _CHARDEV_ENUM_0 {
DWORD dwEntries;
[size_is(dwEntries)] CHARDEV_INFO_0 *ci0;
} CHARDEV_ENUM_0;
typedef struct _CHARDEV_ENUM_1 {
DWORD dwEntries;
[size_is(dwEntries)] CHARDEV_INFO_1 *ci1;
} CHARDEV_ENUM_1;
typedef struct _CHARDEV_ENUM {
DWORD dwLevel;
[switch_is(dwLevel)] union {
[case(0)] CHARDEV_ENUM_0 *ce0;
[case(1)] CHARDEV_ENUM_1 *ce1;
} ctr;
} CHARDEV_ENUM;
STATUS NetrCharDevEnum( /* Function 0x00 */
[in,unique] LPWSTR pszServer,
[in,out] CHARDEV_ENUM* pCharDevEnum,
[in] DWORD dwMaxLen,
[out] DWORD* dwEntries,
[in,out] DWORD* hResume
);
STATUS NetrCharDevGetInfo( /* Function 0x01 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszDevice,
[in] DWORD dwLevel,
[out] CHARDEV_INFO* pCharDevInfo
);
STATUS NetrCharDevControl( /* Function 0x02 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszDevice,
[in] DWORD dwOpcode
);
/* -- CHARACTER DEVICE QUEUE INFORMATION -- */
typedef struct _CHARDEVQ_INFO_0 {
LPWSTR pszName;
} CHARDEVQ_INFO_0;
typedef struct _CHARDEVQ_INFO_1 {
LPWSTR pszName;
DWORD dwPriority;
LPWSTR pszDevices;
DWORD dwNumUsers;
DWORD dwNumAhead;
} CHARDEVQ_INFO_1;
typedef union _CHARDEVQ_INFO switch (DWORD dwLevel) ctr {
case 1: CHARDEVQ_INFO_0 *ci0;
case 2: CHARDEVQ_INFO_1 *ci1;
} CHARDEVQ_INFO;
typedef struct _CHARDEVQ_ENUM_0 {
DWORD dwEntries;
[size_is(dwEntries)] CHARDEVQ_INFO_0 *ci0;
} CHARDEVQ_ENUM_0;
typedef struct _CHARDEVQ_ENUM_1 {
DWORD dwEntries;
[size_is(dwEntries)] CHARDEVQ_INFO_1 *ci1;
} CHARDEVQ_ENUM_1;
typedef struct _CHARDEVQ_ENUM {
DWORD dwLevel;
[switch_is(dwLevel)] union {
[case(0)] CHARDEVQ_ENUM_0 *ce0;
[case(1)] CHARDEVQ_ENUM_1 *ce1;
} ctr;
} CHARDEVQ_ENUM;
STATUS NetrCharDevQEnum( /* Function 0x03 */
[in,unique] LPWSTR pszServer,
[in,unique] LPWSTR pszUser,
[in,out] CHARDEVQ_ENUM* pCharDevQEnum,
[in] DWORD dwMaxLen,
[out] DWORD* dwEntries,
[in,out] DWORD* hResume
);
STATUS NetrCharDevQGetInfo( /* Function 0x04 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszQueue,
[in,ref] LPWSTR pszUser,
[in] DWORD dwLevel,
[out] CHARDEVQ_INFO* pCharDevQInfo
);
STATUS NetrCharDevQSetInfo( /* Function 0x05 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszQueue,
[in] DWORD dwLevel,
[in] CHARDEVQ_INFO* pCharDevQInfo,
[in,out] DWORD* dwParmError
);
STATUS NetrCharDevQPurge( /* Function 0x06 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszQueue
);
STATUS NetrCharDevQPurgeSelf( /* Function 0x07 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszQueue,
[in,ref] LPWSTR pszComputer
);
/* -- CONNECTION INFORMATION -- */
typedef struct _CONNECTION_INFO_0 {
DWORD dwConnID;
} CONNECTION_INFO_0;
typedef struct _CONNECTION_INFO_1 {
DWORD dwConnID;
DWORD dwType;
DWORD dwNumOpens;
DWORD dwNumUsers;
DWORD dwTime;
LPWSTR pszUser;
LPWSTR pszShare;
} CONNECTION_INFO_1;
typedef struct _CONNECTION_ENUM_0 {
DWORD dwEntries;
[size_is(dwEntries)] CONNECTION_INFO_0 *ci0;
} CONNECTION_ENUM_0;
typedef struct _CONNECTION_ENUM_1 {
DWORD dwEntries;
[size_is(dwEntries)] CONNECTION_INFO_1 *ci1;
} CONNECTION_ENUM_1;
typedef struct _CONNECTION_ENUM {
DWORD dwLevel;
[switch_is(dwLevel)] union {
[case(0)] CONNECTION_ENUM_0 *ce0;
[case(1)] CONNECTION_ENUM_1 *ce1;
} ctr;
} CONNECTION_ENUM;
STATUS NetrConnectionEnum( /* Function 0x08 */
[in,unique] LPWSTR pszServer,
[in,unique] LPWSTR pszClient,
[in,out] CONNECTION_ENUM* pConnectionEnum,
[in] DWORD dwMaxLen,
[out] DWORD* dwEntries,
[in,out] DWORD* hResume
);
/* -- FILE INFORMATION -- */
typedef struct _FILE_INFO_2 {
DWORD dwFileID;
} FILE_INFO_2;
typedef struct _FILE_INFO_3 {
DWORD dwFileID;
DWORD dwPermissions;
DWORD dwNumLocks;
LPWSTR pszPath;
LPWSTR pszUser;
} FILE_INFO_3;
typedef union _FILE_INFO switch (DWORD dwLevel) ctr {
case 2: FILE_INFO_2 *fi2;
case 3: FILE_INFO_3 *fi3;
} FILE_INFO;
typedef struct _FILE_ENUM_2 {
DWORD dwEntries;
[size_is(dwEntries)] FILE_INFO_2 *fi2;
} FILE_ENUM_2;
typedef struct _FILE_ENUM_3 {
DWORD dwEntries;
[size_is(dwEntries)] FILE_INFO_3 *fi3;
} FILE_ENUM_3;
typedef struct _FILE_ENUM {
DWORD dwLevel;
[switch_is(dwLevel)] union {
[case(2)] FILE_ENUM_2 *fe2;
[case(3)] FILE_ENUM_3 *fe3;
} ctr;
} FILE_ENUM;
STATUS NetrFileEnum( /* Function 0x09 */
[in,unique] LPWSTR pszServer,
[in,unique] LPWSTR pszBasePath,
[in,unique] LPWSTR pszUser,
[in,out] FILE_ENUM* pFileEnum,
[in] DWORD dwMaxLen,
[out] DWORD* dwEntries,
[in,out] DWORD* hResume
);
STATUS NetrFileGetInfo( /* Function 0x0A */
[in,unique] LPWSTR pszServer,
[in] DWORD dwFileID,
[in] DWORD dwLevel,
[out] FILE_INFO* pFileInfo
);
STATUS NetrFileClose( /* Function 0x0B */
[in,unique] LPWSTR pszServer,
[in] DWORD dwFileID
);
/* -- SESSION INFORMATION -- */
typedef struct _SESSION_INFO_0 {
LPWSTR pszClient;
} SESSION_INFO_0;
typedef struct _SESSION_INFO_1 {
LPWSTR pszClient;
LPWSTR pszUser;
DWORD dwOpens;
DWORD dwTime;
DWORD dwIdleTime;
DWORD dwUserFlags;
} SESSION_INFO_1;
typedef struct _SESSION_INFO_2 {
LPWSTR pszClient;
LPWSTR pszUser;
DWORD dwOpens;
DWORD dwTime;
DWORD dwIdleTime;
DWORD dwUserFlags;
LPWSTR pszClientType;
} SESSION_INFO_2;
typedef struct _SESSION_ENUM_0 {
DWORD dwEntries;
[size_is(dwEntries)] SESSION_INFO_0 *si0;
} SESSION_ENUM_0;
typedef struct _SESSION_ENUM_1 {
DWORD dwEntries;
[size_is(dwEntries)] SESSION_INFO_1 *si1;
} SESSION_ENUM_1;
typedef struct _SESSION_ENUM_2 {
DWORD dwEntries;
[size_is(dwEntries)] SESSION_INFO_2 *si2;
} SESSION_ENUM_2;
typedef struct _SESSION_ENUM {
DWORD dwLevel;
[switch_is(dwLevel)] union {
[case(0)] SESSION_ENUM_0 *se0;
[case(1)] SESSION_ENUM_1 *se1;
[case(2)] SESSION_ENUM_2 *se2;
} ctr;
} SESSION_ENUM;
STATUS NetrSessionEnum( /* Function 0x0C */
[in,unique] LPWSTR pszServer,
[in,unique] LPWSTR pszClient,
[in,unique] LPWSTR pszUser,
[in,out] SESSION_ENUM* pFileEnum,
[in] DWORD dwMaxLen,
[out] DWORD* dwEntries,
[in,out] DWORD* hResume
);
STATUS NetrSessionDel( /* Function 0x0D */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszClient,
[in,ref] LPWSTR pszUser
);
/* -- SHARE INFORMATION -- */
typedef struct _SHARE_INFO_0 {
LPWSTR pszName;
} SHARE_INFO_0;
typedef struct _SHARE_INFO_1 {
LPWSTR pszName;
DWORD dwType;
LPWSTR pszComment;
} SHARE_INFO_1;
typedef struct _SHARE_INFO_2 {
LPWSTR pszName;
DWORD dwType;
LPWSTR pszComment;
DWORD dwPermissions;
DWORD dwMaxUses;
DWORD dwCurrentUses;
LPWSTR pszPath;
LPWSTR pszPasswd;
} SHARE_INFO_2;
typedef union _SHARE_INFO switch (DWORD dwLevel) ctr {
case 0: SHARE_INFO_0 *si0;
case 1: SHARE_INFO_1 *si1;
case 2: SHARE_INFO_2 *si2;
} SHARE_INFO;
typedef struct _SHARE_ENUM_0 {
DWORD dwEntries;
[size_is(dwEntries)] SHARE_INFO_0 *si0;
} SHARE_ENUM_0;
typedef struct _SHARE_ENUM_1 {
DWORD dwEntries;
[size_is(dwEntries)] SHARE_INFO_1 *si1;
} SHARE_ENUM_1;
typedef struct _SHARE_ENUM_2 {
DWORD dwEntries;
[size_is(dwEntries)] SHARE_INFO_2 *si2;
} SHARE_ENUM_2;
typedef struct _SHARE_ENUM {
DWORD dwLevel;
[switch_is(dwLevel)] union {
[case(0)] SHARE_ENUM_0 *se0;
[case(1)] SHARE_ENUM_1 *se1;
[case(2)] SHARE_ENUM_2 *se2;
} ctr;
} SHARE_ENUM;
STATUS NetrShareAdd( /* Function 0x0E */
[in,unique] LPWSTR pszServer,
[in] DWORD dwLevel,
[out] SHARE_INFO* pShareInfo,
[in,out] DWORD* dwParmError
);
STATUS NetrShareEnum( /* Function 0x0F */
[in,unique] LPWSTR pszServer,
[in,out] SHARE_ENUM* pShareEnum,
[in] DWORD dwMaxLen,
[out] DWORD* dwEntries,
[in,out] DWORD* hResume
);
STATUS NetrShareGetInfo( /* Function 0x10 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszShare,
[in] DWORD dwLevel,
[out] SHARE_INFO* pShareInfo
);
STATUS NetrShareSetInfo( /* Function 0x11 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszShare,
[in] DWORD dwLevel,
[in] SHARE_INFO* pShareInfo,
[in] DWORD dwReserved
);
STATUS NetrShareDel( /* Function 0x12 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszShare,
[in] DWORD dwReserved
);
STATUS NetrShareDelSticky( /* Function 0x13 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszShare,
[in] DWORD dwReserved
);
STATUS NetrShareCheck( /* Function 0x14 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszDevice,
[out] DWORD* dwType
);
/* --- SERVER INFORMATION --- */
typedef struct _SERVER_INFO_100 {
DWORD dwPlatformID;
LPWSTR pszName;
} SERVER_INFO_100;
typedef struct _SERVER_INFO_101 {
DWORD dwPlatformID;
LPWSTR pszName;
DWORD dwVerMajor;
DWORD dwVerMinor;
DWORD dwType;
LPWSTR pszComment;
} SERVER_INFO_101;
typedef struct _SERVER_INFO_102 {
DWORD dwPlatformID;
LPWSTR pszName;
DWORD dwVerMajor;
DWORD dwVerMinor;
DWORD dwType;
LPWSTR pszComment;
DWORD dwUsers;
LONG lDisc;
BOOL bHidden;
DWORD dwAnnounce;
DWORD dwAnnDelta;
DWORD dwLicenses;
LPWSTR pszUserPath;
} SERVER_INFO_102;
typedef union _SERVER_INFO switch (DWORD dwLevel) ctr {
case 100: SERVER_INFO_100 *sv100;
case 101: SERVER_INFO_101 *sv101;
case 102: SERVER_INFO_102 *sv102;
} SERVER_INFO;
STATUS NetrServerGetInfo( /* Function 0x15 */
[in,unique] LPWSTR pszServerName,
[in] DWORD dwLevel,
[out] SERVER_INFO* pServerInfo
);
STATUS NetrServerSetInfo( /* Function 0x16 */
[in,unique] LPWSTR pszServerName,
[in] DWORD dwLevel,
[in] SERVER_INFO* pServerInfo,
[in] DWORD dwReserved
);
typedef struct _DISK_INFO {
LPWSTR pszName;
} DISK_INFO;
typedef struct _DISK_ENUM {
DWORD dwEntries;
[size_is(dwEntries)] DISK_INFO *di;
} DISK_ENUM;
STATUS NetrServerDiskEnum( /* Function 0x17 */
[in,unique] LPWSTR pszServer,
[in] DWORD dwLevel,
[in,out] DISK_ENUM* pDiskEnum,
[in] DWORD dwMaxLen,
[out] DWORD* dwEntries,
[in,out] DWORD* hResume
);
typedef struct _STAT_SERVER {
DWORD dwStart;
DWORD dwFOpens;
DWORD dwDevOpens;
DWORD dwJobsQueued;
DWORD dwSOpens;
DWORD dwSTimedOut;
DWORD dwSErrors;
DWORD dwPWErrors;
DWORD dwPermErrors;
DWORD dwSysErrors;
DWORD dwBytesSentLow;
DWORD dwBytesSentHigh;
DWORD dwBytesRcvdLow;
DWORD dwBytesRcvdHigh;
DWORD dwAVResponse;
DWORD dwReqBufNeed;
DWORD dwBigBufNeed;
} STAT_SERVER;
STATUS NetrServerStatisticsGet( /* Function 0x18 */
[in,unique] LPWSTR pszServer,
[in] DWORD dwLevel,
[in] DWORD dwOptions,
[out] STAT_SERVER* pStatServer
);
typedef struct _TRANSPORT_INFO_0 {
LPWSTR pszName;
} TRANSPORT_INFO_0;
typedef union _TRANSPORT_INFO switch (DWORD dwLevel) ctr {
case 0: TRANSPORT_INFO_0 *ti0;
} TRANSPORT_INFO;
typedef struct _TRANSPORT_ENUM_0 {
DWORD dwEntries;
[size_is(dwEntries)] TRANSPORT_INFO_0 *ti0;
} TRANSPORT_ENUM_0;
typedef struct _TRANSPORT_ENUM {
DWORD dwLevel;
[switch_is(dwLevel)] union {
[case(0)] TRANSPORT_ENUM_0 *te0;
} ctr;
} TRANSPORT_ENUM;
STATUS NetrServerTransportAdd( /* Function 0x19 */
[in,unique] LPWSTR pszServer,
[in] DWORD dwLevel,
[out] TRANSPORT_INFO* pTransportInfo
);
STATUS NetrServerTransportEnum( /* Function 0x1a */
[in,unique] LPWSTR pszServer,
[in,out] TRANSPORT_ENUM* pTransportEnum,
[in] DWORD dwMaxLen,
[out] DWORD* dwEntries,
[in,out] DWORD* hResume
);
STATUS NetrServerTransportDel( /* Function 0x1b */
[in,unique] LPWSTR pszServer,
[in] DWORD dwLevel,
[out] TRANSPORT_INFO* pTransportInfo
);
typedef struct _TIME_OF_DAY {
DWORD dwElapsedTime;
DWORD dwMsecs;
DWORD dwHours;
DWORD dwMins;
DWORD dwSecs;
DWORD dwHunds;
LONG lTimeZone;
DWORD dwInterval;
DWORD dwDay;
DWORD dwMonth;
DWORD dwYear;
DWORD dwWeekday;
} TIME_OF_DAY;
STATUS NetrRemoteTOD( /* Function 0x1c */
[in,unique] LPWSTR pszServer,
[out] TIME_OF_DAY* pTOD
);
STATUS NetrServerSetServiceBits( /* Function 0x1d */
[in,unique] LPWSTR pszServer,
[in] DWORD hServiceStatus, /* ?? */
[in] DWORD dwServiceBits,
[in] BOOL bSetBitsOn,
[in] BOOL bUpdateImmediately
);
/* --- PATH INFORMATION --- */
STATUS NetprPathType( /* Function 0x1e */
void /* Not known */
);
STATUS NetprPathCanonicalize( /* Function 0x1f */
void /* Not known */
);
STATUS NetprPathCompare( /* Function 0x20 */
void /* Not known */
);
STATUS NetprNameValidate( /* Function 0x21 */
void /* Not known */
);
STATUS NetprNameCanonicalize( /* Function 0x22 */
void /* Not known */
);
STATUS NetprNameCompare( /* Function 0x23 */
void /* Not known */
);
/* --- LATER ADDITIONS --- */
STATUS NetrShareEnumSticky( /* Function 0x24 */
[in,unique] LPWSTR pszServer,
[in,out] SHARE_ENUM* pShareEnum,
[in] DWORD dwMaxLen,
[out] DWORD* dwEntries,
[in,out] DWORD* hResume
);
STATUS NetrShareDelStart( /* Function 0x25 */
[in,unique] LPWSTR pszServer,
[in,ref] LPWSTR pszShare,
[in] DWORD dwReserved /* ? */
);
STATUS NetrShareDelCommit( /* Function 0x26 */
[in,unique] LPWSTR pszServer
);
STATUS NetrpGetFileSecurity( /* Function 0x27 */
void /* Not known */
);
STATUS NetrpSetFileSecurity( /* Function 0x28 */
void /* Not known */
);
STATUS NetrServerTransportAddEx( /* Function 0x29 */
[in,unique] LPWSTR pszServer,
[in] DWORD dwLevel,
[out] TRANSPORT_INFO* pTransportInfo
);
STATUS NetrServerSetServiceBitsEx( /* Function 0x30 */
[in,unique] LPWSTR pszServer,
[in] DWORD hServiceStatus, /* ?? */
[in] DWORD dwServiceBits,
[in] BOOL bSetBitsOn,
[in] BOOL bUpdateImmediately
);
|