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.
27 /*******************************************************************
28 Inits a SH_INFO_1_STR structure
29 ********************************************************************/
31 void init_srv_share_info1_str(SH_INFO_1_STR *sh1, char *net_name, char *remark)
33 DEBUG(5,("init_srv_share_info1_str\n"));
35 init_unistr2(&sh1->uni_netname, net_name, strlen(net_name)+1);
36 init_unistr2(&sh1->uni_remark, remark, strlen(remark)+1);
39 /*******************************************************************
40 Reads or writes a structure.
41 ********************************************************************/
43 static BOOL srv_io_share_info1_str(char *desc, SH_INFO_1_STR *sh1, prs_struct *ps, int depth)
48 prs_debug(ps, depth, desc, "srv_io_share_info1_str");
53 if(!smb_io_unistr2("", &sh1->uni_netname, True, ps, depth))
58 if(!smb_io_unistr2("", &sh1->uni_remark, True, ps, depth))
64 /*******************************************************************
65 makes a SH_INFO_1 structure
66 ********************************************************************/
68 void init_srv_share_info1(SH_INFO_1 *sh1, char *net_name, uint32 type, char *remark)
70 DEBUG(5,("init_srv_share_info1: %s %8x %s\n", net_name, type, remark));
72 sh1->ptr_netname = (net_name != NULL) ? 1 : 0;
74 sh1->ptr_remark = (remark != NULL) ? 1 : 0;
77 /*******************************************************************
78 Reads or writes a structure.
79 ********************************************************************/
81 static BOOL srv_io_share_info1(char *desc, SH_INFO_1 *sh1, prs_struct *ps, int depth)
86 prs_debug(ps, depth, desc, "srv_io_share_info1");
92 if(!prs_uint32("ptr_netname", ps, depth, &sh1->ptr_netname))
94 if(!prs_uint32("type ", ps, depth, &sh1->type))
96 if(!prs_uint32("ptr_remark ", ps, depth, &sh1->ptr_remark))
102 /*******************************************************************
103 Inits a SH_INFO_2_STR structure
104 ********************************************************************/
106 void init_srv_share_info2_str(SH_INFO_2_STR *sh2,
107 char *net_name, char *remark,
108 char *path, char *passwd)
110 DEBUG(5,("init_srv_share_info2_str\n"));
113 init_unistr2(&sh2->uni_netname, net_name, strlen(net_name)+1);
115 init_unistr2(&sh2->uni_remark, remark, strlen(remark)+1);
117 init_unistr2(&sh2->uni_path, path, strlen(path)+1);
119 init_unistr2(&sh2->uni_passwd, passwd, strlen(passwd)+1);
122 /*******************************************************************
123 Reads or writes a structure.
124 ********************************************************************/
126 static BOOL srv_io_share_info2_str(char *desc, SH_INFO_2 *sh, SH_INFO_2_STR *sh2, prs_struct *ps, int depth)
131 if (UNMARSHALLING(ps))
134 prs_debug(ps, depth, desc, "srv_io_share_info2_str");
140 if(!smb_io_unistr2("", &sh2->uni_netname, True, ps, depth))
144 if(!smb_io_unistr2("", &sh2->uni_remark, True, ps, depth))
148 if(!smb_io_unistr2("", &sh2->uni_path, True, ps, depth))
152 if(!smb_io_unistr2("", &sh2->uni_passwd, True, ps, depth))
158 /*******************************************************************
159 Inits a SH_INFO_2 structure
160 ********************************************************************/
162 void init_srv_share_info2(SH_INFO_2 *sh2,
163 char *net_name, uint32 type, char *remark,
164 uint32 perms, uint32 max_uses, uint32 num_uses,
165 char *path, char *passwd)
167 DEBUG(5,("init_srv_share_info2: %s %8x %s\n", net_name, type, remark));
169 sh2->ptr_netname = (net_name != NULL) ? 1 : 0;
171 sh2->ptr_remark = (remark != NULL) ? 1 : 0;
173 sh2->max_uses = max_uses;
174 sh2->num_uses = num_uses;
176 sh2->ptr_path = (path != NULL) ? 1 : 0;
177 sh2->ptr_passwd = (passwd != NULL) ? 1 : 0;
180 /*******************************************************************
181 Reads or writes a structure.
182 ********************************************************************/
184 static BOOL srv_io_share_info2(char *desc, SH_INFO_2 *sh2, prs_struct *ps, int depth)
189 prs_debug(ps, depth, desc, "srv_io_share_info2");
195 if(!prs_uint32("ptr_netname", ps, depth, &sh2->ptr_netname))
197 if(!prs_uint32("type ", ps, depth, &sh2->type))
199 if(!prs_uint32("ptr_remark ", ps, depth, &sh2->ptr_remark))
201 if(!prs_uint32("perms ", ps, depth, &sh2->perms))
203 if(!prs_uint32("max_uses ", ps, depth, &sh2->max_uses))
205 if(!prs_uint32("num_uses ", ps, depth, &sh2->num_uses))
207 if(!prs_uint32("ptr_path ", ps, depth, &sh2->ptr_path))
209 if(!prs_uint32("ptr_passwd ", ps, depth, &sh2->ptr_passwd))
215 /*******************************************************************
216 Inits a SH_INFO_2 structure
217 *******************************************************************/
219 void init_srv_share_info501(SH_INFO_501 *sh501, char *net_name, uint32 type, char *remark, uint32 csc_policy)
221 DEBUG(5,("init_srv_share_info501: %s %8x %s %08x\n", net_name, type,
222 remark, csc_policy));
226 sh501->ptr_netname = (net_name != NULL) ? 1 : 0;
228 sh501->ptr_remark = (remark != NULL) ? 1 : 0;
229 sh501->csc_policy = csc_policy;
232 /*******************************************************************
233 Reads of writes a structure.
234 *******************************************************************/
236 static BOOL srv_io_share_info501(char *desc, SH_INFO_501 *sh501, prs_struct *ps, int depth)
241 prs_debug(ps, depth, desc, "srv_io_share_info501");
247 if (!prs_uint32("ptr_netname", ps, depth, &sh501->ptr_netname))
249 if (!prs_uint32("type ", ps, depth, &sh501->type))
251 if (!prs_uint32("ptr_remark ", ps, depth, &sh501->ptr_remark))
253 if (!prs_uint32("csc_policy ", ps, depth, &sh501->csc_policy))
259 /********************************************************************
260 Inits a SH_INFO_501_STR structure
261 ********************************************************************/
263 void init_srv_share_info501_str(SH_INFO_501_STR *sh501, char *net_name, char *remark)
265 DEBUG(5,("init_srv_share_info501_str\n"));
267 init_unistr2(&sh501->uni_netname, net_name, strlen(net_name)+1);
268 init_unistr2(&sh501->uni_remark, remark, strlen(remark)+1);
271 /*******************************************************************
272 Reads or writes a structure.
273 ********************************************************************/
275 static BOOL srv_io_share_info501_str(char *desc, SH_INFO_501_STR *sh501, prs_struct *ps, int depth)
280 prs_debug(ps, depth, desc, "srv_io_share_info501_str");
285 if(!smb_io_unistr2("", &sh501->uni_netname, True, ps, depth))
290 if(!smb_io_unistr2("", &sh501->uni_remark, True, ps, depth))
296 /*******************************************************************
297 Inits a SH_INFO_502 structure
298 ********************************************************************/
300 void init_srv_share_info502(SH_INFO_502 *sh502,
301 char *net_name, uint32 type, char *remark,
302 uint32 perms, uint32 max_uses, uint32 num_uses,
303 char *path, char *passwd, SEC_DESC *psd, size_t sd_size)
305 DEBUG(5,("init_srv_share_info502: %s %8x %s\n", net_name, type, remark));
309 sh502->ptr_netname = (net_name != NULL) ? 1 : 0;
311 sh502->ptr_remark = (remark != NULL) ? 1 : 0;
312 sh502->perms = perms;
313 sh502->max_uses = max_uses;
314 sh502->num_uses = num_uses;
316 sh502->ptr_path = (path != NULL) ? 1 : 0;
317 sh502->ptr_passwd = (passwd != NULL) ? 1 : 0;
318 sh502->sd_size = (uint32)sd_size;
319 sh502->ptr_sd = (psd != NULL) ? 1 : 0;
322 /*******************************************************************
323 Reads or writes a structure.
324 ********************************************************************/
326 static BOOL srv_io_share_info502(char *desc, SH_INFO_502 *sh502, prs_struct *ps, int depth)
331 prs_debug(ps, depth, desc, "srv_io_share_info502");
337 if(!prs_uint32("ptr_netname", ps, depth, &sh502->ptr_netname))
339 if(!prs_uint32("type ", ps, depth, &sh502->type))
341 if(!prs_uint32("ptr_remark ", ps, depth, &sh502->ptr_remark))
343 if(!prs_uint32("perms ", ps, depth, &sh502->perms))
345 if(!prs_uint32("max_uses ", ps, depth, &sh502->max_uses))
347 if(!prs_uint32("num_uses ", ps, depth, &sh502->num_uses))
349 if(!prs_uint32("ptr_path ", ps, depth, &sh502->ptr_path))
351 if(!prs_uint32("ptr_passwd ", ps, depth, &sh502->ptr_passwd))
353 if(!prs_uint32("sd_size ", ps, depth, &sh502->sd_size))
355 if(!prs_uint32("ptr_sd ", ps, depth, &sh502->ptr_sd))
361 /*******************************************************************
362 Inits a SH_INFO_502_STR structure
363 ********************************************************************/
365 void init_srv_share_info502_str(SH_INFO_502_STR *sh502str,
367 char *net_name, char *remark,
368 char *path, char *passwd, SEC_DESC *psd, size_t sd_size)
370 DEBUG(5,("init_srv_share_info502_str\n"));
372 sh502str->ptrs = ptrs;
374 if(sh502str->ptrs->ptr_netname)
375 init_unistr2(&sh502str->uni_netname, net_name, strlen(net_name)+1);
376 if(sh502str->ptrs->ptr_remark)
377 init_unistr2(&sh502str->uni_remark, remark, strlen(remark)+1);
378 if(sh502str->ptrs->ptr_path)
379 init_unistr2(&sh502str->uni_path, path, strlen(path)+1);
380 if(sh502str->ptrs->ptr_passwd)
381 init_unistr2(&sh502str->uni_passwd, passwd, strlen(passwd)+1);
382 if(sh502str->ptrs->ptr_sd) {
384 sh502str->sd_size = sd_size;
388 /*******************************************************************
389 Reads or writes a structure.
390 ********************************************************************/
392 static BOOL srv_io_share_info502_str(char *desc, SH_INFO_502_STR *sh502, prs_struct *ps, int depth)
397 prs_debug(ps, depth, desc, "srv_io_share_info502_str");
403 if(sh502->ptrs->ptr_netname) {
404 if(!smb_io_unistr2("", &sh502->uni_netname, True, ps, depth))
411 if(sh502->ptrs->ptr_remark) {
412 if(!smb_io_unistr2("", &sh502->uni_remark, True, ps, depth))
419 if(sh502->ptrs->ptr_path) {
420 if(!smb_io_unistr2("", &sh502->uni_path, True, ps, depth))
427 if(sh502->ptrs->ptr_passwd) {
428 if(!smb_io_unistr2("", &sh502->uni_passwd, True, ps, depth))
435 if(sh502->ptrs->ptr_sd) {
436 if(!prs_uint32("sd_size ", ps, depth, &sh502->sd_size))
438 if (!sec_io_desc(desc, &sh502->sd, ps, depth))
445 /*******************************************************************
446 Reads or writes a structure.
447 ********************************************************************/
449 static BOOL srv_io_share_info1005(char* desc, SRV_SHARE_INFO_1005* sh1005,
450 prs_struct* ps, int depth)
455 prs_debug(ps, depth, desc, "srv_io_share_info1005");
461 if(!prs_uint32("dfs_root_flag", ps, depth, &sh1005->dfs_root_flag))
467 /*******************************************************************
468 Reads or writes a structure.
469 ********************************************************************/
471 static BOOL srv_io_share_info1501(char* desc, SRV_SHARE_INFO_1501* sh1501,
472 prs_struct* ps, int depth)
477 prs_debug(ps, depth, desc, "srv_io_share_info1501");
483 if (!sec_io_desc_buf(desc, &sh1501->sdb, ps, depth))
489 /*******************************************************************
490 Reads or writes a structure.
491 ********************************************************************/
493 static BOOL srv_io_srv_share_ctr(char *desc, SRV_SHARE_INFO_CTR *ctr, prs_struct *ps, int depth)
498 prs_debug(ps, depth, desc, "srv_io_srv_share_ctr");
501 if (UNMARSHALLING(ps)) {
502 memset(ctr, '\0', sizeof(SRV_SHARE_INFO_CTR));
508 if(!prs_uint32("info_level", ps, depth, &ctr->info_level))
511 if (ctr->info_level == 0)
514 if(!prs_uint32("switch_value", ps, depth, &ctr->switch_value))
516 if(!prs_uint32("ptr_share_info", ps, depth, &ctr->ptr_share_info))
519 if (ctr->ptr_share_info == 0)
522 if(!prs_uint32("num_entries", ps, depth, &ctr->num_entries))
524 if(!prs_uint32("ptr_entries", ps, depth, &ctr->ptr_entries))
527 if (ctr->ptr_entries == 0) {
528 if (ctr->num_entries == 0)
534 if(!prs_uint32("num_entries2", ps, depth, &ctr->num_entries2))
537 if (ctr->num_entries2 != ctr->num_entries)
540 switch (ctr->switch_value) {
543 SRV_SHARE_INFO_1 *info1 = ctr->share.info1;
544 int num_entries = ctr->num_entries;
547 if (UNMARSHALLING(ps)) {
548 if (!(info1 = (SRV_SHARE_INFO_1 *)prs_alloc_mem(ps, num_entries * sizeof(SRV_SHARE_INFO_1))))
550 ctr->share.info1 = info1;
553 for (i = 0; i < num_entries; i++) {
554 if(!srv_io_share_info1("", &info1[i].info_1, ps, depth))
558 for (i = 0; i < num_entries; i++) {
559 if(!srv_io_share_info1_str("", &info1[i].info_1_str, ps, depth))
568 SRV_SHARE_INFO_2 *info2 = ctr->share.info2;
569 int num_entries = ctr->num_entries;
572 if (UNMARSHALLING(ps)) {
573 if (!(info2 = (SRV_SHARE_INFO_2 *)prs_alloc_mem(ps,num_entries * sizeof(SRV_SHARE_INFO_2))))
575 ctr->share.info2 = info2;
578 for (i = 0; i < num_entries; i++) {
579 if(!srv_io_share_info2("", &info2[i].info_2, ps, depth))
583 for (i = 0; i < num_entries; i++) {
584 if(!srv_io_share_info2_str("", &info2[i].info_2, &info2[i].info_2_str, ps, depth))
593 SRV_SHARE_INFO_501 *info501 = ctr->share.info501;
594 int num_entries = ctr->num_entries;
597 if (UNMARSHALLING(ps)) {
598 if (!(info501 = (SRV_SHARE_INFO_501 *) prs_alloc_mem(ps, num_entries *
599 sizeof (SRV_SHARE_INFO_501))))
601 ctr->share.info501 = info501;
604 for (i = 0; i < num_entries; i++) {
605 if (!srv_io_share_info501("", &info501[i].info_501, ps, depth))
609 for (i = 0; i < num_entries; i++) {
610 if (!srv_io_share_info501_str("", &info501[i].info_501_str, ps, depth))
619 SRV_SHARE_INFO_502 *info502 = ctr->share.info502;
620 int num_entries = ctr->num_entries;
623 if (UNMARSHALLING(ps)) {
624 if (!(info502 = (SRV_SHARE_INFO_502 *)prs_alloc_mem(ps,num_entries * sizeof(SRV_SHARE_INFO_502))))
626 ctr->share.info502 = info502;
629 for (i = 0; i < num_entries; i++) {
630 if(!srv_io_share_info502("", &info502[i].info_502, ps, depth))
634 for (i = 0; i < num_entries; i++) {
635 info502[i].info_502_str.ptrs = &info502[i].info_502;
636 if(!srv_io_share_info502_str("", &info502[i].info_502_str, ps, depth))
644 DEBUG(5,("%s no share info at switch_value %d\n",
645 tab_depth(depth), ctr->switch_value));
652 /*******************************************************************
653 Inits a SRV_Q_NET_SHARE_ENUM structure.
654 ********************************************************************/
656 void init_srv_q_net_share_enum(SRV_Q_NET_SHARE_ENUM *q_n,
657 char *srv_name, uint32 info_level,
658 uint32 preferred_len, ENUM_HND *hnd)
661 DEBUG(5,("init_q_net_share_enum\n"));
663 init_buf_unistr2(&q_n->uni_srv_name, &q_n->ptr_srv_name, srv_name);
665 q_n->ctr.info_level = q_n->ctr.switch_value = info_level;
666 q_n->ctr.ptr_share_info = 1;
667 q_n->ctr.num_entries = 0;
668 q_n->ctr.ptr_entries = 0;
669 q_n->preferred_len = preferred_len;
671 memcpy(&q_n->enum_hnd, hnd, sizeof(*hnd));
674 /*******************************************************************
675 Reads or writes a structure.
676 ********************************************************************/
678 BOOL srv_io_q_net_share_enum(char *desc, SRV_Q_NET_SHARE_ENUM *q_n, prs_struct *ps, int depth)
683 prs_debug(ps, depth, desc, "srv_io_q_net_share_enum");
689 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
691 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
694 if(!srv_io_srv_share_ctr("share_ctr", &q_n->ctr, ps, depth))
700 if(!prs_uint32("preferred_len", ps, depth, &q_n->preferred_len))
703 if(!smb_io_enum_hnd("enum_hnd", &q_n->enum_hnd, ps, depth))
709 /*******************************************************************
710 Reads or writes a structure.
711 ********************************************************************/
713 BOOL srv_io_r_net_share_enum(char *desc, SRV_R_NET_SHARE_ENUM *r_n, prs_struct *ps, int depth)
718 prs_debug(ps, depth, desc, "srv_io_r_net_share_enum");
721 if(!srv_io_srv_share_ctr("share_ctr", &r_n->ctr, ps, depth))
727 if(!prs_uint32("total_entries", ps, depth, &r_n->total_entries))
729 if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
731 if(!prs_werror("status", ps, depth, &r_n->status))
737 /*******************************************************************
738 Reads or writes a structure.
739 ********************************************************************/
741 BOOL srv_io_q_net_share_get_info(char *desc, SRV_Q_NET_SHARE_GET_INFO *q_n, prs_struct *ps, int depth)
746 prs_debug(ps, depth, desc, "srv_io_q_net_share_get_info");
752 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
754 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
757 if(!smb_io_unistr2("", &q_n->uni_share_name, True, ps, depth))
763 if(!prs_uint32("info_level", ps, depth, &q_n->info_level))
769 /*******************************************************************
770 Reads or writes a structure.
771 ********************************************************************/
773 static BOOL srv_io_srv_share_info(char *desc, prs_struct *ps, int depth, SRV_SHARE_INFO *r_n)
778 prs_debug(ps, depth, desc, "srv_io_srv_share_info");
784 if(!prs_uint32("switch_value ", ps, depth, &r_n->switch_value ))
787 if(!prs_uint32("ptr_share_ctr", ps, depth, &r_n->ptr_share_ctr))
790 if (r_n->ptr_share_ctr != 0) {
791 switch (r_n->switch_value) {
793 if(!srv_io_share_info1("", &r_n->share.info1.info_1, ps, depth))
796 if(!srv_io_share_info1_str("", &r_n->share.info1.info_1_str, ps, depth))
801 if(!srv_io_share_info2("", &r_n->share.info2.info_2, ps, depth))
804 if(!srv_io_share_info2_str("", &r_n->share.info2.info_2, &r_n->share.info2.info_2_str, ps, depth))
809 if (!srv_io_share_info501("", &r_n->share.info501.info_501, ps, depth))
811 if (!srv_io_share_info501_str("", &r_n->share.info501.info_501_str, ps, depth))
816 if(!srv_io_share_info502("", &r_n->share.info502.info_502, ps, depth))
819 /*allow access to pointers in the str part. */
820 r_n->share.info502.info_502_str.ptrs = &r_n->share.info502.info_502;
822 if(!srv_io_share_info502_str("", &r_n->share.info502.info_502_str, ps, depth))
826 if(!srv_io_share_info1005("", &r_n->share.info1005, ps, depth))
830 if (!srv_io_share_info1501("", &r_n->share.info1501, ps, depth))
833 DEBUG(5,("%s no share info at switch_value %d\n",
834 tab_depth(depth), r_n->switch_value));
842 /*******************************************************************
843 Reads or writes a structure.
844 ********************************************************************/
846 BOOL srv_io_r_net_share_get_info(char *desc, SRV_R_NET_SHARE_GET_INFO *r_n, prs_struct *ps, int depth)
851 prs_debug(ps, depth, desc, "srv_io_r_net_share_get_info");
857 if(!srv_io_srv_share_info("info ", ps, depth, &r_n->info))
863 if(!prs_werror("status", ps, depth, &r_n->status))
869 /*******************************************************************
870 Reads or writes a structure.
871 ********************************************************************/
873 BOOL srv_io_q_net_share_set_info(char *desc, SRV_Q_NET_SHARE_SET_INFO *q_n, prs_struct *ps, int depth)
878 prs_debug(ps, depth, desc, "srv_io_q_net_share_set_info");
884 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
886 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
889 if(!smb_io_unistr2("", &q_n->uni_share_name, True, ps, depth))
895 if(!prs_uint32("info_level", ps, depth, &q_n->info_level))
901 if(!srv_io_srv_share_info("info ", ps, depth, &q_n->info))
907 /*******************************************************************
908 Reads or writes a structure.
909 ********************************************************************/
911 BOOL srv_io_r_net_share_set_info(char *desc, SRV_R_NET_SHARE_SET_INFO *q_n, prs_struct *ps, int depth)
916 prs_debug(ps, depth, desc, "srv_io_r_net_share_set_info");
922 if(!prs_uint32("switch_value ", ps, depth, &q_n->switch_value))
924 if(!prs_werror("status", ps, depth, &q_n->status))
930 /*******************************************************************
931 Reads or writes a structure.
932 ********************************************************************/
934 BOOL srv_io_q_net_share_add(char *desc, SRV_Q_NET_SHARE_ADD *q_n, prs_struct *ps, int depth)
939 prs_debug(ps, depth, desc, "srv_io_q_net_share_add");
945 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
947 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
953 if(!prs_uint32("info_level", ps, depth, &q_n->info_level))
959 if(!srv_io_srv_share_info("info ", ps, depth, &q_n->info))
962 if(!prs_uint32("ptr_err_index", ps, depth, &q_n->ptr_err_index))
964 if (q_n->ptr_err_index)
965 if (!prs_uint32("err_index", ps, depth, &q_n->err_index))
971 void init_srv_q_net_share_add(SRV_Q_NET_SHARE_ADD *q, char *srvname,
972 char *netname, uint32 type, char *remark,
973 uint32 perms, uint32 max_uses, uint32 num_uses,
974 char *path, char *passwd)
977 init_unistr2(&q->uni_srv_name, srvname, strlen(srvname) +1);
978 q->info.switch_value = q->info_level = 2;
980 q->info.ptr_share_ctr = 1;
981 init_srv_share_info2(&q->info.share.info2.info_2, netname, type,
982 remark, perms, max_uses, num_uses, path, passwd);
983 init_srv_share_info2_str(&q->info.share.info2.info_2_str, netname,
984 remark, path, passwd);
985 q->ptr_err_index = 1;
990 /*******************************************************************
991 Reads or writes a structure.
992 ********************************************************************/
994 BOOL srv_io_r_net_share_add(char *desc, SRV_R_NET_SHARE_ADD *q_n, prs_struct *ps, int depth)
999 prs_debug(ps, depth, desc, "srv_io_r_net_share_add");
1005 if(!prs_uint32("switch_value ", ps, depth, &q_n->switch_value))
1007 if(!prs_werror("status", ps, depth, &q_n->status))
1013 void init_srv_q_net_share_del(SRV_Q_NET_SHARE_DEL *del, const char *srvname,
1014 const char *sharename)
1016 del->ptr_srv_name = 1;
1017 init_unistr2(&del->uni_srv_name, srvname, strlen(srvname) +1 );
1018 init_unistr2(&del->uni_share_name, sharename, strlen(sharename) + 1);
1021 /*******************************************************************
1022 Reads or writes a structure.
1023 ********************************************************************/
1025 BOOL srv_io_q_net_share_del(char *desc, SRV_Q_NET_SHARE_DEL *q_n, prs_struct *ps, int depth)
1030 prs_debug(ps, depth, desc, "srv_io_q_net_share_del");
1036 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
1038 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
1041 if(!smb_io_unistr2("", &q_n->uni_share_name, True, ps, depth))
1046 if(!prs_uint32("reserved", ps, depth, &q_n->reserved))
1052 /*******************************************************************
1053 Reads or writes a structure.
1054 ********************************************************************/
1056 BOOL srv_io_r_net_share_del(char *desc, SRV_R_NET_SHARE_DEL *q_n, prs_struct *ps, int depth)
1061 prs_debug(ps, depth, desc, "srv_io_r_net_share_del");
1067 if(!prs_werror("status", ps, depth, &q_n->status))
1073 /*******************************************************************
1074 Inits a SESS_INFO_0_STR structure
1075 ********************************************************************/
1077 void init_srv_sess_info0_str(SESS_INFO_0_STR *ss0, char *name)
1079 DEBUG(5,("init_srv_sess_info0_str\n"));
1081 init_unistr2(&ss0->uni_name, name, strlen(name)+1);
1084 /*******************************************************************
1085 Reads or writes a structure.
1086 ********************************************************************/
1088 static BOOL srv_io_sess_info0_str(char *desc, SESS_INFO_0_STR *ss0, prs_struct *ps, int depth)
1093 prs_debug(ps, depth, desc, "srv_io_sess_info0_str");
1099 if(!smb_io_unistr2("", &ss0->uni_name, True, ps, depth))
1105 /*******************************************************************
1106 Inits a SESS_INFO_0 structure
1107 ********************************************************************/
1109 void init_srv_sess_info0(SESS_INFO_0 *ss0, char *name)
1111 DEBUG(5,("init_srv_sess_info0: %s\n", name));
1113 ss0->ptr_name = (name != NULL) ? 1 : 0;
1116 /*******************************************************************
1117 Reads or writes a structure.
1118 ********************************************************************/
1120 static BOOL srv_io_sess_info0(char *desc, SESS_INFO_0 *ss0, prs_struct *ps, int depth)
1125 prs_debug(ps, depth, desc, "srv_io_sess_info0");
1131 if(!prs_uint32("ptr_name", ps, depth, &ss0->ptr_name))
1137 /*******************************************************************
1138 Reads or writes a structure.
1139 ********************************************************************/
1141 static BOOL srv_io_srv_sess_info_0(char *desc, SRV_SESS_INFO_0 *ss0, prs_struct *ps, int depth)
1146 prs_debug(ps, depth, desc, "srv_io_srv_sess_info_0");
1152 if(!prs_uint32("num_entries_read", ps, depth, &ss0->num_entries_read))
1154 if(!prs_uint32("ptr_sess_info", ps, depth, &ss0->ptr_sess_info))
1157 if (ss0->ptr_sess_info != 0) {
1159 int num_entries = ss0->num_entries_read;
1161 if (num_entries > MAX_SESS_ENTRIES) {
1162 num_entries = MAX_SESS_ENTRIES; /* report this! */
1165 if(!prs_uint32("num_entries_read2", ps, depth, &ss0->num_entries_read2))
1168 SMB_ASSERT_ARRAY(ss0->info_0, num_entries);
1170 for (i = 0; i < num_entries; i++) {
1171 if(!srv_io_sess_info0("", &ss0->info_0[i], ps, depth))
1175 for (i = 0; i < num_entries; i++) {
1176 if(!srv_io_sess_info0_str("", &ss0->info_0_str[i], ps, depth))
1187 /*******************************************************************
1188 Inits a SESS_INFO_1_STR structure
1189 ********************************************************************/
1191 void init_srv_sess_info1_str(SESS_INFO_1_STR *ss1, char *name, char *user)
1193 DEBUG(5,("init_srv_sess_info1_str\n"));
1195 init_unistr2(&ss1->uni_name, name, strlen(name)+1);
1196 init_unistr2(&ss1->uni_user, name, strlen(user)+1);
1199 /*******************************************************************
1200 Reads or writes a structure.
1201 ********************************************************************/
1203 static BOOL srv_io_sess_info1_str(char *desc, SESS_INFO_1_STR *ss1, prs_struct *ps, int depth)
1208 prs_debug(ps, depth, desc, "srv_io_sess_info1_str");
1214 if(!smb_io_unistr2("", &ss1->uni_name, True, ps, depth))
1216 if(!smb_io_unistr2("", &(ss1->uni_user), True, ps, depth))
1222 /*******************************************************************
1223 Inits a SESS_INFO_1 structure
1224 ********************************************************************/
1226 void init_srv_sess_info1(SESS_INFO_1 *ss1,
1227 char *name, char *user,
1228 uint32 num_opens, uint32 open_time, uint32 idle_time,
1231 DEBUG(5,("init_srv_sess_info1: %s\n", name));
1233 ss1->ptr_name = (name != NULL) ? 1 : 0;
1234 ss1->ptr_user = (user != NULL) ? 1 : 0;
1236 ss1->num_opens = num_opens;
1237 ss1->open_time = open_time;
1238 ss1->idle_time = idle_time;
1239 ss1->user_flags = user_flags;
1242 /*******************************************************************
1243 reads or writes a structure.
1244 ********************************************************************/
1246 static BOOL srv_io_sess_info1(char *desc, SESS_INFO_1 *ss1, prs_struct *ps, int depth)
1251 prs_debug(ps, depth, desc, "srv_io_sess_info1");
1257 if(!prs_uint32("ptr_name ", ps, depth, &ss1->ptr_name))
1259 if(!prs_uint32("ptr_user ", ps, depth, &ss1->ptr_user))
1262 if(!prs_uint32("num_opens ", ps, depth, &ss1->num_opens))
1264 if(!prs_uint32("open_time ", ps, depth, &ss1->open_time))
1266 if(!prs_uint32("idle_time ", ps, depth, &ss1->idle_time))
1268 if(!prs_uint32("user_flags", ps, depth, &ss1->user_flags))
1274 /*******************************************************************
1275 Reads or writes a structure.
1276 ********************************************************************/
1278 static BOOL srv_io_srv_sess_info_1(char *desc, SRV_SESS_INFO_1 *ss1, prs_struct *ps, int depth)
1283 prs_debug(ps, depth, desc, "srv_io_srv_sess_info_1");
1289 if(!prs_uint32("num_entries_read", ps, depth, &ss1->num_entries_read))
1291 if(!prs_uint32("ptr_sess_info", ps, depth, &ss1->ptr_sess_info))
1294 if (ss1->ptr_sess_info != 0) {
1296 int num_entries = ss1->num_entries_read;
1298 if (num_entries > MAX_SESS_ENTRIES) {
1299 num_entries = MAX_SESS_ENTRIES; /* report this! */
1302 if(!prs_uint32("num_entries_read2", ps, depth, &ss1->num_entries_read2))
1305 SMB_ASSERT_ARRAY(ss1->info_1, num_entries);
1307 for (i = 0; i < num_entries; i++) {
1308 if(!srv_io_sess_info1("", &ss1->info_1[i], ps, depth))
1312 for (i = 0; i < num_entries; i++) {
1313 if(!srv_io_sess_info1_str("", &ss1->info_1_str[i], ps, depth))
1324 /*******************************************************************
1325 Reads or writes a structure.
1326 ********************************************************************/
1328 static BOOL srv_io_srv_sess_ctr(char *desc, SRV_SESS_INFO_CTR **pp_ctr, prs_struct *ps, int depth)
1330 SRV_SESS_INFO_CTR *ctr = *pp_ctr;
1332 prs_debug(ps, depth, desc, "srv_io_srv_sess_ctr");
1335 if(UNMARSHALLING(ps)) {
1336 ctr = *pp_ctr = (SRV_SESS_INFO_CTR *)prs_alloc_mem(ps, sizeof(SRV_SESS_INFO_CTR));
1347 if(!prs_uint32("switch_value", ps, depth, &ctr->switch_value))
1349 if(!prs_uint32("ptr_sess_ctr", ps, depth, &ctr->ptr_sess_ctr))
1352 if (ctr->ptr_sess_ctr != 0) {
1353 switch (ctr->switch_value) {
1355 if(!srv_io_srv_sess_info_0("", &ctr->sess.info0, ps, depth))
1359 if(!srv_io_srv_sess_info_1("", &ctr->sess.info1, ps, depth))
1363 DEBUG(5,("%s no session info at switch_value %d\n",
1364 tab_depth(depth), ctr->switch_value));
1372 /*******************************************************************
1373 Inits a SRV_Q_NET_SESS_ENUM structure.
1374 ********************************************************************/
1376 void init_srv_q_net_sess_enum(SRV_Q_NET_SESS_ENUM *q_n,
1377 char *srv_name, char *qual_name,
1378 uint32 sess_level, SRV_SESS_INFO_CTR *ctr,
1379 uint32 preferred_len,
1384 DEBUG(5,("init_q_net_sess_enum\n"));
1386 init_buf_unistr2(&q_n->uni_srv_name, &q_n->ptr_srv_name, srv_name);
1387 init_buf_unistr2(&q_n->uni_qual_name, &q_n->ptr_qual_name, qual_name);
1389 q_n->sess_level = sess_level;
1390 q_n->preferred_len = preferred_len;
1392 memcpy(&q_n->enum_hnd, hnd, sizeof(*hnd));
1395 /*******************************************************************
1396 Reads or writes a structure.
1397 ********************************************************************/
1399 BOOL srv_io_q_net_sess_enum(char *desc, SRV_Q_NET_SESS_ENUM *q_n, prs_struct *ps, int depth)
1404 prs_debug(ps, depth, desc, "srv_io_q_net_sess_enum");
1410 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
1412 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
1418 if(!prs_uint32("ptr_qual_name", ps, depth, &q_n->ptr_qual_name))
1420 if(!smb_io_unistr2("", &q_n->uni_qual_name, q_n->ptr_qual_name, ps, depth))
1426 if(!prs_uint32("sess_level", ps, depth, &q_n->sess_level))
1429 if (q_n->sess_level != -1) {
1430 if(!srv_io_srv_sess_ctr("sess_ctr", &q_n->ctr, ps, depth))
1434 if(!prs_uint32("preferred_len", ps, depth, &q_n->preferred_len))
1437 if(!smb_io_enum_hnd("enum_hnd", &q_n->enum_hnd, ps, depth))
1443 /*******************************************************************
1444 Reads or writes a structure.
1445 ********************************************************************/
1447 BOOL srv_io_r_net_sess_enum(char *desc, SRV_R_NET_SESS_ENUM *r_n, prs_struct *ps, int depth)
1452 prs_debug(ps, depth, desc, "srv_io_r_net_sess_enum");
1458 if(!prs_uint32("sess_level", ps, depth, &r_n->sess_level))
1461 if (r_n->sess_level != -1) {
1462 if(!srv_io_srv_sess_ctr("sess_ctr", &r_n->ctr, ps, depth))
1466 if(!prs_uint32("total_entries", ps, depth, &r_n->total_entries))
1468 if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
1470 if(!prs_werror("status", ps, depth, &r_n->status))
1476 /*******************************************************************
1477 Inits a CONN_INFO_0 structure
1478 ********************************************************************/
1480 void init_srv_conn_info0(CONN_INFO_0 *ss0, uint32 id)
1482 DEBUG(5,("init_srv_conn_info0\n"));
1487 /*******************************************************************
1488 Reads or writes a structure.
1489 ********************************************************************/
1491 static BOOL srv_io_conn_info0(char *desc, CONN_INFO_0 *ss0, prs_struct *ps, int depth)
1496 prs_debug(ps, depth, desc, "srv_io_conn_info0");
1502 if(!prs_uint32("id", ps, depth, &ss0->id))
1508 /*******************************************************************
1509 Reads or writes a structure.
1510 ********************************************************************/
1512 static BOOL srv_io_srv_conn_info_0(char *desc, SRV_CONN_INFO_0 *ss0, prs_struct *ps, int depth)
1517 prs_debug(ps, depth, desc, "srv_io_srv_conn_info_0");
1523 if(!prs_uint32("num_entries_read", ps, depth, &ss0->num_entries_read))
1525 if(!prs_uint32("ptr_conn_info", ps, depth, &ss0->ptr_conn_info))
1528 if (ss0->ptr_conn_info != 0) {
1530 int num_entries = ss0->num_entries_read;
1532 if (num_entries > MAX_CONN_ENTRIES) {
1533 num_entries = MAX_CONN_ENTRIES; /* report this! */
1536 if(!prs_uint32("num_entries_read2", ps, depth, &ss0->num_entries_read2))
1539 for (i = 0; i < num_entries; i++) {
1540 if(!srv_io_conn_info0("", &ss0->info_0[i], ps, depth))
1551 /*******************************************************************
1552 Inits a CONN_INFO_1_STR structure
1553 ********************************************************************/
1555 void init_srv_conn_info1_str(CONN_INFO_1_STR *ss1, char *usr_name, char *net_name)
1557 DEBUG(5,("init_srv_conn_info1_str\n"));
1559 init_unistr2(&ss1->uni_usr_name, usr_name, strlen(usr_name)+1);
1560 init_unistr2(&ss1->uni_net_name, net_name, strlen(net_name)+1);
1563 /*******************************************************************
1564 Reads or writes a structure.
1565 ********************************************************************/
1567 static BOOL srv_io_conn_info1_str(char *desc, CONN_INFO_1_STR *ss1, prs_struct *ps, int depth)
1572 prs_debug(ps, depth, desc, "srv_io_conn_info1_str");
1578 if(!smb_io_unistr2("", &ss1->uni_usr_name, True, ps, depth))
1580 if(!smb_io_unistr2("", &ss1->uni_net_name, True, ps, depth))
1586 /*******************************************************************
1587 Inits a CONN_INFO_1 structure
1588 ********************************************************************/
1590 void init_srv_conn_info1(CONN_INFO_1 *ss1,
1591 uint32 id, uint32 type,
1592 uint32 num_opens, uint32 num_users, uint32 open_time,
1593 char *usr_name, char *net_name)
1595 DEBUG(5,("init_srv_conn_info1: %s %s\n", usr_name, net_name));
1599 ss1->num_opens = num_opens ;
1600 ss1->num_users = num_users;
1601 ss1->open_time = open_time;
1603 ss1->ptr_usr_name = (usr_name != NULL) ? 1 : 0;
1604 ss1->ptr_net_name = (net_name != NULL) ? 1 : 0;
1607 /*******************************************************************
1608 Reads or writes a structure.
1609 ********************************************************************/
1611 static BOOL srv_io_conn_info1(char *desc, CONN_INFO_1 *ss1, prs_struct *ps, int depth)
1616 prs_debug(ps, depth, desc, "srv_io_conn_info1");
1622 if(!prs_uint32("id ", ps, depth, &ss1->id))
1624 if(!prs_uint32("type ", ps, depth, &ss1->type))
1626 if(!prs_uint32("num_opens ", ps, depth, &ss1->num_opens))
1628 if(!prs_uint32("num_users ", ps, depth, &ss1->num_users))
1630 if(!prs_uint32("open_time ", ps, depth, &ss1->open_time))
1633 if(!prs_uint32("ptr_usr_name", ps, depth, &ss1->ptr_usr_name))
1635 if(!prs_uint32("ptr_net_name", ps, depth, &ss1->ptr_net_name))
1641 /*******************************************************************
1642 Reads or writes a structure.
1643 ********************************************************************/
1645 static BOOL srv_io_srv_conn_info_1(char *desc, SRV_CONN_INFO_1 *ss1, prs_struct *ps, int depth)
1650 prs_debug(ps, depth, desc, "srv_io_srv_conn_info_1");
1656 if(!prs_uint32("num_entries_read", ps, depth, &ss1->num_entries_read))
1658 if(!prs_uint32("ptr_conn_info", ps, depth, &ss1->ptr_conn_info))
1661 if (ss1->ptr_conn_info != 0) {
1663 int num_entries = ss1->num_entries_read;
1665 if (num_entries > MAX_CONN_ENTRIES) {
1666 num_entries = MAX_CONN_ENTRIES; /* report this! */
1669 if(!prs_uint32("num_entries_read2", ps, depth, &ss1->num_entries_read2))
1672 for (i = 0; i < num_entries; i++) {
1673 if(!srv_io_conn_info1("", &ss1->info_1[i], ps, depth))
1677 for (i = 0; i < num_entries; i++) {
1678 if(!srv_io_conn_info1_str("", &ss1->info_1_str[i], ps, depth))
1689 /*******************************************************************
1690 Reads or writes a structure.
1691 ********************************************************************/
1693 static BOOL srv_io_srv_conn_ctr(char *desc, SRV_CONN_INFO_CTR **pp_ctr, prs_struct *ps, int depth)
1695 SRV_CONN_INFO_CTR *ctr = *pp_ctr;
1697 prs_debug(ps, depth, desc, "srv_io_srv_conn_ctr");
1700 if (UNMARSHALLING(ps)) {
1701 ctr = *pp_ctr = (SRV_CONN_INFO_CTR *)prs_alloc_mem(ps, sizeof(SRV_CONN_INFO_CTR));
1712 if(!prs_uint32("switch_value", ps, depth, &ctr->switch_value))
1714 if(!prs_uint32("ptr_conn_ctr", ps, depth, &ctr->ptr_conn_ctr))
1717 if (ctr->ptr_conn_ctr != 0) {
1718 switch (ctr->switch_value) {
1720 if(!srv_io_srv_conn_info_0("", &ctr->conn.info0, ps, depth))
1724 if(!srv_io_srv_conn_info_1("", &ctr->conn.info1, ps, depth))
1728 DEBUG(5,("%s no connection info at switch_value %d\n",
1729 tab_depth(depth), ctr->switch_value));
1737 /*******************************************************************
1738 Reads or writes a structure.
1739 ********************************************************************/
1741 void init_srv_q_net_conn_enum(SRV_Q_NET_CONN_ENUM *q_n,
1742 char *srv_name, char *qual_name,
1743 uint32 conn_level, SRV_CONN_INFO_CTR *ctr,
1744 uint32 preferred_len,
1747 DEBUG(5,("init_q_net_conn_enum\n"));
1751 init_buf_unistr2(&q_n->uni_srv_name, &q_n->ptr_srv_name, srv_name );
1752 init_buf_unistr2(&q_n->uni_qual_name, &q_n->ptr_qual_name, qual_name);
1754 q_n->conn_level = conn_level;
1755 q_n->preferred_len = preferred_len;
1757 memcpy(&q_n->enum_hnd, hnd, sizeof(*hnd));
1760 /*******************************************************************
1761 Reads or writes a structure.
1762 ********************************************************************/
1764 BOOL srv_io_q_net_conn_enum(char *desc, SRV_Q_NET_CONN_ENUM *q_n, prs_struct *ps, int depth)
1769 prs_debug(ps, depth, desc, "srv_io_q_net_conn_enum");
1775 if(!prs_uint32("ptr_srv_name ", ps, depth, &q_n->ptr_srv_name))
1777 if(!smb_io_unistr2("", &q_n->uni_srv_name, q_n->ptr_srv_name, ps, depth))
1783 if(!prs_uint32("ptr_qual_name", ps, depth, &q_n->ptr_qual_name))
1785 if(!smb_io_unistr2("", &q_n->uni_qual_name, q_n->ptr_qual_name, ps, depth))
1791 if(!prs_uint32("conn_level", ps, depth, &q_n->conn_level))
1794 if (q_n->conn_level != -1) {
1795 if(!srv_io_srv_conn_ctr("conn_ctr", &q_n->ctr, ps, depth))
1799 if(!prs_uint32("preferred_len", ps, depth, &q_n->preferred_len))
1802 if(!smb_io_enum_hnd("enum_hnd", &q_n->enum_hnd, ps, depth))
1808 /*******************************************************************
1809 Reads or writes a structure.
1810 ********************************************************************/
1812 BOOL srv_io_r_net_conn_enum(char *desc, SRV_R_NET_CONN_ENUM *r_n, prs_struct *ps, int depth)
1817 prs_debug(ps, depth, desc, "srv_io_r_net_conn_enum");
1823 if(!prs_uint32("conn_level", ps, depth, &r_n->conn_level))
1826 if (r_n->conn_level != -1) {
1827 if(!srv_io_srv_conn_ctr("conn_ctr", &r_n->ctr, ps, depth))
1831 if(!prs_uint32("total_entries", ps, depth, &r_n->total_entries))
1833 if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
1835 if(!prs_werror("status", ps, depth, &r_n->status))
1841 /*******************************************************************
1842 Inits a FILE_INFO_3_STR structure
1843 ********************************************************************/
1845 void init_srv_file_info3_str(FILE_INFO_3_STR *fi3, char *user_name, char *path_name)
1847 DEBUG(5,("init_srv_file_info3_str\n"));
1849 init_unistr2(&fi3->uni_path_name, path_name, strlen(path_name)+1);
1850 init_unistr2(&fi3->uni_user_name, user_name, strlen(user_name)+1);
1853 /*******************************************************************
1854 Reads or writes a structure.
1855 ********************************************************************/
1857 static BOOL srv_io_file_info3_str(char *desc, FILE_INFO_3_STR *sh1, prs_struct *ps, int depth)
1862 prs_debug(ps, depth, desc, "srv_io_file_info3_str");
1868 if(!smb_io_unistr2("", &sh1->uni_path_name, True, ps, depth))
1870 if(!smb_io_unistr2("", &sh1->uni_user_name, True, ps, depth))
1876 /*******************************************************************
1877 Inits a FILE_INFO_3 structure
1878 ********************************************************************/
1880 void init_srv_file_info3(FILE_INFO_3 *fl3,
1881 uint32 id, uint32 perms, uint32 num_locks,
1882 char *path_name, char *user_name)
1884 DEBUG(5,("init_srv_file_info3: %s %s\n", path_name, user_name));
1888 fl3->num_locks = num_locks;
1890 fl3->ptr_path_name = (path_name != NULL) ? 1 : 0;
1891 fl3->ptr_user_name = (user_name != NULL) ? 1 : 0;
1894 /*******************************************************************
1895 Reads or writes a structure.
1896 ********************************************************************/
1898 static BOOL srv_io_file_info3(char *desc, FILE_INFO_3 *fl3, prs_struct *ps, int depth)
1903 prs_debug(ps, depth, desc, "srv_io_file_info3");
1909 if(!prs_uint32("id ", ps, depth, &fl3->id))
1911 if(!prs_uint32("perms ", ps, depth, &fl3->perms))
1913 if(!prs_uint32("num_locks ", ps, depth, &fl3->num_locks))
1915 if(!prs_uint32("ptr_path_name", ps, depth, &fl3->ptr_path_name))
1917 if(!prs_uint32("ptr_user_name", ps, depth, &fl3->ptr_user_name))
1923 /*******************************************************************
1924 Reads or writes a structure.
1925 ********************************************************************/
1927 static BOOL srv_io_srv_file_ctr(char *desc, SRV_FILE_INFO_CTR *ctr, prs_struct *ps, int depth)
1932 prs_debug(ps, depth, desc, "srv_io_srv_file_ctr");
1935 if (UNMARSHALLING(ps)) {
1936 memset(ctr, '\0', sizeof(SRV_FILE_INFO_CTR));
1942 if(!prs_uint32("switch_value", ps, depth, &ctr->switch_value))
1944 if (ctr->switch_value != 3) {
1945 DEBUG(5,("%s File info %d level not supported\n",
1946 tab_depth(depth), ctr->switch_value));
1948 if(!prs_uint32("ptr_file_info", ps, depth, &ctr->ptr_file_info))
1950 if(!prs_uint32("num_entries", ps, depth, &ctr->num_entries))
1952 if(!prs_uint32("ptr_entries", ps, depth, &ctr->ptr_entries))
1954 if (ctr->ptr_entries == 0)
1956 if(!prs_uint32("num_entries2", ps, depth,
1957 &ctr->num_entries2))
1960 switch (ctr->switch_value) {
1962 SRV_FILE_INFO_3 *info3 = ctr->file.info3;
1963 int num_entries = ctr->num_entries;
1966 if (UNMARSHALLING(ps)) {
1967 if (!(info3 = (SRV_FILE_INFO_3 *)prs_alloc_mem(ps, num_entries * sizeof(SRV_FILE_INFO_3))))
1969 ctr->file.info3 = info3;
1972 for (i = 0; i < num_entries; i++) {
1973 if(!srv_io_file_info3("", &ctr->file.info3[i].info_3, ps, depth))
1976 for (i = 0; i < num_entries; i++) {
1977 if(!srv_io_file_info3_str("", &ctr->file.info3[i].info_3_str, ps, depth))
1983 DEBUG(5,("%s no file info at switch_value %d\n",
1984 tab_depth(depth), ctr->switch_value));
1991 /*******************************************************************
1992 Inits a SRV_Q_NET_FILE_ENUM structure.
1993 ********************************************************************/
1995 void init_srv_q_net_file_enum(SRV_Q_NET_FILE_ENUM *q_n,
1996 char *srv_name, char *qual_name,
1997 uint32 file_level, SRV_FILE_INFO_CTR *ctr,
1998 uint32 preferred_len,
2001 DEBUG(5,("init_q_net_file_enum\n"));
2003 init_buf_unistr2(&q_n->uni_srv_name, &q_n->ptr_srv_name, srv_name);
2004 init_buf_unistr2(&q_n->uni_qual_name, &q_n->ptr_qual_name, qual_name);
2006 q_n->file_level = q_n->ctr.switch_value = file_level;
2007 q_n->preferred_len = preferred_len;
2008 q_n->ctr.ptr_file_info = 1;
2009 q_n->ctr.num_entries = 0;
2010 q_n->ctr.num_entries2 = 0;
2012 memcpy(&q_n->enum_hnd, hnd, sizeof(*hnd));
2015 /*******************************************************************
2016 Reads or writes a structure.
2017 ********************************************************************/
2019 BOOL srv_io_q_net_file_enum(char *desc, SRV_Q_NET_FILE_ENUM *q_n, prs_struct *ps, int depth)
2024 prs_debug(ps, depth, desc, "srv_io_q_net_file_enum");
2030 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
2032 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2038 if(!prs_uint32("ptr_qual_name", ps, depth, &q_n->ptr_qual_name))
2040 if(!smb_io_unistr2("", &q_n->uni_qual_name, q_n->ptr_qual_name, ps, depth))
2046 if(!prs_uint32("ptr_user_name", ps, depth, &q_n->ptr_user_name))
2048 if(!smb_io_unistr2("", &q_n->uni_user_name, q_n->ptr_user_name, ps, depth))
2053 if(!prs_uint32("file_level", ps, depth, &q_n->file_level))
2056 if (q_n->file_level != -1) {
2057 if(!srv_io_srv_file_ctr("file_ctr", &q_n->ctr, ps, depth))
2061 if(!prs_uint32("preferred_len", ps, depth, &q_n->preferred_len))
2064 if(!smb_io_enum_hnd("enum_hnd", &q_n->enum_hnd, ps, depth))
2070 /*******************************************************************
2071 Reads or writes a structure.
2072 ********************************************************************/
2074 BOOL srv_io_r_net_file_enum(char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_struct *ps, int depth)
2079 prs_debug(ps, depth, desc, "srv_io_r_net_file_enum");
2085 if(!prs_uint32("file_level", ps, depth, &r_n->file_level))
2088 if (r_n->file_level != 0) {
2089 if(!srv_io_srv_file_ctr("file_ctr", &r_n->ctr, ps, depth))
2093 if(!prs_uint32("total_entries", ps, depth, &r_n->total_entries))
2095 if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
2097 if(!prs_werror("status", ps, depth, &r_n->status))
2103 /*******************************************************************
2104 Inits a SRV_INFO_100 structure.
2105 ********************************************************************/
2107 void init_srv_info_100(SRV_INFO_100 *sv100, uint32 platform_id, char *name)
2109 DEBUG(5,("init_srv_info_100\n"));
2111 sv100->platform_id = platform_id;
2112 init_buf_unistr2(&sv100->uni_name, &sv100->ptr_name, name);
2115 /*******************************************************************
2116 Reads or writes a SRV_INFO_101 structure.
2117 ********************************************************************/
2119 static BOOL srv_io_info_100(char *desc, SRV_INFO_100 *sv100, prs_struct *ps, int depth)
2124 prs_debug(ps, depth, desc, "srv_io_info_100");
2130 if(!prs_uint32("platform_id ", ps, depth, &sv100->platform_id))
2132 if(!prs_uint32("ptr_name ", ps, depth, &sv100->ptr_name))
2135 if(!smb_io_unistr2("uni_name ", &sv100->uni_name, True, ps, depth))
2142 /*******************************************************************
2143 Inits a SRV_INFO_101 structure.
2144 ********************************************************************/
2146 void init_srv_info_101(SRV_INFO_101 *sv101, uint32 platform_id, char *name,
2147 uint32 ver_major, uint32 ver_minor,
2148 uint32 srv_type, char *comment)
2150 DEBUG(5,("init_srv_info_101\n"));
2152 sv101->platform_id = platform_id;
2153 init_buf_unistr2(&sv101->uni_name, &sv101->ptr_name, name);
2154 sv101->ver_major = ver_major;
2155 sv101->ver_minor = ver_minor;
2156 sv101->srv_type = srv_type;
2157 init_buf_unistr2(&sv101->uni_comment, &sv101->ptr_comment, comment);
2160 /*******************************************************************
2161 Reads or writes a SRV_INFO_101 structure.
2162 ********************************************************************/
2164 static BOOL srv_io_info_101(char *desc, SRV_INFO_101 *sv101, prs_struct *ps, int depth)
2169 prs_debug(ps, depth, desc, "srv_io_info_101");
2175 if(!prs_uint32("platform_id ", ps, depth, &sv101->platform_id))
2177 if(!prs_uint32("ptr_name ", ps, depth, &sv101->ptr_name))
2179 if(!prs_uint32("ver_major ", ps, depth, &sv101->ver_major))
2181 if(!prs_uint32("ver_minor ", ps, depth, &sv101->ver_minor))
2183 if(!prs_uint32("srv_type ", ps, depth, &sv101->srv_type))
2185 if(!prs_uint32("ptr_comment ", ps, depth, &sv101->ptr_comment))
2191 if(!smb_io_unistr2("uni_name ", &sv101->uni_name, True, ps, depth))
2193 if(!smb_io_unistr2("uni_comment ", &sv101->uni_comment, True, ps, depth))
2199 /*******************************************************************
2200 Inits a SRV_INFO_102 structure.
2201 ********************************************************************/
2203 void init_srv_info_102(SRV_INFO_102 *sv102, uint32 platform_id, char *name,
2204 char *comment, uint32 ver_major, uint32 ver_minor,
2205 uint32 srv_type, uint32 users, uint32 disc, uint32 hidden,
2206 uint32 announce, uint32 ann_delta, uint32 licenses,
2209 DEBUG(5,("init_srv_info_102\n"));
2211 sv102->platform_id = platform_id;
2212 init_buf_unistr2(&sv102->uni_name, &sv102->ptr_name, name);
2213 sv102->ver_major = ver_major;
2214 sv102->ver_minor = ver_minor;
2215 sv102->srv_type = srv_type;
2216 init_buf_unistr2(&sv102->uni_comment, &sv102->ptr_comment, comment);
2218 /* same as 101 up to here */
2220 sv102->users = users;
2222 sv102->hidden = hidden;
2223 sv102->announce = announce;
2224 sv102->ann_delta =ann_delta;
2225 sv102->licenses = licenses;
2226 init_buf_unistr2(&sv102->uni_usr_path, &sv102->ptr_usr_path, usr_path);
2230 /*******************************************************************
2231 Reads or writes a SRV_INFO_102 structure.
2232 ********************************************************************/
2234 static BOOL srv_io_info_102(char *desc, SRV_INFO_102 *sv102, prs_struct *ps, int depth)
2239 prs_debug(ps, depth, desc, "srv_io_info102");
2245 if(!prs_uint32("platform_id ", ps, depth, &sv102->platform_id))
2247 if(!prs_uint32("ptr_name ", ps, depth, &sv102->ptr_name))
2249 if(!prs_uint32("ver_major ", ps, depth, &sv102->ver_major))
2251 if(!prs_uint32("ver_minor ", ps, depth, &sv102->ver_minor))
2253 if(!prs_uint32("srv_type ", ps, depth, &sv102->srv_type))
2255 if(!prs_uint32("ptr_comment ", ps, depth, &sv102->ptr_comment))
2258 /* same as 101 up to here */
2260 if(!prs_uint32("users ", ps, depth, &sv102->users))
2262 if(!prs_uint32("disc ", ps, depth, &sv102->disc))
2264 if(!prs_uint32("hidden ", ps, depth, &sv102->hidden))
2266 if(!prs_uint32("announce ", ps, depth, &sv102->announce))
2268 if(!prs_uint32("ann_delta ", ps, depth, &sv102->ann_delta))
2270 if(!prs_uint32("licenses ", ps, depth, &sv102->licenses))
2272 if(!prs_uint32("ptr_usr_path", ps, depth, &sv102->ptr_usr_path))
2275 if(!smb_io_unistr2("uni_name ", &sv102->uni_name, True, ps, depth))
2279 if(!smb_io_unistr2("uni_comment ", &sv102->uni_comment, True, ps, depth))
2283 if(!smb_io_unistr2("uni_usr_path", &sv102->uni_usr_path, True, ps, depth))
2289 /*******************************************************************
2290 Reads or writes a SRV_INFO_102 structure.
2291 ********************************************************************/
2293 static BOOL srv_io_info_ctr(char *desc, SRV_INFO_CTR *ctr, prs_struct *ps, int depth)
2298 prs_debug(ps, depth, desc, "srv_io_info_ctr");
2304 if(!prs_uint32("switch_value", ps, depth, &ctr->switch_value))
2306 if(!prs_uint32("ptr_srv_ctr ", ps, depth, &ctr->ptr_srv_ctr))
2309 if (ctr->ptr_srv_ctr != 0 && ctr->switch_value != 0 && ctr != NULL) {
2310 switch (ctr->switch_value) {
2312 if(!srv_io_info_100("sv100", &ctr->srv.sv100, ps, depth))
2316 if(!srv_io_info_101("sv101", &ctr->srv.sv101, ps, depth))
2320 if(!srv_io_info_102("sv102", &ctr->srv.sv102, ps, depth))
2324 DEBUG(5,("%s no server info at switch_value %d\n",
2325 tab_depth(depth), ctr->switch_value));
2335 /*******************************************************************
2336 Inits a SRV_Q_NET_SRV_GET_INFO structure.
2337 ********************************************************************/
2339 void init_srv_q_net_srv_get_info(SRV_Q_NET_SRV_GET_INFO *srv,
2340 char *server_name, uint32 switch_value)
2342 DEBUG(5,("init_srv_q_net_srv_get_info\n"));
2344 init_buf_unistr2(&srv->uni_srv_name, &srv->ptr_srv_name, server_name);
2346 srv->switch_value = switch_value;
2349 /*******************************************************************
2350 Reads or writes a structure.
2351 ********************************************************************/
2353 BOOL srv_io_q_net_srv_get_info(char *desc, SRV_Q_NET_SRV_GET_INFO *q_n, prs_struct *ps, int depth)
2358 prs_debug(ps, depth, desc, "srv_io_q_net_srv_get_info");
2364 if(!prs_uint32("ptr_srv_name ", ps, depth, &q_n->ptr_srv_name))
2366 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2372 if(!prs_uint32("switch_value ", ps, depth, &q_n->switch_value))
2378 /*******************************************************************
2379 Inits a SRV_R_NET_SRV_GET_INFO structure.
2380 ********************************************************************/
2382 void init_srv_r_net_srv_get_info(SRV_R_NET_SRV_GET_INFO *srv,
2383 uint32 switch_value, SRV_INFO_CTR *ctr, WERROR status)
2385 DEBUG(5,("init_srv_r_net_srv_get_info\n"));
2389 if (W_ERROR_IS_OK(status)) {
2390 srv->ctr->switch_value = switch_value;
2391 srv->ctr->ptr_srv_ctr = 1;
2393 srv->ctr->switch_value = 0;
2394 srv->ctr->ptr_srv_ctr = 0;
2397 srv->status = status;
2400 /*******************************************************************
2401 Inits a SRV_R_NET_SRV_SET_INFO structure.
2402 ********************************************************************/
2404 void init_srv_r_net_srv_set_info(SRV_R_NET_SRV_SET_INFO *srv,
2405 uint32 switch_value, WERROR status)
2407 DEBUG(5,("init_srv_r_net_srv_set_info\n"));
2409 srv->switch_value = switch_value;
2410 srv->status = status;
2413 /*******************************************************************
2414 Reads or writes a structure.
2415 ********************************************************************/
2417 BOOL srv_io_q_net_srv_set_info(char *desc, SRV_Q_NET_SRV_SET_INFO *q_n,
2418 prs_struct *ps, int depth)
2420 prs_debug(ps, depth, desc, "srv_io_q_net_srv_set_info");
2426 if(!prs_uint32("ptr_srv_name ", ps, depth, &q_n->ptr_srv_name))
2428 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2434 if(!prs_uint32("switch_value ", ps, depth, &q_n->switch_value))
2437 if (UNMARSHALLING(ps)) {
2438 q_n->ctr = (SRV_INFO_CTR *)
2439 prs_alloc_mem(ps, sizeof(SRV_INFO_CTR));
2445 if(!srv_io_info_ctr("ctr", q_n->ctr, ps, depth))
2451 /*******************************************************************
2452 Reads or writes a structure.
2453 ********************************************************************/
2455 BOOL srv_io_r_net_srv_get_info(char *desc, SRV_R_NET_SRV_GET_INFO *r_n, prs_struct *ps, int depth)
2460 prs_debug(ps, depth, desc, "srv_io_r_net_srv_get_info");
2466 if(!srv_io_info_ctr("ctr", r_n->ctr, ps, depth))
2469 if(!prs_werror("status", ps, depth, &r_n->status))
2475 /*******************************************************************
2476 Reads or writes a structure.
2477 ********************************************************************/
2479 BOOL srv_io_r_net_srv_set_info(char *desc, SRV_R_NET_SRV_SET_INFO *r_n,
2480 prs_struct *ps, int depth)
2482 prs_debug(ps, depth, desc, "srv_io_r_net_srv_set_info");
2488 if(!prs_uint32("switch_value ", ps, depth, &r_n->switch_value))
2491 if(!prs_werror("status", ps, depth, &r_n->status))
2497 /*******************************************************************
2498 Reads or writes a structure.
2499 ********************************************************************/
2501 BOOL srv_io_q_net_remote_tod(char *desc, SRV_Q_NET_REMOTE_TOD *q_n, prs_struct *ps, int depth)
2506 prs_debug(ps, depth, desc, "srv_io_q_net_remote_tod");
2512 if(!prs_uint32("ptr_srv_name ", ps, depth, &q_n->ptr_srv_name))
2514 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2520 /*******************************************************************
2521 Reads or writes a TIME_OF_DAY_INFO structure.
2522 ********************************************************************/
2524 static BOOL srv_io_time_of_day_info(char *desc, TIME_OF_DAY_INFO *tod, prs_struct *ps, int depth)
2529 prs_debug(ps, depth, desc, "srv_io_time_of_day_info");
2535 if(!prs_uint32("elapsedt ", ps, depth, &tod->elapsedt))
2537 if(!prs_uint32("msecs ", ps, depth, &tod->msecs))
2539 if(!prs_uint32("hours ", ps, depth, &tod->hours))
2541 if(!prs_uint32("mins ", ps, depth, &tod->mins))
2543 if(!prs_uint32("secs ", ps, depth, &tod->secs))
2545 if(!prs_uint32("hunds ", ps, depth, &tod->hunds))
2547 if(!prs_uint32("timezone ", ps, depth, &tod->zone))
2549 if(!prs_uint32("tintervals ", ps, depth, &tod->tintervals))
2551 if(!prs_uint32("day ", ps, depth, &tod->day))
2553 if(!prs_uint32("month ", ps, depth, &tod->month))
2555 if(!prs_uint32("year ", ps, depth, &tod->year))
2557 if(!prs_uint32("weekday ", ps, depth, &tod->weekday))
2563 /*******************************************************************
2564 Inits a TIME_OF_DAY_INFO structure.
2565 ********************************************************************/
2567 void init_time_of_day_info(TIME_OF_DAY_INFO *tod, uint32 elapsedt, uint32 msecs,
2568 uint32 hours, uint32 mins, uint32 secs, uint32 hunds,
2569 uint32 zone, uint32 tintervals, uint32 day,
2570 uint32 month, uint32 year, uint32 weekday)
2572 DEBUG(5,("init_time_of_day_info\n"));
2574 tod->elapsedt = elapsedt;
2581 tod->tintervals = tintervals;
2585 tod->weekday = weekday;
2589 /*******************************************************************
2590 Reads or writes a structure.
2591 ********************************************************************/
2593 BOOL srv_io_r_net_remote_tod(char *desc, SRV_R_NET_REMOTE_TOD *r_n, prs_struct *ps, int depth)
2598 prs_debug(ps, depth, desc, "srv_io_r_net_remote_tod");
2604 if(!prs_uint32("ptr_srv_tod ", ps, depth, &r_n->ptr_srv_tod))
2607 if(!srv_io_time_of_day_info("tod", r_n->tod, ps, depth))
2610 if(!prs_werror("status", ps, depth, &r_n->status))
2616 /*******************************************************************
2617 Reads or writes a structure.
2618 ********************************************************************/
2620 BOOL srv_io_q_net_disk_enum(char *desc, SRV_Q_NET_DISK_ENUM *q_n, prs_struct *ps, int depth)
2625 prs_debug(ps, depth, desc, "srv_io_q_net_disk_enum");
2631 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
2634 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2640 if(!prs_uint32("level", ps, depth, &q_n->disk_enum_ctr.level))
2643 if(!prs_uint32("entries_read", ps, depth, &q_n->disk_enum_ctr.entries_read))
2646 if(!prs_uint32("buffer", ps, depth, &q_n->disk_enum_ctr.disk_info_ptr))
2652 if(!prs_uint32("preferred_len", ps, depth, &q_n->preferred_len))
2654 if(!smb_io_enum_hnd("enum_hnd", &q_n->enum_hnd, ps, depth))
2660 /*******************************************************************
2661 Reads or writes a structure.
2662 ********************************************************************/
2664 BOOL srv_io_r_net_disk_enum(char *desc, SRV_R_NET_DISK_ENUM *r_n, prs_struct *ps, int depth)
2671 prs_debug(ps, depth, desc, "srv_io_r_net_disk_enum");
2677 if(!prs_uint32("entries_read", ps, depth, &r_n->disk_enum_ctr.entries_read))
2679 if(!prs_uint32("ptr_disk_info", ps, depth, &r_n->disk_enum_ctr.disk_info_ptr))
2682 /*this may be max, unknown, actual?*/
2684 if(!prs_uint32("max_elements", ps, depth, &r_n->disk_enum_ctr.entries_read))
2686 if(!prs_uint32("unknown", ps, depth, &r_n->disk_enum_ctr.unknown))
2688 if(!prs_uint32("actual_elements", ps, depth, &r_n->disk_enum_ctr.entries_read))
2691 for(i=0; i < r_n->disk_enum_ctr.entries_read; i++) {
2693 if(!prs_uint32("unknown", ps, depth, &r_n->disk_enum_ctr.disk_info[i].unknown))
2696 if(!smb_io_unistr3("disk_name", &r_n->disk_enum_ctr.disk_info[i].disk_name, ps, depth))
2703 if(!prs_uint32("total_entries", ps, depth, &r_n->total_entries))
2706 if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
2709 if(!prs_werror("status", ps, depth, &r_n->status))
2715 /*******************************************************************
2716 Reads or writes a structure.
2717 ********************************************************************/
2719 BOOL srv_io_q_net_name_validate(char *desc, SRV_Q_NET_NAME_VALIDATE *q_n, prs_struct *ps, int depth)
2724 prs_debug(ps, depth, desc, "srv_io_q_net_name_validate");
2730 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
2733 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2739 if(!smb_io_unistr2("", &q_n->uni_name, True, ps, depth))
2745 if(!prs_uint32("type", ps, depth, &q_n->type))
2748 if(!prs_uint32("flags", ps, depth, &q_n->flags))
2754 /*******************************************************************
2755 Reads or writes a structure.
2756 ********************************************************************/
2758 BOOL srv_io_r_net_name_validate(char *desc, SRV_R_NET_NAME_VALIDATE *r_n, prs_struct *ps, int depth)
2763 prs_debug(ps, depth, desc, "srv_io_r_net_name_validate");
2769 if(!prs_werror("status", ps, depth, &r_n->status))
2775 /*******************************************************************
2776 Reads or writes a structure.
2777 ********************************************************************/
2779 BOOL srv_io_q_net_file_query_secdesc(char *desc, SRV_Q_NET_FILE_QUERY_SECDESC *q_n, prs_struct *ps, int depth)
2784 prs_debug(ps, depth, desc, "srv_io_q_net_file_query_secdesc");
2790 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
2793 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2799 if(!prs_uint32("ptr_qual_name", ps, depth, &q_n->ptr_qual_name))
2802 if(!smb_io_unistr2("", &q_n->uni_qual_name, True, ps, depth))
2808 if(!smb_io_unistr2("", &q_n->uni_file_name, True, ps, depth))
2811 if(!prs_uint32("unknown1", ps, depth, &q_n->unknown1))
2814 if(!prs_uint32("unknown2", ps, depth, &q_n->unknown2))
2817 if(!prs_uint32("unknown3", ps, depth, &q_n->unknown3))
2823 /*******************************************************************
2824 Reads or writes a structure.
2825 ********************************************************************/
2827 BOOL srv_io_r_net_file_query_secdesc(char *desc, SRV_R_NET_FILE_QUERY_SECDESC *r_n, prs_struct *ps, int depth)
2832 prs_debug(ps, depth, desc, "srv_io_r_net_file_query_secdesc");
2838 if(!prs_uint32("ptr_response", ps, depth, &r_n->ptr_response))
2841 if(!prs_uint32("size_response", ps, depth, &r_n->size_response))
2844 if(!prs_uint32("ptr_secdesc", ps, depth, &r_n->ptr_secdesc))
2847 if(!prs_uint32("size_secdesc", ps, depth, &r_n->size_secdesc))
2850 if(!sec_io_desc("sec_desc", &r_n->sec_desc, ps, depth))
2856 if(!prs_werror("status", ps, depth, &r_n->status))
2862 /*******************************************************************
2863 Reads or writes a structure.
2864 ********************************************************************/
2866 BOOL srv_io_q_net_file_set_secdesc(char *desc, SRV_Q_NET_FILE_SET_SECDESC *q_n, prs_struct *ps, int depth)
2871 prs_debug(ps, depth, desc, "srv_io_q_net_file_set_secdesc");
2877 if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
2880 if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
2886 if(!prs_uint32("ptr_qual_name", ps, depth, &q_n->ptr_qual_name))
2889 if(!smb_io_unistr2("", &q_n->uni_qual_name, True, ps, depth))
2895 if(!smb_io_unistr2("", &q_n->uni_file_name, True, ps, depth))
2901 if(!prs_uint32("sec_info", ps, depth, &q_n->sec_info))
2904 if(!prs_uint32("size_set", ps, depth, &q_n->size_set))
2907 if(!prs_uint32("ptr_secdesc", ps, depth, &q_n->ptr_secdesc))
2910 if(!prs_uint32("size_secdesc", ps, depth, &q_n->size_secdesc))
2913 if(!sec_io_desc("sec_desc", &q_n->sec_desc, ps, depth))
2919 /*******************************************************************
2920 Reads or writes a structure.
2921 ********************************************************************/
2923 BOOL srv_io_r_net_file_set_secdesc(char *desc, SRV_R_NET_FILE_SET_SECDESC *r_n, prs_struct *ps, int depth)
2928 prs_debug(ps, depth, desc, "srv_io_r_net_file_set_secdesc");
2934 if(!prs_werror("status", ps, depth, &r_n->status))
2940 /*******************************************************************
2942 ********************************************************************/
2944 void init_srv_q_net_remote_tod(SRV_Q_NET_REMOTE_TOD *q_u, char *server)
2946 q_u->ptr_srv_name = 1;
2947 init_unistr2(&q_u->uni_srv_name, server, strlen(server) + 1);