import HEAD into svn+ssh://svn.samba.org/home/svn/samba/trunk
[metze/old/v3-2-winbind-ndr.git] / source / include / rpc_srvsvc.h
1 /*
2    Unix SMB/CIFS implementation.
3    SMB parameters and setup
4    Copyright (C) Andrew Tridgell 1992-1997
5    Copyright (C) Luke Kenneth Casson Leighton 1996-1997
6    Copyright (C) Paul Ashton 1997
7    Copyright (C) Nigel Williams 2001
8    
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13    
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18    
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software
21    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 #ifndef _RPC_SRVSVC_H /* _RPC_SRVSVC_H */
25 #define _RPC_SRVSVC_H 
26
27 /* srvsvc pipe */
28 #define SRV_NET_CONN_ENUM          0x08
29 #define SRV_NET_FILE_ENUM          0x09
30 #define SRV_NET_FILE_CLOSE         0x0b
31 #define SRV_NET_SESS_ENUM          0x0c
32 #define SRV_NET_SHARE_ADD          0x0e
33 #define SRV_NET_SHARE_ENUM_ALL     0x0f
34 #define SRV_NET_SHARE_GET_INFO     0x10
35 #define SRV_NET_SHARE_SET_INFO     0x11
36 #define SRV_NET_SHARE_DEL          0x12
37 #define SRV_NET_SHARE_DEL_STICKY   0x13
38 #define SRV_NET_SRV_GET_INFO       0x15
39 #define SRV_NET_SRV_SET_INFO       0x16
40 #define SRV_NET_DISK_ENUM          0x17
41 #define SRV_NET_REMOTE_TOD         0x1c
42 #define SRV_NET_NAME_VALIDATE      0x21
43 #define SRV_NET_SHARE_ENUM         0x24
44 #define SRV_NET_FILE_QUERY_SECDESC 0x27
45 #define SRV_NET_FILE_SET_SECDESC   0x28
46
47 #define MAX_SERVER_DISK_ENTRIES 15
48
49 typedef struct disk_info {
50         uint32  unknown;
51         UNISTR3 disk_name;
52 } DISK_INFO;
53
54 typedef struct disk_enum_container {
55         uint32 level;
56         uint32 entries_read;
57         uint32 unknown;
58         uint32 disk_info_ptr;
59         DISK_INFO *disk_info;
60 } DISK_ENUM_CONTAINER;
61
62 typedef struct net_srv_disk_enum {
63         uint32 ptr_srv_name;         /* pointer (to server name?) */
64         UNISTR2 uni_srv_name;        /* server name */
65
66         DISK_ENUM_CONTAINER disk_enum_ctr;
67
68         uint32 preferred_len;        /* preferred maximum length (0xffff ffff) */
69         uint32 total_entries;        /* total number of entries */
70         ENUM_HND enum_hnd;
71         WERROR status;               /* return status */
72 } SRV_Q_NET_DISK_ENUM, SRV_R_NET_DISK_ENUM;
73
74 typedef struct net_name_validate {
75         uint32 ptr_srv_name;
76         UNISTR2 uni_srv_name;
77         UNISTR2 uni_name; /*name to validate*/
78         uint32 type;
79         uint32 flags;
80         WERROR status;
81 } SRV_Q_NET_NAME_VALIDATE, SRV_R_NET_NAME_VALIDATE;
82
83 /* SESS_INFO_0 (pointers to level 0 session info strings) */
84 typedef struct ptr_sess_info0
85 {
86         uint32 ptr_name; /* pointer to name. */
87
88 } SESS_INFO_0;
89
90 /* SESS_INFO_0_STR (level 0 session info strings) */
91 typedef struct str_sess_info0
92 {
93         UNISTR2 uni_name; /* unicode string of name */
94
95 } SESS_INFO_0_STR;
96
97 /* oops - this is going to take up a *massive* amount of stack. */
98 /* the UNISTR2s already have 1024 uint16 chars in them... */
99 #define MAX_SESS_ENTRIES 32
100
101 /* SRV_SESS_INFO_0 */
102 typedef struct srv_sess_info_0_info
103 {
104         uint32 num_entries_read;                     /* EntriesRead */
105         uint32 ptr_sess_info;                       /* Buffer */
106         uint32 num_entries_read2;                    /* EntriesRead */
107
108         SESS_INFO_0     info_0    [MAX_SESS_ENTRIES]; /* session entry pointers */
109         SESS_INFO_0_STR info_0_str[MAX_SESS_ENTRIES]; /* session entry strings */
110
111 } SRV_SESS_INFO_0;
112
113 /* SESS_INFO_1 (pointers to level 1 session info strings) */
114 typedef struct ptr_sess_info1
115 {
116         uint32 ptr_name; /* pointer to name. */
117         uint32 ptr_user; /* pointer to user name. */
118
119         uint32 num_opens;
120         uint32 open_time;
121         uint32 idle_time;
122         uint32 user_flags;
123
124 } SESS_INFO_1;
125
126 /* SESS_INFO_1_STR (level 1 session info strings) */
127 typedef struct str_sess_info1
128 {
129         UNISTR2 uni_name; /* unicode string of name */
130         UNISTR2 uni_user; /* unicode string of user */
131
132 } SESS_INFO_1_STR;
133
134 /* SRV_SESS_INFO_1 */
135 typedef struct srv_sess_info_1_info
136 {
137         uint32 num_entries_read;                     /* EntriesRead */
138         uint32 ptr_sess_info;                       /* Buffer */
139         uint32 num_entries_read2;                    /* EntriesRead */
140
141         SESS_INFO_1     info_1    [MAX_SESS_ENTRIES]; /* session entry pointers */
142         SESS_INFO_1_STR info_1_str[MAX_SESS_ENTRIES]; /* session entry strings */
143
144 } SRV_SESS_INFO_1;
145
146 /* SRV_SESS_INFO_CTR */
147 typedef struct srv_sess_info_ctr_info
148 {
149         uint32 switch_value;         /* switch value */
150         uint32 ptr_sess_ctr;       /* pointer to sess info union */
151         union
152     {
153                 SRV_SESS_INFO_0 info0; /* session info level 0 */
154                 SRV_SESS_INFO_1 info1; /* session info level 1 */
155
156     } sess;
157
158 } SRV_SESS_INFO_CTR;
159
160
161 /* SRV_Q_NET_SESS_ENUM */
162 typedef struct q_net_sess_enum_info
163 {
164         uint32 ptr_srv_name;         /* pointer (to server name?) */
165         UNISTR2 uni_srv_name;        /* server name */
166
167         uint32 ptr_qual_name;         /* pointer (to qualifier name) */
168         UNISTR2 uni_qual_name;        /* qualifier name "\\qualifier" */
169
170         uint32 ptr_user_name;         /* pointer (to user name */
171         UNISTR2 uni_user_name;        /* user name */
172
173         uint32 sess_level;          /* session level */
174
175         SRV_SESS_INFO_CTR *ctr;
176
177         uint32 preferred_len;        /* preferred maximum length (0xffff ffff) */
178         ENUM_HND enum_hnd;
179
180 } SRV_Q_NET_SESS_ENUM;
181
182 /* SRV_R_NET_SESS_ENUM */
183 typedef struct r_net_sess_enum_info
184 {
185         uint32 sess_level;          /* share level */
186
187         SRV_SESS_INFO_CTR *ctr;
188
189         uint32 total_entries;                    /* total number of entries */
190         ENUM_HND enum_hnd;
191
192         WERROR status;               /* return status */
193
194 } SRV_R_NET_SESS_ENUM;
195
196 /* CONN_INFO_0 (pointers to level 0 connection info strings) */
197 typedef struct ptr_conn_info0
198 {
199         uint32 id; /* connection id. */
200
201 } CONN_INFO_0;
202
203 /* oops - this is going to take up a *massive* amount of stack. */
204 /* the UNISTR2s already have 1024 uint16 chars in them... */
205 #define MAX_CONN_ENTRIES 32
206
207 /* SRV_CONN_INFO_0 */
208 typedef struct srv_conn_info_0_info
209 {
210         uint32 num_entries_read;                     /* EntriesRead */
211         uint32 ptr_conn_info;                       /* Buffer */
212         uint32 num_entries_read2;                    /* EntriesRead */
213
214         CONN_INFO_0     info_0    [MAX_CONN_ENTRIES]; /* connection entry pointers */
215
216 } SRV_CONN_INFO_0;
217
218 /* CONN_INFO_1 (pointers to level 1 connection info strings) */
219 typedef struct ptr_conn_info1
220 {
221         uint32 id;   /* connection id */
222         uint32 type; /* 0x3 */
223         uint32 num_opens;
224         uint32 num_users;
225         uint32 open_time;
226
227         uint32 ptr_usr_name; /* pointer to user name. */
228         uint32 ptr_net_name; /* pointer to network name (e.g IPC$). */
229
230 } CONN_INFO_1;
231
232 /* CONN_INFO_1_STR (level 1 connection info strings) */
233 typedef struct str_conn_info1
234 {
235         UNISTR2 uni_usr_name; /* unicode string of user */
236         UNISTR2 uni_net_name; /* unicode string of name */
237
238 } CONN_INFO_1_STR;
239
240 /* SRV_CONN_INFO_1 */
241 typedef struct srv_conn_info_1_info
242 {
243         uint32 num_entries_read;                     /* EntriesRead */
244         uint32 ptr_conn_info;                       /* Buffer */
245         uint32 num_entries_read2;                    /* EntriesRead */
246
247         CONN_INFO_1     info_1    [MAX_CONN_ENTRIES]; /* connection entry pointers */
248         CONN_INFO_1_STR info_1_str[MAX_CONN_ENTRIES]; /* connection entry strings */
249
250 } SRV_CONN_INFO_1;
251
252 /* SRV_CONN_INFO_CTR */
253 typedef struct srv_conn_info_ctr_info
254 {
255         uint32 switch_value;         /* switch value */
256         uint32 ptr_conn_ctr;       /* pointer to conn info union */
257         union
258     {
259                 SRV_CONN_INFO_0 info0; /* connection info level 0 */
260                 SRV_CONN_INFO_1 info1; /* connection info level 1 */
261
262     } conn;
263
264 } SRV_CONN_INFO_CTR;
265
266
267 /* SRV_Q_NET_CONN_ENUM */
268 typedef struct q_net_conn_enum_info
269 {
270         uint32 ptr_srv_name;         /* pointer (to server name) */
271         UNISTR2 uni_srv_name;        /* server name "\\server" */
272
273         uint32 ptr_qual_name;         /* pointer (to qualifier name) */
274         UNISTR2 uni_qual_name;        /* qualifier name "\\qualifier" */
275
276         uint32 conn_level;          /* connection level */
277
278         SRV_CONN_INFO_CTR *ctr;
279
280         uint32 preferred_len;        /* preferred maximum length (0xffff ffff) */
281         ENUM_HND enum_hnd;
282
283 } SRV_Q_NET_CONN_ENUM;
284
285 /* SRV_R_NET_CONN_ENUM */
286 typedef struct r_net_conn_enum_info
287 {
288         uint32 conn_level;          /* share level */
289
290         SRV_CONN_INFO_CTR *ctr;
291
292         uint32 total_entries;                    /* total number of entries */
293         ENUM_HND enum_hnd;
294
295         WERROR status;               /* return status */
296
297 } SRV_R_NET_CONN_ENUM;
298
299 /* SH_INFO_0 */
300 typedef struct ptr_share_info0
301 {
302         uint32 ptr_netname; /* pointer to net name. */
303 } SH_INFO_0;
304
305 /* SH_INFO_0_STR (level 0 share info strings) */
306 typedef struct str_share_info0
307 {
308         SH_INFO_0 *ptrs;
309
310         UNISTR2 uni_netname; /* unicode string of net name */
311
312 } SH_INFO_0_STR;
313
314 /* SRV_SHARE_INFO_0 */
315 typedef struct share_info_0_info
316 {
317         SH_INFO_0 info_0;
318         SH_INFO_0_STR info_0_str;
319
320 } SRV_SHARE_INFO_0;
321
322 /* SH_INFO_1 (pointers to level 1 share info strings) */
323 typedef struct ptr_share_info1
324 {
325         uint32 ptr_netname; /* pointer to net name. */
326         uint32 type; /* ipc, print, disk ... */
327         uint32 ptr_remark; /* pointer to comment. */
328
329 } SH_INFO_1;
330
331 /* SH_INFO_1_STR (level 1 share info strings) */
332 typedef struct str_share_info1
333 {
334         SH_INFO_1 *ptrs;
335
336         UNISTR2 uni_netname; /* unicode string of net name */
337         UNISTR2 uni_remark; /* unicode string of comment */
338
339 } SH_INFO_1_STR;
340
341 /* SRV_SHARE_INFO_1 */
342 typedef struct share_info_1_info
343 {
344         SH_INFO_1 info_1;
345         SH_INFO_1_STR info_1_str;
346
347 } SRV_SHARE_INFO_1;
348
349 /* SH_INFO_2 (pointers to level 2 share info strings) */
350 typedef struct ptr_share_info2
351 {
352         uint32 ptr_netname; /* pointer to net name. */
353         uint32 type; /* ipc, print, disk ... */
354         uint32 ptr_remark; /* pointer to comment. */
355         uint32 perms;      /* permissions */
356         uint32 max_uses;   /* maximum uses */
357         uint32 num_uses;   /* current uses */
358         uint32 ptr_path;   /* pointer to path name */
359         uint32 ptr_passwd; /* pointer to password */
360
361 } SH_INFO_2;
362
363 /* SH_INFO_2_STR (level 2 share info strings) */
364 typedef struct str_share_info2
365 {
366         SH_INFO_2 *ptrs;
367
368         UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */
369         UNISTR2 uni_remark;  /* unicode string of comment (e.g "Logon server share") */
370         UNISTR2 uni_path;    /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */
371         UNISTR2 uni_passwd;  /* unicode string of password - presumably for share level security (e.g NULL) */
372
373 } SH_INFO_2_STR;
374
375 /* SRV_SHARE_INFO_2 */
376 typedef struct share_info_2_info
377 {
378         SH_INFO_2 info_2;
379         SH_INFO_2_STR info_2_str;
380
381 } SRV_SHARE_INFO_2;
382
383 typedef struct ptr_share_info501
384 {
385         uint32 ptr_netname; /* pointer to net name */
386         uint32 type;     /* ipc, print, disk */
387         uint32 ptr_remark;  /* pointer to comment */
388         uint32 csc_policy;  /* client-side offline caching policy << 4 */
389 } SH_INFO_501;
390
391 typedef struct str_share_info501
392 {
393         UNISTR2 uni_netname; /* unicode string of net name */
394         UNISTR2 uni_remark;  /* unicode string of comment */
395 } SH_INFO_501_STR;
396
397 /* SRV_SHARE_INFO_501 */
398 typedef struct share_info_501_info
399 {
400         SH_INFO_501 info_501;
401         SH_INFO_501_STR info_501_str;
402 } SRV_SHARE_INFO_501;
403
404 /* SH_INFO_502 (pointers to level 502 share info strings) */
405 typedef struct ptr_share_info502
406 {
407         uint32 ptr_netname; /* pointer to net name. */
408         uint32 type; /* ipc, print, disk ... */
409         uint32 ptr_remark; /* pointer to comment. */
410         uint32 perms;      /* permissions */
411         uint32 max_uses;   /* maximum uses */
412         uint32 num_uses;   /* current uses */
413         uint32 ptr_path;   /* pointer to path name */
414         uint32 ptr_passwd; /* pointer to password */
415         uint32 reserved;    /* this holds the space taken by the sd in the rpc packet */
416         uint32 reserved_offset;   /* required for _post operation when marshalling */
417         uint32 sd_size;    /* size of security descriptor */
418         uint32 ptr_sd;     /* pointer to security descriptor */
419
420 } SH_INFO_502;
421
422 /* SH_INFO_502_STR (level 502 share info strings) */
423 typedef struct str_share_info502
424 {
425         SH_INFO_502 *ptrs;
426
427         UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */
428         UNISTR2 uni_remark;  /* unicode string of comment (e.g "Logon server share") */
429         UNISTR2 uni_path;    /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */
430         UNISTR2 uni_passwd;  /* unicode string of password - presumably for share level security (e.g NULL) */
431
432         uint32 reserved;
433         uint32 sd_size;
434         SEC_DESC *sd;
435
436 } SH_INFO_502_STR;
437
438 /* SRV_SHARE_INFO_502 */
439 typedef struct share_info_502_info
440 {
441         SH_INFO_502 info_502;
442         SH_INFO_502_STR info_502_str;
443
444 } SRV_SHARE_INFO_502;
445
446 typedef struct ptr_share_info1004
447 {
448         uint32 ptr_remark;
449
450 } SH_INFO_1004;
451
452 typedef struct str_share_info1004
453 {
454         SH_INFO_1004 *ptrs;
455
456         UNISTR2 uni_remark;
457
458 } SH_INFO_1004_STR;
459
460 typedef struct ptr_info_1004_info
461 {
462         SH_INFO_1004     info_1004; 
463         SH_INFO_1004_STR info_1004_str; 
464 } SRV_SHARE_INFO_1004;
465
466 #define SHARE_1005_IN_DFS               0x00000001
467 #define SHARE_1005_DFS_ROOT             0x00000002
468 /* use the CSC policy mask and shift to match up with the smb.conf parm */
469 #define SHARE_1005_CSC_POLICY_MASK      0x00000030
470 #define SHARE_1005_CSC_POLICY_SHIFT     4
471
472 typedef struct share_info_1005_info
473 {
474   uint32 share_info_flags; 
475 } SRV_SHARE_INFO_1005;
476
477 typedef struct share_info_1006_info
478 {
479         uint32 max_uses; 
480 } SRV_SHARE_INFO_1006;
481
482 typedef struct ptr_share_info1007
483 {
484         uint32 flags;
485         uint32 ptr_AlternateDirectoryName;
486
487 } SH_INFO_1007;
488
489 typedef struct str_share_info1007
490 {
491         SH_INFO_1007 *ptrs;
492
493         UNISTR2 uni_AlternateDirectoryName;
494
495 } SH_INFO_1007_STR;
496
497 typedef struct ptr_info_1007_info
498 {
499         SH_INFO_1007     info_1007; 
500         SH_INFO_1007_STR info_1007_str; 
501 } SRV_SHARE_INFO_1007;
502
503 /* SRV_SHARE_INFO_1501 */
504 typedef struct share_info_1501_info
505 {
506         SEC_DESC_BUF *sdb;
507 } SRV_SHARE_INFO_1501;
508
509 /* SRV_SHARE_INFO_CTR */
510 typedef struct srv_share_info_ctr_info
511 {
512         uint32 info_level;
513         uint32 switch_value;
514         uint32 ptr_share_info;
515
516         uint32 num_entries;
517         uint32 ptr_entries;
518         uint32 num_entries2;
519
520         union {
521                 SRV_SHARE_INFO_0    *info0;
522                 SRV_SHARE_INFO_1    *info1;    /* share info level 1 */
523                 SRV_SHARE_INFO_2    *info2;    /* share info level 2 */
524                 SRV_SHARE_INFO_501  *info501;  /* share info level 501 */
525                 SRV_SHARE_INFO_502  *info502;  /* share info level 502 */
526                 SRV_SHARE_INFO_1004 *info1004;
527                 SRV_SHARE_INFO_1005 *info1005;
528                 SRV_SHARE_INFO_1006 *info1006;
529                 SRV_SHARE_INFO_1007 *info1007;
530                 SRV_SHARE_INFO_1501 *info1501;
531                 void *info;
532
533         } share;
534
535 } SRV_SHARE_INFO_CTR;
536
537 /* SRV_Q_NET_SHARE_ENUM */
538 typedef struct q_net_share_enum_info
539 {
540         uint32 ptr_srv_name;         /* pointer (to server name?) */
541         UNISTR2 uni_srv_name;        /* server name */
542
543         SRV_SHARE_INFO_CTR ctr;     /* share info container */
544
545         uint32 preferred_len;        /* preferred maximum length (0xffff ffff) */
546
547         ENUM_HND enum_hnd;
548
549 } SRV_Q_NET_SHARE_ENUM;
550
551
552 /* SRV_R_NET_SHARE_ENUM */
553 typedef struct r_net_share_enum_info
554 {
555         SRV_SHARE_INFO_CTR ctr;     /* share info container */
556
557         uint32 total_entries;                    /* total number of entries */
558         ENUM_HND enum_hnd;
559
560         WERROR status;               /* return status */
561
562 } SRV_R_NET_SHARE_ENUM;
563
564
565 /* SRV_Q_NET_SHARE_GET_INFO */
566 typedef struct q_net_share_get_info_info
567 {
568         uint32 ptr_srv_name;
569         UNISTR2 uni_srv_name;
570
571         UNISTR2 uni_share_name;
572         uint32 info_level;
573
574 } SRV_Q_NET_SHARE_GET_INFO;
575
576 /* SRV_SHARE_INFO */
577 typedef struct srv_share_info {
578         uint32 switch_value;
579         uint32 ptr_share_ctr;
580
581         union {
582                 SRV_SHARE_INFO_0    info0;
583                 SRV_SHARE_INFO_1 info1;
584                 SRV_SHARE_INFO_2 info2;
585                 SRV_SHARE_INFO_501 info501;
586                 SRV_SHARE_INFO_502 info502;
587                 SRV_SHARE_INFO_1004 info1004;
588                 SRV_SHARE_INFO_1005 info1005;
589                 SRV_SHARE_INFO_1006 info1006;
590                 SRV_SHARE_INFO_1007 info1007;
591                 SRV_SHARE_INFO_1501 info1501;
592         } share;
593 } SRV_SHARE_INFO;
594
595 /* SRV_R_NET_SHARE_GET_INFO */
596 typedef struct r_net_share_get_info_info
597 {
598         SRV_SHARE_INFO info;
599         WERROR status;
600
601 } SRV_R_NET_SHARE_GET_INFO;
602
603 /* SRV_Q_NET_SHARE_SET_INFO */
604 typedef struct q_net_share_set_info_info
605 {
606         uint32 ptr_srv_name;
607         UNISTR2 uni_srv_name;
608
609         UNISTR2 uni_share_name;
610         uint32 info_level;
611
612         SRV_SHARE_INFO info;
613
614         uint32 ptr_parm_error;
615         uint32 parm_error;
616
617 } SRV_Q_NET_SHARE_SET_INFO;
618
619 /* SRV_R_NET_SHARE_SET_INFO */
620 typedef struct r_net_share_set_info
621 {
622         uint32 ptr_parm_error;
623         uint32 parm_error;
624
625         WERROR status;               /* return status */
626
627 } SRV_R_NET_SHARE_SET_INFO;
628
629 /* SRV_Q_NET_SHARE_ADD */
630 typedef struct q_net_share_add
631 {
632         uint32 ptr_srv_name;
633         UNISTR2 uni_srv_name;
634
635         uint32 info_level;
636
637         SRV_SHARE_INFO info;
638
639         uint32 ptr_err_index; /* pointer to error index */
640         uint32 err_index;     /* index in info to field in error */
641
642 } SRV_Q_NET_SHARE_ADD;
643
644 /* SRV_R_NET_SHARE_ADD */
645 typedef struct r_net_share_add
646 {
647
648         uint32 ptr_parm_error;
649         uint32 parm_error;
650
651         WERROR status;               /* return status */
652
653 } SRV_R_NET_SHARE_ADD;
654
655 /* SRV_Q_NET_SHARE_DEL */
656 typedef struct q_net_share_del
657 {
658         uint32 ptr_srv_name;
659         UNISTR2 uni_srv_name;
660         UNISTR2 uni_share_name;
661         uint32 reserved;
662
663 } SRV_Q_NET_SHARE_DEL;
664
665 /* SRV_R_NET_SHARE_DEL */
666 typedef struct r_net_share_del
667 {
668         WERROR status;               /* return status */
669
670 } SRV_R_NET_SHARE_DEL;
671
672 /* FILE_INFO_3 (level 3 file info strings) */
673 typedef struct file_info3_info
674 {
675         uint32 id;            /* file index */
676         uint32 perms;         /* file permissions. don't know what format */
677         uint32 num_locks;     /* file locks */
678         uint32 ptr_path_name; /* file name */
679         uint32 ptr_user_name; /* file owner */
680
681 } FILE_INFO_3;
682
683 /* FILE_INFO_3_STR (level 3 file info strings) */
684 typedef struct str_file_info3_info
685 {
686         UNISTR2 uni_path_name; /* unicode string of file name */
687         UNISTR2 uni_user_name; /* unicode string of file owner. */
688
689 } FILE_INFO_3_STR;
690
691 /* SRV_FILE_INFO_3 */
692 typedef struct srv_file_info_3
693 {
694         uint32 num_entries_read;                     /* EntriesRead */
695         uint32 ptr_file_info;                        /* Buffer */
696
697         uint32 num_entries_read2;                    /* EntriesRead */
698         FILE_INFO_3     info_3;     /* file entry details */
699         FILE_INFO_3_STR info_3_str; /* file entry strings */
700 } SRV_FILE_INFO_3;
701
702 /* SRV_FILE_INFO_CTR */
703 typedef struct srv_file_info_3_info
704 {
705         uint32 switch_value;         /* switch value */
706         uint32 ptr_file_info;        /* pointer to file info union */
707
708         uint32 num_entries;
709         uint32 ptr_entries;
710         uint32 num_entries2;
711         union
712         {
713                 SRV_FILE_INFO_3 *info3;
714         } file;
715
716 } SRV_FILE_INFO_CTR;
717
718
719 /* SRV_Q_NET_FILE_ENUM */
720 typedef struct q_net_file_enum_info
721 {
722         uint32 ptr_srv_name;         /* pointer (to server name?) */
723         UNISTR2 uni_srv_name;        /* server name */
724
725         uint32 ptr_qual_name;         /* pointer (to qualifier name) */
726         UNISTR2 uni_qual_name;        /* qualifier name "\\qualifier" */
727
728         uint32 ptr_user_name;         /* pointer (to user name) */
729         UNISTR2 uni_user_name;        /* user name */
730
731         uint32 file_level;          /* file level */
732
733         SRV_FILE_INFO_CTR ctr;
734
735         uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
736         ENUM_HND enum_hnd;
737
738 } SRV_Q_NET_FILE_ENUM;
739
740
741 /* SRV_R_NET_FILE_ENUM */
742 typedef struct r_net_file_enum_info
743 {
744         uint32 file_level;          /* file level */
745
746         SRV_FILE_INFO_CTR ctr;
747
748         uint32 total_entries;                    /* total number of files */
749         ENUM_HND enum_hnd;
750
751         WERROR status;        /* return status */
752
753 } SRV_R_NET_FILE_ENUM;
754
755 /* SRV_Q_NET_FILE_CLOSE */
756 typedef struct q_net_file_close
757 {
758         uint32 ptr_srv_name;         /* pointer to server name */
759         UNISTR2 uni_srv_name;        /* server name */
760         
761         uint32 file_id;
762 } SRV_Q_NET_FILE_CLOSE;
763
764 /* SRV_R_NET_FILE_CLOSE */
765 typedef struct r_net_file_close
766 {
767         WERROR status;               /* return status */
768 } SRV_R_NET_FILE_CLOSE;
769
770 /* SRV_INFO_100 */
771 typedef struct srv_info_100_info
772 {
773         uint32 platform_id;     /* 0x500 */
774         uint32 ptr_name;        /* pointer to server name */
775
776         UNISTR2 uni_name;       /* server name "server" */
777
778 } SRV_INFO_100;
779
780 /* SRV_INFO_101 */
781 typedef struct srv_info_101_info
782 {
783         uint32 platform_id;     /* 0x500 */
784         uint32 ptr_name;        /* pointer to server name */
785         uint32 ver_major;       /* 0x4 */
786         uint32 ver_minor;       /* 0x2 */
787         uint32 srv_type;        /* browse etc type */
788         uint32 ptr_comment;     /* pointer to server comment */
789
790         UNISTR2 uni_name;       /* server name "server" */
791         UNISTR2 uni_comment;    /* server comment "samba x.x.x blah" */
792
793 } SRV_INFO_101;
794
795 /* SRV_INFO_102  */
796 typedef struct srv_info_102_info
797 {
798         uint32 platform_id;     /* 0x500 */
799         uint32 ptr_name;        /* pointer to server name */
800         uint32 ver_major;       /* 0x4 */
801         uint32 ver_minor;       /* 0x2 */
802         uint32 srv_type;        /* browse etc type */
803         uint32 ptr_comment;     /* pointer to server comment */
804         uint32 users;           /* 0xffff ffff*/
805         uint32 disc;            /* 0xf */
806         uint32 hidden;          /* 0x0 */
807         uint32 announce;        /* 240 */
808         uint32 ann_delta;       /* 3000 */
809         uint32 licenses;        /* 0 */
810         uint32 ptr_usr_path;    /* pointer to user path */
811
812         UNISTR2 uni_name;       /* server name "server" */
813         UNISTR2 uni_comment;    /* server comment "samba x.x.x blah" */
814         UNISTR2 uni_usr_path;   /* "c:\" (eh?) */
815
816 } SRV_INFO_102;
817
818
819 /* SRV_INFO_CTR */
820 typedef struct srv_info_ctr_info
821 {
822         uint32 switch_value;         /* switch value */
823         uint32 ptr_srv_ctr;         /* pointer to server info */
824         union
825     {
826                 SRV_INFO_102 sv102; /* server info level 102 */
827                 SRV_INFO_101 sv101; /* server info level 101 */
828                 SRV_INFO_100 sv100; /* server info level 100 */
829
830     } srv;
831
832 } SRV_INFO_CTR;
833
834 /* SRV_Q_NET_SRV_GET_INFO */
835 typedef struct q_net_srv_get_info
836 {
837         uint32  ptr_srv_name;
838         UNISTR2 uni_srv_name; /* "\\server" */
839         uint32  switch_value;
840
841 } SRV_Q_NET_SRV_GET_INFO;
842
843 /* SRV_R_NET_SRV_GET_INFO */
844 typedef struct r_net_srv_get_info
845 {
846         SRV_INFO_CTR *ctr;
847
848         WERROR status;               /* return status */
849
850 } SRV_R_NET_SRV_GET_INFO;
851
852 /* SRV_Q_NET_SRV_SET_INFO */
853 typedef struct q_net_srv_set_info
854 {
855         uint32  ptr_srv_name;
856         UNISTR2 uni_srv_name; /* "\\server" */
857         uint32  switch_value;
858
859         SRV_INFO_CTR *ctr;
860
861 } SRV_Q_NET_SRV_SET_INFO;
862
863
864 /* SRV_R_NET_SRV_SET_INFO */
865 typedef struct r_net_srv_set_info
866 {
867         uint32 switch_value;         /* switch value */
868
869         WERROR status;               /* return status */
870
871 } SRV_R_NET_SRV_SET_INFO;
872
873 /* SRV_Q_NET_REMOTE_TOD */
874 typedef struct q_net_remote_tod
875 {
876         uint32  ptr_srv_name;
877         UNISTR2 uni_srv_name; /* "\\server" */
878
879 } SRV_Q_NET_REMOTE_TOD;
880
881 /* TIME_OF_DAY_INFO */
882 typedef struct time_of_day_info
883 {
884         uint32  elapsedt;
885         uint32  msecs;
886         uint32  hours;
887         uint32  mins;
888         uint32  secs;
889         uint32  hunds;
890         uint32  zone;
891         uint32  tintervals;
892         uint32  day;
893         uint32  month;
894         uint32  year;
895         uint32  weekday;
896         
897 } TIME_OF_DAY_INFO;
898
899 /* SRV_R_NET_REMOTE_TOD */
900 typedef struct r_net_remote_tod
901 {
902         uint32 ptr_srv_tod;         /* pointer to TOD */
903         TIME_OF_DAY_INFO *tod;
904         
905         WERROR status;               /* return status */
906
907 } SRV_R_NET_REMOTE_TOD;
908
909 /* SRV_Q_NET_FILE_QUERY_SECDESC */
910 typedef struct q_net_file_query_secdesc
911 {
912         uint32  ptr_srv_name;
913         UNISTR2 uni_srv_name;
914         uint32  ptr_qual_name;
915         UNISTR2 uni_qual_name;
916         UNISTR2 uni_file_name;
917         uint32  unknown1;
918         uint32  unknown2;
919         uint32  unknown3;
920 } SRV_Q_NET_FILE_QUERY_SECDESC;
921
922 /* SRV_R_NET_FILE_QUERY_SECDESC */
923 typedef struct r_net_file_query_secdesc
924 {
925         uint32 ptr_response;
926         uint32 size_response;
927         uint32 ptr_secdesc;
928         uint32 size_secdesc;
929         SEC_DESC *sec_desc;
930         WERROR status;
931 } SRV_R_NET_FILE_QUERY_SECDESC;
932
933 /* SRV_Q_NET_FILE_SET_SECDESC */
934 typedef struct q_net_file_set_secdesc
935 {
936         uint32  ptr_srv_name;
937         UNISTR2 uni_srv_name;
938         uint32  ptr_qual_name;
939         UNISTR2 uni_qual_name;
940         UNISTR2 uni_file_name;
941         uint32  sec_info;
942         uint32  size_set;
943         uint32  ptr_secdesc;
944         uint32  size_secdesc;
945         SEC_DESC *sec_desc;
946 } SRV_Q_NET_FILE_SET_SECDESC;
947
948 /* SRV_R_NET_FILE_SET_SECDESC */
949 typedef struct r_net_file_set_secdesc
950 {
951         WERROR status;
952 } SRV_R_NET_FILE_SET_SECDESC;
953
954 #endif /* _RPC_SRVSVC_H */