2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
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) Jeremy Allison 1999.
8 * Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2002
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #define DBGC_CLASS DBGC_RPC_PARSE
30 /*******************************************************************
31 Inits a SH_INFO_1_STR structure
32 ********************************************************************/
34 void init_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark)
36 DEBUG(5,("init_srv_share_info1_str\n"));
38 init_unistr2(&sh1->uni_netname, net_name, strlen(net_name)+1);
39 init_unistr2(&sh1->uni_remark, remark, strlen(remark)+1);
42 /*******************************************************************
43 Reads or writes a structure.
44 ********************************************************************/
46 static BOOL srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth)
51 prs_debug(ps, depth, desc, "srv_io_share_info1_str");
56 if(!smb_io_unistr2("", &sh1->uni_netname, True, ps, depth))
61 if(!smb_io_unistr2("", &sh1->uni_remark, True, ps, depth))
67 /*******************************************************************
68 makes a SH_INFO_1 structure
69 ********************************************************************/
71 void init_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark)
73 DEBUG(5,("init_srv_share_info1: %s %8x %s\n", net_name, type, remark));
75 sh1->ptr_netname = (net_name != NULL) ? 1 : 0;
77 sh1->ptr_remark = (remark != NULL) ? 1 : 0;
80 /*******************************************************************
81 Reads or writes a structure.
82 ********************************************************************/
84 static BOOL srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth)
89 prs_debug(ps, depth, desc, "srv_io_share_info1");
95 if(!prs_uint32("ptr_netname", ps, depth, &sh1->ptr_netname))
97 if(!prs_uint32("type ", ps, depth, &sh1->type))
99 if(!prs_uint32("ptr_remark ", ps, depth, &sh1->ptr_remark))
105 /*******************************************************************
106 Inits a SH_INFO_2_STR structure
107 ********************************************************************/
109 void init_srv_share_info2_str(SH_INFO_2_STR *sh2,
110 char *net_name, char *remark,
111 char *path, char *passwd)
113 DEBUG(5,("init_srv_share_info2_str\n"));
116 init_unistr2(&sh2->uni_netname, net_name, strlen(net_name)+1);
118 init_unistr2(&sh2->uni_remark, remark, strlen(remark)+1);
120 init_unistr2(&sh2->uni_path, path, strlen(path)+1);
122 init_unistr2(&sh2->uni_passwd, passwd, strlen(passwd)+1);
125 /*******************************************************************
126 Reads or writes a structure.
127 ********************************************************************/
129 static BOOL srv_io_share_info2_str(char *desc, SH_INFO_2 *sh, SH_INFO_2_STR *sh2, prs_struct *ps, int depth)
134 if (UNMARSHALLING(ps))
137 prs_debug(ps, depth, desc, "srv_io_share_info2_str");
143 if(!smb_io_unistr2("", &sh2->uni_netname, True, ps, depth))
147 if(!smb_io_unistr2("", &sh2->uni_remark, True, ps, depth))
151 if(!smb_io_unistr2("", &sh2->uni_path, True, ps, depth))
155 if(!smb_io_unistr2("", &sh2->uni_passwd, True, ps, depth))
161 /*******************************************************************
162 Inits a SH_INFO_2 structure
163 ********************************************************************/
165 void init_srv_share_info2(SH_INFO_2 *sh2,
166 char *net_name, uint32 type, char *remark,
167 uint32 perms, uint32 max_uses, uint32 num_uses,
168 char *path, char *passwd)
170 DEBUG(5,("init_srv_share_info2: %s %8x %s\n", net_name, type, remark));
172 sh2->ptr_netname = (net_name != NULL) ? 1 : 0;
174 sh2->ptr_remark = (remark != NULL) ? 1 : 0;
176 sh2->max_uses = max_uses;
177 sh2->num_uses = num_uses;
179 sh2->ptr_path = (path != NULL) ? 1 : 0;
180 sh2->ptr_passwd = (passwd != NULL) ? 1 : 0;
183 /*******************************************************************
184 Reads or writes a structure.
185 ********************************************************************/
187 static BOOL srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth)
192 prs_debug(ps, depth, desc, "srv_io_share_info2");
198 if(!prs_uint32("ptr_netname", ps, depth, &sh2->ptr_netname))
200 if(!prs_uint32("type ", ps, depth, &sh2->type))
202 if(!prs_uint32("ptr_remark ", ps, depth, &sh2->ptr_remark))
204 if(!prs_uint32("perms ", ps, depth, &sh2->perms))
206 if(!prs_uint32("max_uses ", ps, depth, &sh2->max_uses))
208 if(!prs_uint32("num_uses ", ps, depth, &sh2->num_uses))
210 if(!prs_uint32("ptr_path ", ps, depth, &sh2->ptr_path))
212 if(!prs_uint32("ptr_passwd ", ps, depth, &sh2->ptr_passwd))
218 /*******************************************************************
219 Inits a SH_INFO_2 structure
220 *******************************************************************/
222 void init_srv_share_info501(SH_INFO_501 *sh501, char *net_name, uint32 type, char *remark, uint32 csc_policy)
224 DEBUG(5,("init_srv_share_info501: %s %8x %s %08x\n", net_name, type,
225 remark, csc_policy));
229 sh501->ptr_netname = (net_name != NULL) ? 1 : 0;
231 sh501->ptr_remark = (remark != NULL) ? 1 : 0;
232 sh501->csc_policy = csc_policy;
235 /*******************************************************************
236 Reads of writes a structure.
237 *******************************************************************/
239 static BOOL srv_io_share_info501(char *desc, SH_INFO_501 *sh501, prs_struct *ps, int depth)
244 prs_debug(ps, depth, desc, "srv_io_share_info501");
250 if (!prs_uint32("ptr_netname", ps, depth, &sh501->ptr_netname))
252 if (!prs_uint32("type ", ps, depth, &sh501->type))
254 if (!prs_uint32("ptr_remark ", ps, depth, &sh501->ptr_remark))
256 if (!prs_uint32("csc_policy ", ps, depth, &sh501->csc_policy))
262 /********************************************************************
263 Inits a SH_INFO_501_STR structure
264 ********************************************************************/
266 void init_srv_share_info501_str(SH_INFO_501_STR *sh501, char *net_name, char *remark)
268 DEBUG(5,("init_srv_share_info501_str\n"));
270 init_unistr2(&sh501->uni_netname, net_name, strlen(net_name)+1);
271 init_unistr2(&sh501->uni_remark, remark, strlen(remark)+1);
274 /*******************************************************************
275 Reads or writes a structure.
276 ********************************************************************/
278 static BOOL srv_io_share_info501_str(char *desc, SH_INFO_501_STR *sh501, prs_struct *ps, int depth)
283 prs_debug(ps, depth, desc, "srv_io_share_info501_str");
288 if(!smb_io_unistr2("", &sh501->uni_netname, True, ps, depth))
293 if(!smb_io_unistr2("", &sh501->uni_remark, True, ps, depth))
299 /*******************************************************************
300 Inits a SH_INFO_502 structure
301 ********************************************************************/
303 void init_srv_share_info502(SH_INFO_502 *sh502,
304 char *net_name, uint32 type, char *remark,
305 uint32 perms, uint32 max_uses, uint32 num_uses,
306 char *path, char *passwd, SEC_DESC *psd, size_t sd_size)
308 DEBUG(5,("init_srv_share_info502: %s %8x %s\n", net_name, type, remark));
312 sh502->ptr_netname = (net_name != NULL) ? 1 : 0;
314 sh502->ptr_remark = (remark != NULL) ? 1 : 0;
315 sh502->perms = perms;
316 sh502->max_uses = max_uses;
317 sh502->num_uses = num_uses;
319 sh502->ptr_path = (path != NULL) ? 1 : 0;
320 sh502->ptr_passwd = (passwd != NULL) ? 1 : 0;
321 sh502->sd_size = (uint32)sd_size;
322 sh502->ptr_sd = (psd != NULL) ? 1 : 0;
325 /*******************************************************************
326 Reads or writes a structure.
327 ********************************************************************/
329 static BOOL srv_io_share_info502(char *desc, SH_INFO_502 *sh502, prs_struct *ps, int depth)
334 prs_debug(ps, depth, desc, "srv_io_share_info502");
340 if(!prs_uint32("ptr_netname", ps, depth, &sh502->ptr_netname))
342 if(!prs_uint32("type ", ps, depth, &sh502->type))
344 if(!prs_uint32("ptr_remark ", ps, depth, &sh502->ptr_remark))
346 if(!prs_uint32("perms ", ps, depth, &sh502->perms))
348 if(!prs_uint32("max_uses ", ps, depth, &sh502->max_uses))
350 if(!prs_uint32("num_uses ", ps, depth, &sh502->num_uses))
352 if(!prs_uint32("ptr_path ", ps, depth, &sh502->ptr_path))
354 if(!prs_uint32("ptr_passwd ", ps, depth, &sh502->ptr_passwd))
356 if(!prs_uint32("sd_size ", ps, depth, &sh502->sd_size))
358 if(!prs_uint32("ptr_sd ", ps, depth, &sh502->ptr_sd))
364 /*******************************************************************
365 Inits a SH_INFO_502_STR structure
366 ********************************************************************/
368 void init_srv_share_info502_str(SH_INFO_502_STR *sh502str,
370 char *net_name, char *remark,
371 char *path, char *passwd, SEC_DESC *psd, size_t sd_size)
373 DEBUG(5,("init_srv_share_info502_str\n"));
375 sh502str->ptrs = ptrs;
377 if(sh502str->ptrs->ptr_netname)
378 init_unistr2(&sh502str->uni_netname, net_name, strlen(net_name)+1);
379 if(sh502str->ptrs->ptr_remark)
380 init_unistr2(&sh502str->uni_remark, remark, strlen(remark)+1);
381 if(sh502str->ptrs->ptr_path)
382 init_unistr2(&sh502str->uni_path, path, strlen(path)+1);
383 if(sh502str->ptrs->ptr_passwd)
384 init_unistr2(&sh502str->uni_passwd, passwd, strlen(passwd)+1);
385 if(sh502str->ptrs->ptr_sd) {
387 sh502str->sd_size = sd_size;
391 /*******************************************************************
392 Reads or writes a structure.
393 ********************************************************************/
395 static BOOL srv_io_share_info502_str(char *desc, SH_INFO_502_STR *sh502, prs_struct *ps, int depth)
400 prs_debug(ps, depth, desc, "srv_io_share_info502_str");
406 if(sh502->ptrs->ptr_netname) {
407 if(!smb_io_unistr2("", &sh502->uni_netname, True, ps, depth))
414 if(sh502->ptrs->ptr_remark) {
415 if(!smb_io_unistr2("", &sh502->uni_remark, True, ps, depth))
422 if(sh502->ptrs->ptr_path) {
423 if(!smb_io_unistr2("", &sh502->uni_path, True, ps, depth))
430 if(sh502->ptrs->ptr_passwd) {
431 if(!smb_io_unistr2("", &sh502->uni_passwd, True, ps, depth))
438 if(sh502->ptrs->ptr_sd) {
439 if(!prs_uint32("sd_size ", ps, depth, &sh502->sd_size))
441 if (!sec_io_desc(desc, &sh502->sd, ps, depth))
448 /*******************************************************************
449 Reads or writes a structure.
450 ********************************************************************/
452 static BOOL srv_io_share_info1005(char* desc, SRV_SHARE_INFO_1005* sh1005,
453 prs_struct* ps, int depth)
458 prs_debug(ps, depth, desc, "srv_io_share_info1005");
464 if(!prs_uint32("dfs_root_flag", ps, depth, &sh1005->dfs_root_flag))
470 /*******************************************************************
471 Reads or writes a structure.
472 ********************************************************************/
474 static BOOL srv_io_share_info1501(char* desc, SRV_SHARE_INFO_1501* sh1501,
475 prs_struct* ps, int depth)
480 prs_debug(ps, depth, desc, "srv_io_share_info1501");
486 if (!sec_io_desc_buf(desc, &sh1501->sdb, ps, depth))
492 /*******************************************************************
493 Reads or writes a structure.
494 ********************************************************************/
496 static BOOL srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth)
501 prs_debug(ps, depth, desc, "srv_io_srv_share_ctr");
504 if (UNMARSHALLING(ps)) {
505 memset(ctr, '\0', sizeof(SRV_SHARE_INFO_CTR));
511 if(!prs_uint32("info_level", ps, depth, &ctr->info_level))
514 if (ctr->info_level == 0)
517 if(!prs_uint32("switch_value", ps, depth, &ctr->switch_value))
519 if(!prs_uint32("ptr_share_info", ps, depth, &ctr->ptr_share_info))
522 if (ctr->ptr_share_info == 0)
525 if(!prs_uint32("num_entries", ps, depth, &ctr->num_entries))
527 if(!prs_uint32("ptr_entries", ps, depth, &ctr->ptr_entries))
530 if (ctr->ptr_entries == 0) {
531 if (ctr->num_entries == 0)
537 if(!prs_uint32("num_entries2", ps, depth, &ctr->num_entries2))
540 if (ctr->num_entries2 != ctr->num_entries)
543 switch (ctr->switch_value) {
546 SRV_SHARE_INFO_1 *info1 = ctr->share.info1;
547 int num_entries = ctr->num_entries;
550 if (UNMARSHALLING(ps)) {
551 if (!(info1 = (SRV_SHARE_INFO_1 *)prs_alloc_mem(ps, num_entries * sizeof(SRV_SHARE_INFO_1))))
553 ctr->share.info1 = info1;
556 for (i = 0; i < num_entries; i++) {
557 if(!srv_io_share_info1("", &info1[i].info_1, ps, depth))
561 for (i = 0; i < num_entries; i++) {
562 if(!srv_io_share_info1_str("", &info1[i].info_1_str, ps, depth))
571 SRV_SHARE_INFO_2 *info2 = ctr->share.info2;
572 int num_entries = ctr->num_entries;
575 if (UNMARSHALLING(ps)) {
576 if (!(info2 = (SRV_SHARE_INFO_2 *)prs_alloc_mem(ps,num_entries * sizeof(SRV_SHARE_INFO_2))))
578 ctr->share.info2 = info2;
581 for (i = 0; i < num_entries; i++) {
582 if(!srv_io_share_info2("", &info2[i].info_2, ps, depth))
586 for (i = 0; i < num_entries; i++) {
587 if(!srv_io_share_info2_str("", &info2[i].info_2, &info2[i].info_2_str, ps, depth))
596 SRV_SHARE_INFO_501 *info501 = ctr->share.info501;
597 int num_entries = ctr->num_entries;
600 if (UNMARSHALLING(ps)) {
601 if (!(info501 = (SRV_SHARE_INFO_501 *) prs_alloc_mem(ps, num_entries *
602 sizeof (SRV_SHARE_INFO_501))))
604 ctr->share.info501 = info501;
607 for (i = 0; i < num_entries; i++) {
608 if (!srv_io_share_info501("", &info501[i].info_501, ps, depth))
612 for (i = 0; i < num_entries; i++) {
613 if (!srv_io_share_info501_str("", &info501[i].info_501_str, ps, depth))
622 SRV_SHARE_INFO_502 *info502 = ctr->share.info502;
623 int num_entries = ctr->num_entries;
626 if (UNMARSHALLING(ps)) {
627 if (!(info502 = (SRV_SHARE_INFO_502 *)prs_alloc_mem(ps,num_entries * sizeof(SRV_SHARE_INFO_502))))
629 ctr->share.info502 = info502;
632 for (i = 0; i < num_entries; i++) {
633 if(!srv_io_share_info502("", &info502[i].info_502, ps, depth))
637 for (i = 0; i < num_entries; i++) {
638 info502[i].info_502_str.ptrs = &info502[i].info_502;
639 if(!srv_io_share_info502_str("", &info502[i].info_502_str, ps, depth))
647 DEBUG(5,("%s no share info at switch_value %d\n",
648 tab_depth(depth), ctr->switch_value));
655 /*******************************************************************
656 Inits a SRV_Q_NET_SHARE_ENUM structure.
657 ********************************************************************/
659 void init_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n,
660 char *srv_name, uint32 info_level,
661 uint32 preferred_len, ENUM_HND *hnd)
664 DEBUG(5,("init_q_net_share_enum\n"));
666 init_buf_unistr2(&q_n->uni_srv_name, &q_n->ptr_srv_name, srv_name);
668 q_n->ctr.info_level = q_n->ctr.switch_value = info_level;
669 q_n->ctr.ptr_share_info = 1;
670 q_n->ctr.num_entries = 0;
671 q_n->ctr.ptr_entries = 0;
672 q_n->preferred_len = preferred_len;
674 memcpy(&q_n->enum_hnd, hnd, sizeof(*hnd));
677 /*******************************************************************
678 Reads or writes a structure.
679 ********************************************************************/
681 BOOL srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth)
686 prs_debug(ps, depth, desc, "srv_io_q_net_share_enum");
692 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
694 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
697 if(!srv_io_srv_share_ctr("share_ctr", &q_n->ctr, ps, depth))
703 if(!prs_uint32("preferred_len", ps, depth, &q_n->preferred_len))
706 if(!smb_io_enum_hnd("enum_hnd", &q_n->enum_hnd, ps, depth))
712 /*******************************************************************
713 Reads or writes a structure.
714 ********************************************************************/
716 BOOL srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth)
721 prs_debug(ps, depth, desc, "srv_io_r_net_share_enum");
724 if(!srv_io_srv_share_ctr("share_ctr", &r_n->ctr, ps, depth))
730 if(!prs_uint32("total_entries", ps, depth, &r_n->total_entries))
732 if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
734 if(!prs_werror("status", ps, depth, &r_n->status))
740 /*******************************************************************
741 Reads or writes a structure.
742 ********************************************************************/
744 BOOL srv_io_q_net_share_get_info(char *desc, SRV_Q_NET_SHARE_GET_INFO *q_n, prs_struct *ps, int depth)
749 prs_debug(ps, depth, desc, "srv_io_q_net_share_get_info");
755 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
757 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
760 if(!smb_io_unistr2("", &q_n->uni_share_name, True, ps, depth))
766 if(!prs_uint32("info_level", ps, depth, &q_n->info_level))
772 /*******************************************************************
773 Reads or writes a structure.
774 ********************************************************************/
776 static BOOL srv_io_srv_share_info(char *desc, prs_struct *ps, int depth, SRV_SHARE_INFO *r_n)
781 prs_debug(ps, depth, desc, "srv_io_srv_share_info");
787 if(!prs_uint32("switch_value ", ps, depth, &r_n->switch_value ))
790 if(!prs_uint32("ptr_share_ctr", ps, depth, &r_n->ptr_share_ctr))
793 if (r_n->ptr_share_ctr != 0) {
794 switch (r_n->switch_value) {
796 if(!srv_io_share_info1("", &r_n->share.info1.info_1, ps, depth))
799 if(!srv_io_share_info1_str("", &r_n->share.info1.info_1_str, ps, depth))
804 if(!srv_io_share_info2("", &r_n->share.info2.info_2, ps, depth))
807 if(!srv_io_share_info2_str("", &r_n->share.info2.info_2, &r_n->share.info2.info_2_str, ps, depth))
812 if (!srv_io_share_info501("", &r_n->share.info501.info_501, ps, depth))
814 if (!srv_io_share_info501_str("", &r_n->share.info501.info_501_str, ps, depth))
819 if(!srv_io_share_info502("", &r_n->share.info502.info_502, ps, depth))
822 /*allow access to pointers in the str part. */
823 r_n->share.info502.info_502_str.ptrs = &r_n->share.info502.info_502;
825 if(!srv_io_share_info502_str("", &r_n->share.info502.info_502_str, ps, depth))
829 if(!srv_io_share_info1005("", &r_n->share.info1005, ps, depth))
833 if (!srv_io_share_info1501("", &r_n->share.info1501, ps, depth))
836 DEBUG(5,("%s no share info at switch_value %d\n",
837 tab_depth(depth), r_n->switch_value));
845 /*******************************************************************
846 Reads or writes a structure.
847 ********************************************************************/
849 BOOL srv_io_r_net_share_get_info(char *desc, SRV_R_NET_SHARE_GET_INFO *r_n, prs_struct *ps, int depth)
854 prs_debug(ps, depth, desc, "srv_io_r_net_share_get_info");
860 if(!srv_io_srv_share_info("info ", ps, depth, &r_n->info))
866 if(!prs_werror("status", ps, depth, &r_n->status))
872 /*******************************************************************
873 Reads or writes a structure.
874 ********************************************************************/
876 BOOL srv_io_q_net_share_set_info(char *desc, SRV_Q_NET_SHARE_SET_INFO *q_n, prs_struct *ps, int depth)
881 prs_debug(ps, depth, desc, "srv_io_q_net_share_set_info");
887 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
889 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
892 if(!smb_io_unistr2("", &q_n->uni_share_name, True, ps, depth))
898 if(!prs_uint32("info_level", ps, depth, &q_n->info_level))
904 if(!srv_io_srv_share_info("info ", ps, depth, &q_n->info))
910 /*******************************************************************
911 Reads or writes a structure.
912 ********************************************************************/
914 BOOL srv_io_r_net_share_set_info(char *desc, SRV_R_NET_SHARE_SET_INFO *q_n, prs_struct *ps, int depth)
919 prs_debug(ps, depth, desc, "srv_io_r_net_share_set_info");
925 if(!prs_uint32("switch_value ", ps, depth, &q_n->switch_value))
927 if(!prs_werror("status", ps, depth, &q_n->status))
933 /*******************************************************************
934 Reads or writes a structure.
935 ********************************************************************/
937 BOOL srv_io_q_net_share_add(char *desc, SRV_Q_NET_SHARE_ADD *q_n, prs_struct *ps, int depth)
942 prs_debug(ps, depth, desc, "srv_io_q_net_share_add");
948 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
950 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
956 if(!prs_uint32("info_level", ps, depth, &q_n->info_level))
962 if(!srv_io_srv_share_info("info ", ps, depth, &q_n->info))
965 if(!prs_uint32("ptr_err_index", ps, depth, &q_n->ptr_err_index))
967 if (q_n->ptr_err_index)
968 if (!prs_uint32("err_index", ps, depth, &q_n->err_index))
974 void init_srv_q_net_share_add(SRV_Q_NET_SHARE_ADD *q, char *srvname,
975 char *netname, uint32 type, char *remark,
976 uint32 perms, uint32 max_uses, uint32 num_uses,
977 char *path, char *passwd)
980 init_unistr2(&q->uni_srv_name, srvname, strlen(srvname) +1);
981 q->info.switch_value = q->info_level = 2;
983 q->info.ptr_share_ctr = 1;
984 init_srv_share_info2(&q->info.share.info2.info_2, netname, type,
985 remark, perms, max_uses, num_uses, path, passwd);
986 init_srv_share_info2_str(&q->info.share.info2.info_2_str, netname,
987 remark, path, passwd);
988 q->ptr_err_index = 1;
993 /*******************************************************************
994 Reads or writes a structure.
995 ********************************************************************/
997 BOOL srv_io_r_net_share_add(char *desc, SRV_R_NET_SHARE_ADD *q_n, prs_struct *ps, int depth)
1002 prs_debug(ps, depth, desc, "srv_io_r_net_share_add");
1008 if(!prs_uint32("switch_value ", ps, depth, &q_n->switch_value))
1010 if(!prs_werror("status", ps, depth, &q_n->status))
1016 void init_srv_q_net_share_del(SRV_Q_NET_SHARE_DEL *del, const char *srvname,
1017 const char *sharename)
1019 del->ptr_srv_name = 1;
1020 init_unistr2(&del->uni_srv_name, srvname, strlen(srvname) +1 );
1021 init_unistr2(&del->uni_share_name, sharename, strlen(sharename) + 1);
1024 /*******************************************************************
1025 Reads or writes a structure.
1026 ********************************************************************/
1028 BOOL srv_io_q_net_share_del(char *desc, SRV_Q_NET_SHARE_DEL *q_n, prs_struct *ps, int depth)
1033 prs_debug(ps, depth, desc, "srv_io_q_net_share_del");
1039 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
1041 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
1044 if(!smb_io_unistr2("", &q_n->uni_share_name, True, ps, depth))
1049 if(!prs_uint32("reserved", ps, depth, &q_n->reserved))
1055 /*******************************************************************
1056 Reads or writes a structure.
1057 ********************************************************************/
1059 BOOL srv_io_r_net_share_del(char *desc, SRV_R_NET_SHARE_DEL *q_n, prs_struct *ps, int depth)
1064 prs_debug(ps, depth, desc, "srv_io_r_net_share_del");
1070 if(!prs_werror("status", ps, depth, &q_n->status))
1076 /*******************************************************************
1077 Inits a SESS_INFO_0_STR structure
1078 ********************************************************************/
1080 void init_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name)
1082 DEBUG(5,("init_srv_sess_info0_str\n"));
1084 init_unistr2(&ss0->uni_name, name, strlen(name)+1);
1087 /*******************************************************************
1088 Reads or writes a structure.
1089 ********************************************************************/
1091 static BOOL srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth)
1096 prs_debug(ps, depth, desc, "srv_io_sess_info0_str");
1102 if(!smb_io_unistr2("", &ss0->uni_name, True, ps, depth))
1108 /*******************************************************************
1109 Inits a SESS_INFO_0 structure
1110 ********************************************************************/
1112 void init_srv_sess_info0(SESS_INFO_0 *ss0, char *name)
1114 DEBUG(5,("init_srv_sess_info0: %s\n", name));
1116 ss0->ptr_name = (name != NULL) ? 1 : 0;
1119 /*******************************************************************
1120 Reads or writes a structure.
1121 ********************************************************************/
1123 static BOOL srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth)
1128 prs_debug(ps, depth, desc, "srv_io_sess_info0");
1134 if(!prs_uint32("ptr_name", ps, depth, &ss0->ptr_name))
1140 /*******************************************************************
1141 Reads or writes a structure.
1142 ********************************************************************/
1144 static BOOL srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth)
1149 prs_debug(ps, depth, desc, "srv_io_srv_sess_info_0");
1155 if(!prs_uint32("num_entries_read", ps, depth, &ss0->num_entries_read))
1157 if(!prs_uint32("ptr_sess_info", ps, depth, &ss0->ptr_sess_info))
1160 if (ss0->ptr_sess_info != 0) {
1162 int num_entries = ss0->num_entries_read;
1164 if (num_entries > MAX_SESS_ENTRIES) {
1165 num_entries = MAX_SESS_ENTRIES; /* report this! */
1168 if(!prs_uint32("num_entries_read2", ps, depth, &ss0->num_entries_read2))
1171 SMB_ASSERT_ARRAY(ss0->info_0, num_entries);
1173 for (i = 0; i < num_entries; i++) {
1174 if(!srv_io_sess_info0("", &ss0->info_0[i], ps, depth))
1178 for (i = 0; i < num_entries; i++) {
1179 if(!srv_io_sess_info0_str("", &ss0->info_0_str[i], ps, depth))
1190 /*******************************************************************
1191 Inits a SESS_INFO_1_STR structure
1192 ********************************************************************/
1194 void init_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user)
1196 DEBUG(5,("init_srv_sess_info1_str\n"));
1198 init_unistr2(&ss1->uni_name, name, strlen(name)+1);
1199 init_unistr2(&ss1->uni_user, user, strlen(user)+1);
1202 /*******************************************************************
1203 Reads or writes a structure.
1204 ********************************************************************/
1206 static BOOL srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth)
1211 prs_debug(ps, depth, desc, "srv_io_sess_info1_str");
1217 if(!smb_io_unistr2("", &ss1->uni_name, True, ps, depth))
1219 if(!smb_io_unistr2("", &(ss1->uni_user), True, ps, depth))
1225 /*******************************************************************
1226 Inits a SESS_INFO_1 structure
1227 ********************************************************************/
1229 void init_srv_sess_info1(SESS_INFO_1 *ss1,
1230 char *name, char *user,
1231 uint32 num_opens, uint32 open_time, uint32 idle_time,
1234 DEBUG(5,("init_srv_sess_info1: %s\n", name));
1236 ss1->ptr_name = (name != NULL) ? 1 : 0;
1237 ss1->ptr_user = (user != NULL) ? 1 : 0;
1239 ss1->num_opens = num_opens;
1240 ss1->open_time = open_time;
1241 ss1->idle_time = idle_time;
1242 ss1->user_flags = user_flags;
1245 /*******************************************************************
1246 reads or writes a structure.
1247 ********************************************************************/
1249 static BOOL srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth)
1254 prs_debug(ps, depth, desc, "srv_io_sess_info1");
1260 if(!prs_uint32("ptr_name ", ps, depth, &ss1->ptr_name))
1262 if(!prs_uint32("ptr_user ", ps, depth, &ss1->ptr_user))
1265 if(!prs_uint32("num_opens ", ps, depth, &ss1->num_opens))
1267 if(!prs_uint32("open_time ", ps, depth, &ss1->open_time))
1269 if(!prs_uint32("idle_time ", ps, depth, &ss1->idle_time))
1271 if(!prs_uint32("user_flags", ps, depth, &ss1->user_flags))
1277 /*******************************************************************
1278 Reads or writes a structure.
1279 ********************************************************************/
1281 static BOOL srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth)
1286 prs_debug(ps, depth, desc, "srv_io_srv_sess_info_1");
1292 if(!prs_uint32("num_entries_read", ps, depth, &ss1->num_entries_read))
1294 if(!prs_uint32("ptr_sess_info", ps, depth, &ss1->ptr_sess_info))
1297 if (ss1->ptr_sess_info != 0) {
1299 int num_entries = ss1->num_entries_read;
1301 if (num_entries > MAX_SESS_ENTRIES) {
1302 num_entries = MAX_SESS_ENTRIES; /* report this! */
1305 if(!prs_uint32("num_entries_read2", ps, depth, &ss1->num_entries_read2))
1308 SMB_ASSERT_ARRAY(ss1->info_1, num_entries);
1310 for (i = 0; i < num_entries; i++) {
1311 if(!srv_io_sess_info1("", &ss1->info_1[i], ps, depth))
1315 for (i = 0; i < num_entries; i++) {
1316 if(!srv_io_sess_info1_str("", &ss1->info_1_str[i], ps, depth))
1327 /*******************************************************************
1328 Reads or writes a structure.
1329 ********************************************************************/
1331 static BOOL srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR **pp_ctr, prs_struct *ps, int depth)
1333 SRV_SESS_INFO_CTR *ctr = *pp_ctr;
1335 prs_debug(ps, depth, desc, "srv_io_srv_sess_ctr");
1338 if(UNMARSHALLING(ps)) {
1339 ctr = *pp_ctr = (SRV_SESS_INFO_CTR *)prs_alloc_mem(ps, sizeof(SRV_SESS_INFO_CTR));
1350 if(!prs_uint32("switch_value", ps, depth, &ctr->switch_value))
1352 if(!prs_uint32("ptr_sess_ctr", ps, depth, &ctr->ptr_sess_ctr))
1355 if (ctr->ptr_sess_ctr != 0) {
1356 switch (ctr->switch_value) {
1358 if(!srv_io_srv_sess_info_0("", &ctr->sess.info0, ps, depth))
1362 if(!srv_io_srv_sess_info_1("", &ctr->sess.info1, ps, depth))
1366 DEBUG(5,("%s no session info at switch_value %d\n",
1367 tab_depth(depth), ctr->switch_value));
1375 /*******************************************************************
1376 Inits a SRV_Q_NET_SESS_ENUM structure.
1377 ********************************************************************/
1379 void init_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n,
1380 char *srv_name, char *qual_name,
1381 char *user_name, uint32 sess_level,
1382 SRV_SESS_INFO_CTR *ctr, uint32 preferred_len,
1387 DEBUG(5,("init_q_net_sess_enum\n"));
1389 init_buf_unistr2(&q_n->uni_srv_name, &q_n->ptr_srv_name, srv_name);
1390 init_buf_unistr2(&q_n->uni_qual_name, &q_n->ptr_qual_name, qual_name);
1391 init_buf_unistr2(&q_n->uni_user_name, &q_n->ptr_user_name, user_name);
1393 q_n->sess_level = sess_level;
1394 q_n->preferred_len = preferred_len;
1396 memcpy(&q_n->enum_hnd, hnd, sizeof(*hnd));
1399 /*******************************************************************
1400 Reads or writes a structure.
1401 ********************************************************************/
1403 BOOL srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth)
1408 prs_debug(ps, depth, desc, "srv_io_q_net_sess_enum");
1414 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
1416 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
1422 if(!prs_uint32("ptr_qual_name", ps, depth, &q_n->ptr_qual_name))
1424 if(!smb_io_unistr2("", &q_n->uni_qual_name, q_n->ptr_qual_name, ps, depth))
1429 if(!prs_uint32("ptr_user_name", ps, depth, &q_n->ptr_user_name))
1431 if(!smb_io_unistr2("", &q_n->uni_user_name, q_n->ptr_user_name, ps, depth))
1437 if(!prs_uint32("sess_level", ps, depth, &q_n->sess_level))
1440 if (q_n->sess_level != -1) {
1441 if(!srv_io_srv_sess_ctr("sess_ctr", &q_n->ctr, ps, depth))
1445 if(!prs_uint32("preferred_len", ps, depth, &q_n->preferred_len))
1448 if(!smb_io_enum_hnd("enum_hnd", &q_n->enum_hnd, ps, depth))
1454 /*******************************************************************
1455 Reads or writes a structure.
1456 ********************************************************************/
1458 BOOL srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth)
1463 prs_debug(ps, depth, desc, "srv_io_r_net_sess_enum");
1469 if(!prs_uint32("sess_level", ps, depth, &r_n->sess_level))
1472 if (r_n->sess_level != -1) {
1473 if(!srv_io_srv_sess_ctr("sess_ctr", &r_n->ctr, ps, depth))
1477 if(!prs_uint32("total_entries", ps, depth, &r_n->total_entries))
1479 if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
1481 if(!prs_werror("status", ps, depth, &r_n->status))
1487 /*******************************************************************
1488 Inits a CONN_INFO_0 structure
1489 ********************************************************************/
1491 void init_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id)
1493 DEBUG(5,("init_srv_conn_info0\n"));
1498 /*******************************************************************
1499 Reads or writes a structure.
1500 ********************************************************************/
1502 static BOOL srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth)
1507 prs_debug(ps, depth, desc, "srv_io_conn_info0");
1513 if(!prs_uint32("id", ps, depth, &ss0->id))
1519 /*******************************************************************
1520 Reads or writes a structure.
1521 ********************************************************************/
1523 static BOOL srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth)
1528 prs_debug(ps, depth, desc, "srv_io_srv_conn_info_0");
1534 if(!prs_uint32("num_entries_read", ps, depth, &ss0->num_entries_read))
1536 if(!prs_uint32("ptr_conn_info", ps, depth, &ss0->ptr_conn_info))
1539 if (ss0->ptr_conn_info != 0) {
1541 int num_entries = ss0->num_entries_read;
1543 if (num_entries > MAX_CONN_ENTRIES) {
1544 num_entries = MAX_CONN_ENTRIES; /* report this! */
1547 if(!prs_uint32("num_entries_read2", ps, depth, &ss0->num_entries_read2))
1550 for (i = 0; i < num_entries; i++) {
1551 if(!srv_io_conn_info0("", &ss0->info_0[i], ps, depth))
1562 /*******************************************************************
1563 Inits a CONN_INFO_1_STR structure
1564 ********************************************************************/
1566 void init_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name)
1568 DEBUG(5,("init_srv_conn_info1_str\n"));
1570 init_unistr2(&ss1->uni_usr_name, usr_name, strlen(usr_name)+1);
1571 init_unistr2(&ss1->uni_net_name, net_name, strlen(net_name)+1);
1574 /*******************************************************************
1575 Reads or writes a structure.
1576 ********************************************************************/
1578 static BOOL srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth)
1583 prs_debug(ps, depth, desc, "srv_io_conn_info1_str");
1589 if(!smb_io_unistr2("", &ss1->uni_usr_name, True, ps, depth))
1591 if(!smb_io_unistr2("", &ss1->uni_net_name, True, ps, depth))
1597 /*******************************************************************
1598 Inits a CONN_INFO_1 structure
1599 ********************************************************************/
1601 void init_srv_conn_info1(CONN_INFO_1 *ss1,
1602 uint32 id, uint32 type,
1603 uint32 num_opens, uint32 num_users, uint32 open_time,
1604 char *usr_name, char *net_name)
1606 DEBUG(5,("init_srv_conn_info1: %s %s\n", usr_name, net_name));
1610 ss1->num_opens = num_opens ;
1611 ss1->num_users = num_users;
1612 ss1->open_time = open_time;
1614 ss1->ptr_usr_name = (usr_name != NULL) ? 1 : 0;
1615 ss1->ptr_net_name = (net_name != NULL) ? 1 : 0;
1618 /*******************************************************************
1619 Reads or writes a structure.
1620 ********************************************************************/
1622 static BOOL srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth)
1627 prs_debug(ps, depth, desc, "srv_io_conn_info1");
1633 if(!prs_uint32("id ", ps, depth, &ss1->id))
1635 if(!prs_uint32("type ", ps, depth, &ss1->type))
1637 if(!prs_uint32("num_opens ", ps, depth, &ss1->num_opens))
1639 if(!prs_uint32("num_users ", ps, depth, &ss1->num_users))
1641 if(!prs_uint32("open_time ", ps, depth, &ss1->open_time))
1644 if(!prs_uint32("ptr_usr_name", ps, depth, &ss1->ptr_usr_name))
1646 if(!prs_uint32("ptr_net_name", ps, depth, &ss1->ptr_net_name))
1652 /*******************************************************************
1653 Reads or writes a structure.
1654 ********************************************************************/
1656 static BOOL srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth)
1661 prs_debug(ps, depth, desc, "srv_io_srv_conn_info_1");
1667 if(!prs_uint32("num_entries_read", ps, depth, &ss1->num_entries_read))
1669 if(!prs_uint32("ptr_conn_info", ps, depth, &ss1->ptr_conn_info))
1672 if (ss1->ptr_conn_info != 0) {
1674 int num_entries = ss1->num_entries_read;
1676 if (num_entries > MAX_CONN_ENTRIES) {
1677 num_entries = MAX_CONN_ENTRIES; /* report this! */
1680 if(!prs_uint32("num_entries_read2", ps, depth, &ss1->num_entries_read2))
1683 for (i = 0; i < num_entries; i++) {
1684 if(!srv_io_conn_info1("", &ss1->info_1[i], ps, depth))
1688 for (i = 0; i < num_entries; i++) {
1689 if(!srv_io_conn_info1_str("", &ss1->info_1_str[i], ps, depth))
1700 /*******************************************************************
1701 Reads or writes a structure.
1702 ********************************************************************/
1704 static BOOL srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR **pp_ctr, prs_struct *ps, int depth)
1706 SRV_CONN_INFO_CTR *ctr = *pp_ctr;
1708 prs_debug(ps, depth, desc, "srv_io_srv_conn_ctr");
1711 if (UNMARSHALLING(ps)) {
1712 ctr = *pp_ctr = (SRV_CONN_INFO_CTR *)prs_alloc_mem(ps, sizeof(SRV_CONN_INFO_CTR));
1723 if(!prs_uint32("switch_value", ps, depth, &ctr->switch_value))
1725 if(!prs_uint32("ptr_conn_ctr", ps, depth, &ctr->ptr_conn_ctr))
1728 if (ctr->ptr_conn_ctr != 0) {
1729 switch (ctr->switch_value) {
1731 if(!srv_io_srv_conn_info_0("", &ctr->conn.info0, ps, depth))
1735 if(!srv_io_srv_conn_info_1("", &ctr->conn.info1, ps, depth))
1739 DEBUG(5,("%s no connection info at switch_value %d\n",
1740 tab_depth(depth), ctr->switch_value));
1748 /*******************************************************************
1749 Reads or writes a structure.
1750 ********************************************************************/
1752 void init_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n,
1753 char *srv_name, char *qual_name,
1754 uint32 conn_level, SRV_CONN_INFO_CTR *ctr,
1755 uint32 preferred_len,
1758 DEBUG(5,("init_q_net_conn_enum\n"));
1762 init_buf_unistr2(&q_n->uni_srv_name, &q_n->ptr_srv_name, srv_name );
1763 init_buf_unistr2(&q_n->uni_qual_name, &q_n->ptr_qual_name, qual_name);
1765 q_n->conn_level = conn_level;
1766 q_n->preferred_len = preferred_len;
1768 memcpy(&q_n->enum_hnd, hnd, sizeof(*hnd));
1771 /*******************************************************************
1772 Reads or writes a structure.
1773 ********************************************************************/
1775 BOOL srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth)
1780 prs_debug(ps, depth, desc, "srv_io_q_net_conn_enum");
1786 if(!prs_uint32("ptr_srv_name ", ps, depth, &q_n->ptr_srv_name))
1788 if(!smb_io_unistr2("", &q_n->uni_srv_name, q_n->ptr_srv_name, ps, depth))
1794 if(!prs_uint32("ptr_qual_name", ps, depth, &q_n->ptr_qual_name))
1796 if(!smb_io_unistr2("", &q_n->uni_qual_name, q_n->ptr_qual_name, ps, depth))
1802 if(!prs_uint32("conn_level", ps, depth, &q_n->conn_level))
1805 if (q_n->conn_level != -1) {
1806 if(!srv_io_srv_conn_ctr("conn_ctr", &q_n->ctr, ps, depth))
1810 if(!prs_uint32("preferred_len", ps, depth, &q_n->preferred_len))
1813 if(!smb_io_enum_hnd("enum_hnd", &q_n->enum_hnd, ps, depth))
1819 /*******************************************************************
1820 Reads or writes a structure.
1821 ********************************************************************/
1823 BOOL srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth)
1828 prs_debug(ps, depth, desc, "srv_io_r_net_conn_enum");
1834 if(!prs_uint32("conn_level", ps, depth, &r_n->conn_level))
1837 if (r_n->conn_level != -1) {
1838 if(!srv_io_srv_conn_ctr("conn_ctr", &r_n->ctr, ps, depth))
1842 if(!prs_uint32("total_entries", ps, depth, &r_n->total_entries))
1844 if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
1846 if(!prs_werror("status", ps, depth, &r_n->status))
1852 /*******************************************************************
1853 Inits a FILE_INFO_3_STR structure
1854 ********************************************************************/
1856 void init_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name)
1858 DEBUG(5,("init_srv_file_info3_str\n"));
1860 init_unistr2(&fi3->uni_path_name, path_name, strlen(path_name)+1);
1861 init_unistr2(&fi3->uni_user_name, user_name, strlen(user_name)+1);
1864 /*******************************************************************
1865 Reads or writes a structure.
1866 ********************************************************************/
1868 static BOOL srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth)
1873 prs_debug(ps, depth, desc, "srv_io_file_info3_str");
1879 if(!smb_io_unistr2("", &sh1->uni_path_name, True, ps, depth))
1881 if(!smb_io_unistr2("", &sh1->uni_user_name, True, ps, depth))
1887 /*******************************************************************
1888 Inits a FILE_INFO_3 structure
1889 ********************************************************************/
1891 void init_srv_file_info3(FILE_INFO_3 *fl3,
1892 uint32 id, uint32 perms, uint32 num_locks,
1893 char *path_name, char *user_name)
1895 DEBUG(5,("init_srv_file_info3: %s %s\n", path_name, user_name));
1899 fl3->num_locks = num_locks;
1901 fl3->ptr_path_name = (path_name != NULL) ? 1 : 0;
1902 fl3->ptr_user_name = (user_name != NULL) ? 1 : 0;
1905 /*******************************************************************
1906 Reads or writes a structure.
1907 ********************************************************************/
1909 static BOOL srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth)
1914 prs_debug(ps, depth, desc, "srv_io_file_info3");
1920 if(!prs_uint32("id ", ps, depth, &fl3->id))
1922 if(!prs_uint32("perms ", ps, depth, &fl3->perms))
1924 if(!prs_uint32("num_locks ", ps, depth, &fl3->num_locks))
1926 if(!prs_uint32("ptr_path_name", ps, depth, &fl3->ptr_path_name))
1928 if(!prs_uint32("ptr_user_name", ps, depth, &fl3->ptr_user_name))
1934 /*******************************************************************
1935 Reads or writes a structure.
1936 ********************************************************************/
1938 static BOOL srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth)
1943 prs_debug(ps, depth, desc, "srv_io_srv_file_ctr");
1946 if (UNMARSHALLING(ps)) {
1947 memset(ctr, '\0', sizeof(SRV_FILE_INFO_CTR));
1953 if(!prs_uint32("switch_value", ps, depth, &ctr->switch_value))
1955 if (ctr->switch_value != 3) {
1956 DEBUG(5,("%s File info %d level not supported\n",
1957 tab_depth(depth), ctr->switch_value));
1959 if(!prs_uint32("ptr_file_info", ps, depth, &ctr->ptr_file_info))
1961 if(!prs_uint32("num_entries", ps, depth, &ctr->num_entries))
1963 if(!prs_uint32("ptr_entries", ps, depth, &ctr->ptr_entries))
1965 if (ctr->ptr_entries == 0)
1967 if(!prs_uint32("num_entries2", ps, depth,
1968 &ctr->num_entries2))
1971 switch (ctr->switch_value) {
1973 SRV_FILE_INFO_3 *info3 = ctr->file.info3;
1974 int num_entries = ctr->num_entries;
1977 if (UNMARSHALLING(ps)) {
1978 if (!(info3 = (SRV_FILE_INFO_3 *)prs_alloc_mem(ps, num_entries * sizeof(SRV_FILE_INFO_3))))
1980 ctr->file.info3 = info3;
1983 for (i = 0; i < num_entries; i++) {
1984 if(!srv_io_file_info3("", &ctr->file.info3[i].info_3, ps, depth))
1987 for (i = 0; i < num_entries; i++) {
1988 if(!srv_io_file_info3_str("", &ctr->file.info3[i].info_3_str, ps, depth))
1994 DEBUG(5,("%s no file info at switch_value %d\n",
1995 tab_depth(depth), ctr->switch_value));
2002 /*******************************************************************
2003 Inits a SRV_Q_NET_FILE_ENUM structure.
2004 ********************************************************************/
2006 void init_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n,
2007 const char *srv_name, const char *qual_name,
2008 const char *user_name,
2009 uint32 file_level, SRV_FILE_INFO_CTR *ctr,
2010 uint32 preferred_len,
2013 DEBUG(5,("init_q_net_file_enum\n"));
2015 init_buf_unistr2(&q_n->uni_srv_name, &q_n->ptr_srv_name, srv_name);
2016 init_buf_unistr2(&q_n->uni_qual_name, &q_n->ptr_qual_name, qual_name);
2017 init_buf_unistr2(&q_n->uni_user_name, &q_n->ptr_user_name, user_name);
2019 q_n->file_level = q_n->ctr.switch_value = file_level;
2020 q_n->preferred_len = preferred_len;
2021 q_n->ctr.ptr_file_info = 1;
2022 q_n->ctr.num_entries = 0;
2023 q_n->ctr.num_entries2 = 0;
2025 memcpy(&q_n->enum_hnd, hnd, sizeof(*hnd));
2028 /*******************************************************************
2029 Reads or writes a structure.
2030 ********************************************************************/
2032 BOOL srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth)
2037 prs_debug(ps, depth, desc, "srv_io_q_net_file_enum");
2043 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
2045 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2051 if(!prs_uint32("ptr_qual_name", ps, depth, &q_n->ptr_qual_name))
2053 if(!smb_io_unistr2("", &q_n->uni_qual_name, q_n->ptr_qual_name, ps, depth))
2059 if(!prs_uint32("ptr_user_name", ps, depth, &q_n->ptr_user_name))
2061 if(!smb_io_unistr2("", &q_n->uni_user_name, q_n->ptr_user_name, ps, depth))
2066 if(!prs_uint32("file_level", ps, depth, &q_n->file_level))
2069 if (q_n->file_level != -1) {
2070 if(!srv_io_srv_file_ctr("file_ctr", &q_n->ctr, ps, depth))
2074 if(!prs_uint32("preferred_len", ps, depth, &q_n->preferred_len))
2077 if(!smb_io_enum_hnd("enum_hnd", &q_n->enum_hnd, ps, depth))
2083 /*******************************************************************
2084 Reads or writes a structure.
2085 ********************************************************************/
2087 BOOL srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth)
2092 prs_debug(ps, depth, desc, "srv_io_r_net_file_enum");
2098 if(!prs_uint32("file_level", ps, depth, &r_n->file_level))
2101 if (r_n->file_level != 0) {
2102 if(!srv_io_srv_file_ctr("file_ctr", &r_n->ctr, ps, depth))
2106 if(!prs_uint32("total_entries", ps, depth, &r_n->total_entries))
2108 if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
2110 if(!prs_werror("status", ps, depth, &r_n->status))
2116 /*******************************************************************
2117 Initialize a net file close request
2118 ********************************************************************/
2119 void init_srv_q_net_file_close(SRV_Q_NET_FILE_CLOSE *q_n, char *server,
2122 q_n->ptr_srv_name = 1;
2123 init_unistr2(&q_n->uni_srv_name, server, strlen(server) + 1);
2124 q_n->file_id = file_id;
2127 /*******************************************************************
2128 Reads or writes a structure.
2129 ********************************************************************/
2130 BOOL srv_io_q_net_file_close(char *desc, SRV_Q_NET_FILE_CLOSE *q_n,
2131 prs_struct *ps, int depth)
2136 prs_debug(ps, depth, desc, "srv_io_q_net_file_close");
2142 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
2144 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2150 if(!prs_uint32("file_id", ps, depth, &q_n->file_id))
2156 /*******************************************************************
2157 Reads or writes a structure.
2158 ********************************************************************/
2160 BOOL srv_io_r_net_file_close(char *desc, SRV_R_NET_FILE_CLOSE *q_n,
2161 prs_struct *ps, int depth)
2166 prs_debug(ps, depth, desc, "srv_io_r_net_file_close");
2172 if(!prs_werror("status", ps, depth, &q_n->status))
2178 /*******************************************************************
2179 Inits a SRV_INFO_100 structure.
2180 ********************************************************************/
2182 void init_srv_info_100(SRV_INFO_100 *sv100, uint32 platform_id, char *name)
2184 DEBUG(5,("init_srv_info_100\n"));
2186 sv100->platform_id = platform_id;
2187 init_buf_unistr2(&sv100->uni_name, &sv100->ptr_name, name);
2190 /*******************************************************************
2191 Reads or writes a SRV_INFO_101 structure.
2192 ********************************************************************/
2194 static BOOL srv_io_info_100(char *desc, SRV_INFO_100 *sv100, prs_struct *ps, int depth)
2199 prs_debug(ps, depth, desc, "srv_io_info_100");
2205 if(!prs_uint32("platform_id ", ps, depth, &sv100->platform_id))
2207 if(!prs_uint32("ptr_name ", ps, depth, &sv100->ptr_name))
2210 if(!smb_io_unistr2("uni_name ", &sv100->uni_name, True, ps, depth))
2217 /*******************************************************************
2218 Inits a SRV_INFO_101 structure.
2219 ********************************************************************/
2221 void init_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name,
2222 uint32 ver_major, uint32 ver_minor,
2223 uint32 srv_type, char *comment)
2225 DEBUG(5,("init_srv_info_101\n"));
2227 sv101->platform_id = platform_id;
2228 init_buf_unistr2(&sv101->uni_name, &sv101->ptr_name, name);
2229 sv101->ver_major = ver_major;
2230 sv101->ver_minor = ver_minor;
2231 sv101->srv_type = srv_type;
2232 init_buf_unistr2(&sv101->uni_comment, &sv101->ptr_comment, comment);
2235 /*******************************************************************
2236 Reads or writes a SRV_INFO_101 structure.
2237 ********************************************************************/
2239 static BOOL srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth)
2244 prs_debug(ps, depth, desc, "srv_io_info_101");
2250 if(!prs_uint32("platform_id ", ps, depth, &sv101->platform_id))
2252 if(!prs_uint32("ptr_name ", ps, depth, &sv101->ptr_name))
2254 if(!prs_uint32("ver_major ", ps, depth, &sv101->ver_major))
2256 if(!prs_uint32("ver_minor ", ps, depth, &sv101->ver_minor))
2258 if(!prs_uint32("srv_type ", ps, depth, &sv101->srv_type))
2260 if(!prs_uint32("ptr_comment ", ps, depth, &sv101->ptr_comment))
2266 if(!smb_io_unistr2("uni_name ", &sv101->uni_name, True, ps, depth))
2268 if(!smb_io_unistr2("uni_comment ", &sv101->uni_comment, True, ps, depth))
2274 /*******************************************************************
2275 Inits a SRV_INFO_102 structure.
2276 ********************************************************************/
2278 void init_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name,
2279 char *comment, uint32 ver_major, uint32 ver_minor,
2280 uint32 srv_type, uint32 users, uint32 disc, uint32 hidden,
2281 uint32 announce, uint32 ann_delta, uint32 licenses,
2284 DEBUG(5,("init_srv_info_102\n"));
2286 sv102->platform_id = platform_id;
2287 init_buf_unistr2(&sv102->uni_name, &sv102->ptr_name, name);
2288 sv102->ver_major = ver_major;
2289 sv102->ver_minor = ver_minor;
2290 sv102->srv_type = srv_type;
2291 init_buf_unistr2(&sv102->uni_comment, &sv102->ptr_comment, comment);
2293 /* same as 101 up to here */
2295 sv102->users = users;
2297 sv102->hidden = hidden;
2298 sv102->announce = announce;
2299 sv102->ann_delta =ann_delta;
2300 sv102->licenses = licenses;
2301 init_buf_unistr2(&sv102->uni_usr_path, &sv102->ptr_usr_path, usr_path);
2305 /*******************************************************************
2306 Reads or writes a SRV_INFO_102 structure.
2307 ********************************************************************/
2309 static BOOL srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth)
2314 prs_debug(ps, depth, desc, "srv_io_info102");
2320 if(!prs_uint32("platform_id ", ps, depth, &sv102->platform_id))
2322 if(!prs_uint32("ptr_name ", ps, depth, &sv102->ptr_name))
2324 if(!prs_uint32("ver_major ", ps, depth, &sv102->ver_major))
2326 if(!prs_uint32("ver_minor ", ps, depth, &sv102->ver_minor))
2328 if(!prs_uint32("srv_type ", ps, depth, &sv102->srv_type))
2330 if(!prs_uint32("ptr_comment ", ps, depth, &sv102->ptr_comment))
2333 /* same as 101 up to here */
2335 if(!prs_uint32("users ", ps, depth, &sv102->users))
2337 if(!prs_uint32("disc ", ps, depth, &sv102->disc))
2339 if(!prs_uint32("hidden ", ps, depth, &sv102->hidden))
2341 if(!prs_uint32("announce ", ps, depth, &sv102->announce))
2343 if(!prs_uint32("ann_delta ", ps, depth, &sv102->ann_delta))
2345 if(!prs_uint32("licenses ", ps, depth, &sv102->licenses))
2347 if(!prs_uint32("ptr_usr_path", ps, depth, &sv102->ptr_usr_path))
2350 if(!smb_io_unistr2("uni_name ", &sv102->uni_name, True, ps, depth))
2354 if(!smb_io_unistr2("uni_comment ", &sv102->uni_comment, True, ps, depth))
2358 if(!smb_io_unistr2("uni_usr_path", &sv102->uni_usr_path, True, ps, depth))
2364 /*******************************************************************
2365 Reads or writes a SRV_INFO_102 structure.
2366 ********************************************************************/
2368 static BOOL srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth)
2373 prs_debug(ps, depth, desc, "srv_io_info_ctr");
2379 if(!prs_uint32("switch_value", ps, depth, &ctr->switch_value))
2381 if(!prs_uint32("ptr_srv_ctr ", ps, depth, &ctr->ptr_srv_ctr))
2384 if (ctr->ptr_srv_ctr != 0 && ctr->switch_value != 0 && ctr != NULL) {
2385 switch (ctr->switch_value) {
2387 if(!srv_io_info_100("sv100", &ctr->srv.sv100, ps, depth))
2391 if(!srv_io_info_101("sv101", &ctr->srv.sv101, ps, depth))
2395 if(!srv_io_info_102("sv102", &ctr->srv.sv102, ps, depth))
2399 DEBUG(5,("%s no server info at switch_value %d\n",
2400 tab_depth(depth), ctr->switch_value));
2410 /*******************************************************************
2411 Inits a SRV_Q_NET_SRV_GET_INFO structure.
2412 ********************************************************************/
2414 void init_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv,
2415 char *server_name, uint32 switch_value)
2417 DEBUG(5,("init_srv_q_net_srv_get_info\n"));
2419 init_buf_unistr2(&srv->uni_srv_name, &srv->ptr_srv_name, server_name);
2421 srv->switch_value = switch_value;
2424 /*******************************************************************
2425 Reads or writes a structure.
2426 ********************************************************************/
2428 BOOL srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth)
2433 prs_debug(ps, depth, desc, "srv_io_q_net_srv_get_info");
2439 if(!prs_uint32("ptr_srv_name ", ps, depth, &q_n->ptr_srv_name))
2441 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2447 if(!prs_uint32("switch_value ", ps, depth, &q_n->switch_value))
2453 /*******************************************************************
2454 Inits a SRV_R_NET_SRV_GET_INFO structure.
2455 ********************************************************************/
2457 void init_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv,
2458 uint32 switch_value, SRV_INFO_CTR *ctr, WERROR status)
2460 DEBUG(5,("init_srv_r_net_srv_get_info\n"));
2464 if (W_ERROR_IS_OK(status)) {
2465 srv->ctr->switch_value = switch_value;
2466 srv->ctr->ptr_srv_ctr = 1;
2468 srv->ctr->switch_value = 0;
2469 srv->ctr->ptr_srv_ctr = 0;
2472 srv->status = status;
2475 /*******************************************************************
2476 Inits a SRV_R_NET_SRV_SET_INFO structure.
2477 ********************************************************************/
2479 void init_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv,
2480 uint32 switch_value, WERROR status)
2482 DEBUG(5,("init_srv_r_net_srv_set_info\n"));
2484 srv->switch_value = switch_value;
2485 srv->status = status;
2488 /*******************************************************************
2489 Reads or writes a structure.
2490 ********************************************************************/
2492 BOOL srv_io_q_net_srv_set_info(char *desc, SRV_Q_NET_SRV_SET_INFO *q_n,
2493 prs_struct *ps, int depth)
2495 prs_debug(ps, depth, desc, "srv_io_q_net_srv_set_info");
2501 if(!prs_uint32("ptr_srv_name ", ps, depth, &q_n->ptr_srv_name))
2503 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2509 if(!prs_uint32("switch_value ", ps, depth, &q_n->switch_value))
2512 if (UNMARSHALLING(ps)) {
2513 q_n->ctr = (SRV_INFO_CTR *)
2514 prs_alloc_mem(ps, sizeof(SRV_INFO_CTR));
2520 if(!srv_io_info_ctr("ctr", q_n->ctr, ps, depth))
2526 /*******************************************************************
2527 Reads or writes a structure.
2528 ********************************************************************/
2530 BOOL srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth)
2535 prs_debug(ps, depth, desc, "srv_io_r_net_srv_get_info");
2541 if(!srv_io_info_ctr("ctr", r_n->ctr, ps, depth))
2544 if(!prs_werror("status", ps, depth, &r_n->status))
2550 /*******************************************************************
2551 Reads or writes a structure.
2552 ********************************************************************/
2554 BOOL srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n,
2555 prs_struct *ps, int depth)
2557 prs_debug(ps, depth, desc, "srv_io_r_net_srv_set_info");
2563 if(!prs_uint32("switch_value ", ps, depth, &r_n->switch_value))
2566 if(!prs_werror("status", ps, depth, &r_n->status))
2572 /*******************************************************************
2573 Reads or writes a structure.
2574 ********************************************************************/
2576 BOOL srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth)
2581 prs_debug(ps, depth, desc, "srv_io_q_net_remote_tod");
2587 if(!prs_uint32("ptr_srv_name ", ps, depth, &q_n->ptr_srv_name))
2589 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2595 /*******************************************************************
2596 Reads or writes a TIME_OF_DAY_INFO structure.
2597 ********************************************************************/
2599 static BOOL srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth)
2604 prs_debug(ps, depth, desc, "srv_io_time_of_day_info");
2610 if(!prs_uint32("elapsedt ", ps, depth, &tod->elapsedt))
2612 if(!prs_uint32("msecs ", ps, depth, &tod->msecs))
2614 if(!prs_uint32("hours ", ps, depth, &tod->hours))
2616 if(!prs_uint32("mins ", ps, depth, &tod->mins))
2618 if(!prs_uint32("secs ", ps, depth, &tod->secs))
2620 if(!prs_uint32("hunds ", ps, depth, &tod->hunds))
2622 if(!prs_uint32("timezone ", ps, depth, &tod->zone))
2624 if(!prs_uint32("tintervals ", ps, depth, &tod->tintervals))
2626 if(!prs_uint32("day ", ps, depth, &tod->day))
2628 if(!prs_uint32("month ", ps, depth, &tod->month))
2630 if(!prs_uint32("year ", ps, depth, &tod->year))
2632 if(!prs_uint32("weekday ", ps, depth, &tod->weekday))
2638 /*******************************************************************
2639 Inits a TIME_OF_DAY_INFO structure.
2640 ********************************************************************/
2642 void init_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs,
2643 uint32 hours, uint32 mins, uint32 secs, uint32 hunds,
2644 uint32 zone, uint32 tintervals, uint32 day,
2645 uint32 month, uint32 year, uint32 weekday)
2647 DEBUG(5,("init_time_of_day_info\n"));
2649 tod->elapsedt = elapsedt;
2656 tod->tintervals = tintervals;
2660 tod->weekday = weekday;
2664 /*******************************************************************
2665 Reads or writes a structure.
2666 ********************************************************************/
2668 BOOL srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth)
2673 prs_debug(ps, depth, desc, "srv_io_r_net_remote_tod");
2679 if(!prs_uint32("ptr_srv_tod ", ps, depth, &r_n->ptr_srv_tod))
2682 if(!srv_io_time_of_day_info("tod", r_n->tod, ps, depth))
2685 if(!prs_werror("status", ps, depth, &r_n->status))
2691 /*******************************************************************
2692 Reads or writes a structure.
2693 ********************************************************************/
2695 BOOL srv_io_q_net_disk_enum(char *desc, SRV_Q_NET_DISK_ENUM *q_n, prs_struct *ps, int depth)
2700 prs_debug(ps, depth, desc, "srv_io_q_net_disk_enum");
2706 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
2709 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2715 if(!prs_uint32("level", ps, depth, &q_n->disk_enum_ctr.level))
2718 if(!prs_uint32("entries_read", ps, depth, &q_n->disk_enum_ctr.entries_read))
2721 if(!prs_uint32("buffer", ps, depth, &q_n->disk_enum_ctr.disk_info_ptr))
2727 if(!prs_uint32("preferred_len", ps, depth, &q_n->preferred_len))
2729 if(!smb_io_enum_hnd("enum_hnd", &q_n->enum_hnd, ps, depth))
2735 /*******************************************************************
2736 Reads or writes a structure.
2737 ********************************************************************/
2739 BOOL srv_io_r_net_disk_enum(char *desc, SRV_R_NET_DISK_ENUM *r_n, prs_struct *ps, int depth)
2746 prs_debug(ps, depth, desc, "srv_io_r_net_disk_enum");
2752 if(!prs_uint32("entries_read", ps, depth, &r_n->disk_enum_ctr.entries_read))
2754 if(!prs_uint32("ptr_disk_info", ps, depth, &r_n->disk_enum_ctr.disk_info_ptr))
2757 /*this may be max, unknown, actual?*/
2759 if(!prs_uint32("max_elements", ps, depth, &r_n->disk_enum_ctr.entries_read))
2761 if(!prs_uint32("unknown", ps, depth, &r_n->disk_enum_ctr.unknown))
2763 if(!prs_uint32("actual_elements", ps, depth, &r_n->disk_enum_ctr.entries_read))
2766 for(i=0; i < r_n->disk_enum_ctr.entries_read; i++) {
2768 if(!prs_uint32("unknown", ps, depth, &r_n->disk_enum_ctr.disk_info[i].unknown))
2771 if(!smb_io_unistr3("disk_name", &r_n->disk_enum_ctr.disk_info[i].disk_name, ps, depth))
2778 if(!prs_uint32("total_entries", ps, depth, &r_n->total_entries))
2781 if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
2784 if(!prs_werror("status", ps, depth, &r_n->status))
2790 /*******************************************************************
2791 Reads or writes a structure.
2792 ********************************************************************/
2794 BOOL srv_io_q_net_name_validate(char *desc, SRV_Q_NET_NAME_VALIDATE *q_n, prs_struct *ps, int depth)
2799 prs_debug(ps, depth, desc, "srv_io_q_net_name_validate");
2805 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
2808 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2814 if(!smb_io_unistr2("", &q_n->uni_name, True, ps, depth))
2820 if(!prs_uint32("type", ps, depth, &q_n->type))
2823 if(!prs_uint32("flags", ps, depth, &q_n->flags))
2829 /*******************************************************************
2830 Reads or writes a structure.
2831 ********************************************************************/
2833 BOOL srv_io_r_net_name_validate(char *desc, SRV_R_NET_NAME_VALIDATE *r_n, prs_struct *ps, int depth)
2838 prs_debug(ps, depth, desc, "srv_io_r_net_name_validate");
2844 if(!prs_werror("status", ps, depth, &r_n->status))
2850 /*******************************************************************
2851 Reads or writes a structure.
2852 ********************************************************************/
2854 BOOL srv_io_q_net_file_query_secdesc(char *desc, SRV_Q_NET_FILE_QUERY_SECDESC *q_n, prs_struct *ps, int depth)
2859 prs_debug(ps, depth, desc, "srv_io_q_net_file_query_secdesc");
2865 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
2868 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2874 if(!prs_uint32("ptr_qual_name", ps, depth, &q_n->ptr_qual_name))
2877 if(!smb_io_unistr2("", &q_n->uni_qual_name, True, ps, depth))
2883 if(!smb_io_unistr2("", &q_n->uni_file_name, True, ps, depth))
2886 if(!prs_uint32("unknown1", ps, depth, &q_n->unknown1))
2889 if(!prs_uint32("unknown2", ps, depth, &q_n->unknown2))
2892 if(!prs_uint32("unknown3", ps, depth, &q_n->unknown3))
2898 /*******************************************************************
2899 Reads or writes a structure.
2900 ********************************************************************/
2902 BOOL srv_io_r_net_file_query_secdesc(char *desc, SRV_R_NET_FILE_QUERY_SECDESC *r_n, prs_struct *ps, int depth)
2907 prs_debug(ps, depth, desc, "srv_io_r_net_file_query_secdesc");
2913 if(!prs_uint32("ptr_response", ps, depth, &r_n->ptr_response))
2916 if(!prs_uint32("size_response", ps, depth, &r_n->size_response))
2919 if(!prs_uint32("ptr_secdesc", ps, depth, &r_n->ptr_secdesc))
2922 if(!prs_uint32("size_secdesc", ps, depth, &r_n->size_secdesc))
2925 if(!sec_io_desc("sec_desc", &r_n->sec_desc, ps, depth))
2931 if(!prs_werror("status", ps, depth, &r_n->status))
2937 /*******************************************************************
2938 Reads or writes a structure.
2939 ********************************************************************/
2941 BOOL srv_io_q_net_file_set_secdesc(char *desc, SRV_Q_NET_FILE_SET_SECDESC *q_n, prs_struct *ps, int depth)
2946 prs_debug(ps, depth, desc, "srv_io_q_net_file_set_secdesc");
2952 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
2955 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2961 if(!prs_uint32("ptr_qual_name", ps, depth, &q_n->ptr_qual_name))
2964 if(!smb_io_unistr2("", &q_n->uni_qual_name, True, ps, depth))
2970 if(!smb_io_unistr2("", &q_n->uni_file_name, True, ps, depth))
2976 if(!prs_uint32("sec_info", ps, depth, &q_n->sec_info))
2979 if(!prs_uint32("size_set", ps, depth, &q_n->size_set))
2982 if(!prs_uint32("ptr_secdesc", ps, depth, &q_n->ptr_secdesc))
2985 if(!prs_uint32("size_secdesc", ps, depth, &q_n->size_secdesc))
2988 if(!sec_io_desc("sec_desc", &q_n->sec_desc, ps, depth))
2994 /*******************************************************************
2995 Reads or writes a structure.
2996 ********************************************************************/
2998 BOOL srv_io_r_net_file_set_secdesc(char *desc, SRV_R_NET_FILE_SET_SECDESC *r_n, prs_struct *ps, int depth)
3003 prs_debug(ps, depth, desc, "srv_io_r_net_file_set_secdesc");
3009 if(!prs_werror("status", ps, depth, &r_n->status))
3015 /*******************************************************************
3017 ********************************************************************/
3019 void init_srv_q_net_remote_tod(SRV_Q_NET_REMOTE_TOD *q_u, char *server)
3021 q_u->ptr_srv_name = 1;
3022 init_unistr2(&q_u->uni_srv_name, server, strlen(server) + 1);