2 * Unix SMB/Netbios implementation.
4 * RPC Pipe client / server routines
5 * Copyright (C) Andrew Tridgell 1992-2000,
6 * Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
7 * Copyright (C) Paul Ashton 1997-2000,
8 * Copyright (C) Elrond 2000,
9 * Copyright (C) Jeremy Allison 2001
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include "rpc_parse.h"
29 #include "rpc_client.h"
32 extern int DEBUGLEVEL
;
34 /*******************************************************************
35 inits a SAMR_Q_CLOSE_HND structure.
36 ********************************************************************/
38 void init_samr_q_close_hnd(SAMR_Q_CLOSE_HND
* q_c
, POLICY_HND
*hnd
)
40 DEBUG(5, ("init_samr_q_close_hnd\n"));
45 /*******************************************************************
46 reads or writes a structure.
47 ********************************************************************/
49 BOOL
samr_io_q_close_hnd(char *desc
, SAMR_Q_CLOSE_HND
* q_u
,
50 prs_struct
*ps
, int depth
)
55 prs_debug(ps
, depth
, desc
, "samr_io_q_close_hnd");
61 return smb_io_pol_hnd("pol", &q_u
->pol
, ps
, depth
);
64 /*******************************************************************
65 reads or writes a structure.
66 ********************************************************************/
68 BOOL
samr_io_r_close_hnd(char *desc
, SAMR_R_CLOSE_HND
* r_u
,
69 prs_struct
*ps
, int depth
)
74 prs_debug(ps
, depth
, desc
, "samr_io_r_close_hnd");
80 if(!smb_io_pol_hnd("pol", &r_u
->pol
, ps
, depth
))
83 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
89 /*******************************************************************
90 inits a SAMR_Q_LOOKUP_DOMAIN structure.
91 ********************************************************************/
93 void init_samr_q_lookup_domain(SAMR_Q_LOOKUP_DOMAIN
* q_u
,
94 POLICY_HND
*pol
, char *dom_name
)
96 int len_name
= strlen(dom_name
);
98 DEBUG(5, ("init_samr_q_lookup_domain\n"));
100 q_u
->connect_pol
= *pol
;
102 init_uni_hdr(&q_u
->hdr_domain
, len_name
);
103 init_unistr2(&q_u
->uni_domain
, dom_name
, len_name
);
106 /*******************************************************************
107 reads or writes a structure.
108 ********************************************************************/
109 BOOL
samr_io_q_lookup_domain(char *desc
, SAMR_Q_LOOKUP_DOMAIN
* q_u
,
110 prs_struct
*ps
, int depth
)
115 prs_debug(ps
, depth
, desc
, "samr_io_q_lookup_domain");
121 if(!smb_io_pol_hnd("connect_pol", &q_u
->connect_pol
, ps
, depth
))
124 if(!smb_io_unihdr("hdr_domain", &q_u
->hdr_domain
, ps
, depth
))
127 if(!smb_io_unistr2("uni_domain", &q_u
->uni_domain
, q_u
->hdr_domain
.buffer
, ps
, depth
))
133 /*******************************************************************
134 inits a SAMR_R_LOOKUP_DOMAIN structure.
135 ********************************************************************/
137 void init_samr_r_lookup_domain(SAMR_R_LOOKUP_DOMAIN
* r_u
,
138 DOM_SID
*dom_sid
, uint32 status
)
140 DEBUG(5, ("init_samr_r_lookup_domain\n"));
142 r_u
->status
= status
;
146 init_dom_sid2(&r_u
->dom_sid
, dom_sid
);
150 /*******************************************************************
151 reads or writes a structure.
152 ********************************************************************/
154 BOOL
samr_io_r_lookup_domain(char *desc
, SAMR_R_LOOKUP_DOMAIN
* r_u
,
155 prs_struct
*ps
, int depth
)
160 prs_debug(ps
, depth
, desc
, "samr_io_r_lookup_domain");
166 if(!prs_uint32("ptr", ps
, depth
, &r_u
->ptr_sid
))
169 if (r_u
->ptr_sid
!= 0) {
170 if(!smb_io_dom_sid2("sid", &r_u
->dom_sid
, ps
, depth
))
176 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
182 /*******************************************************************
183 reads or writes a structure.
184 ********************************************************************/
186 void init_samr_q_unknown_2d(SAMR_Q_UNKNOWN_2D
* q_u
, POLICY_HND
*dom_pol
, DOM_SID
*sid
)
188 DEBUG(5, ("samr_init_samr_q_unknown_2d\n"));
190 q_u
->dom_pol
= *dom_pol
;
191 init_dom_sid2(&q_u
->sid
, sid
);
194 /*******************************************************************
195 reads or writes a structure.
196 ********************************************************************/
198 BOOL
samr_io_q_unknown_2d(char *desc
, SAMR_Q_UNKNOWN_2D
* q_u
,
199 prs_struct
*ps
, int depth
)
204 prs_debug(ps
, depth
, desc
, "samr_io_q_unknown_2d");
210 if(!smb_io_pol_hnd("domain_pol", &q_u
->dom_pol
, ps
, depth
))
213 if(!smb_io_dom_sid2("sid", &q_u
->sid
, ps
, depth
))
222 /*******************************************************************
223 reads or writes a structure.
224 ********************************************************************/
226 BOOL
samr_io_r_unknown_2d(char *desc
, SAMR_R_UNKNOWN_2D
* r_u
,
227 prs_struct
*ps
, int depth
)
232 prs_debug(ps
, depth
, desc
, "samr_io_r_unknown_2d");
238 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
244 /*******************************************************************
245 reads or writes a structure.
246 ********************************************************************/
248 void init_samr_q_open_domain(SAMR_Q_OPEN_DOMAIN
* q_u
,
249 POLICY_HND
*pol
, uint32 flags
,
252 DEBUG(5, ("samr_init_samr_q_open_domain\n"));
256 init_dom_sid2(&q_u
->dom_sid
, sid
);
259 /*******************************************************************
260 reads or writes a structure.
261 ********************************************************************/
263 BOOL
samr_io_q_open_domain(char *desc
, SAMR_Q_OPEN_DOMAIN
* q_u
,
264 prs_struct
*ps
, int depth
)
269 prs_debug(ps
, depth
, desc
, "samr_io_q_open_domain");
275 if(!smb_io_pol_hnd("pol", &q_u
->pol
, ps
, depth
))
278 if(!prs_uint32("flags", ps
, depth
, &q_u
->flags
))
281 if(!smb_io_dom_sid2("sid", &q_u
->dom_sid
, ps
, depth
))
287 /*******************************************************************
288 reads or writes a structure.
289 ********************************************************************/
291 BOOL
samr_io_r_open_domain(char *desc
, SAMR_R_OPEN_DOMAIN
* r_u
,
292 prs_struct
*ps
, int depth
)
297 prs_debug(ps
, depth
, desc
, "samr_io_r_open_domain");
303 if(!smb_io_pol_hnd("domain_pol", &r_u
->domain_pol
, ps
, depth
))
306 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
312 /*******************************************************************
313 reads or writes a structure.
314 ********************************************************************/
316 void init_samr_q_get_usrdom_pwinfo(SAMR_Q_GET_USRDOM_PWINFO
* q_u
,
317 POLICY_HND
*user_pol
)
319 DEBUG(5, ("samr_init_samr_q_get_usrdom_pwinfo\n"));
321 q_u
->user_pol
= *user_pol
;
324 /*******************************************************************
325 reads or writes a structure.
326 ********************************************************************/
328 BOOL
samr_io_q_get_usrdom_pwinfo(char *desc
, SAMR_Q_GET_USRDOM_PWINFO
* q_u
,
329 prs_struct
*ps
, int depth
)
334 prs_debug(ps
, depth
, desc
, "samr_io_q_get_usrdom_pwinfo");
340 return smb_io_pol_hnd("user_pol", &q_u
->user_pol
, ps
, depth
);
343 /*******************************************************************
345 ********************************************************************/
347 void init_samr_r_get_usrdom_pwinfo(SAMR_R_GET_USRDOM_PWINFO
*r_u
, uint32 status
)
349 DEBUG(5, ("init_samr_r_get_usrdom_pwinfo\n"));
351 r_u
->unknown_0
= 0x0000;
352 r_u
->unknown_1
= 0x0015;
353 r_u
->unknown_2
= 0x00000000;
355 r_u
->status
= status
;
358 /*******************************************************************
359 reads or writes a structure.
360 ********************************************************************/
362 BOOL
samr_io_r_get_usrdom_pwinfo(char *desc
, SAMR_R_GET_USRDOM_PWINFO
* r_u
,
363 prs_struct
*ps
, int depth
)
368 prs_debug(ps
, depth
, desc
, "samr_io_r_get_usrdom_pwinfo");
374 if(!prs_uint16("unknown_0", ps
, depth
, &r_u
->unknown_0
))
376 if(!prs_uint16("unknown_1", ps
, depth
, &r_u
->unknown_1
))
378 if(!prs_uint32("unknown_2", ps
, depth
, &r_u
->unknown_2
))
380 if(!prs_uint32("status ", ps
, depth
, &r_u
->status
))
386 /*******************************************************************
387 reads or writes a structure.
388 ********************************************************************/
390 void init_samr_q_query_sec_obj(SAMR_Q_QUERY_SEC_OBJ
* q_u
,
391 POLICY_HND
*user_pol
, uint32 sec_info
)
393 DEBUG(5, ("samr_init_samr_q_query_sec_obj\n"));
395 q_u
->user_pol
= *user_pol
;
396 q_u
->sec_info
= sec_info
;
400 /*******************************************************************
401 reads or writes a structure.
402 ********************************************************************/
404 BOOL
samr_io_q_query_sec_obj(char *desc
, SAMR_Q_QUERY_SEC_OBJ
* q_u
,
405 prs_struct
*ps
, int depth
)
410 prs_debug(ps
, depth
, desc
, "samr_io_q_query_sec_obj");
416 if(!smb_io_pol_hnd("user_pol", &q_u
->user_pol
, ps
, depth
))
419 if(!prs_uint32("sec_info", ps
, depth
, &q_u
->sec_info
))
425 /*******************************************************************
426 reads or writes a structure.
427 ********************************************************************/
429 void init_samr_q_query_dom_info(SAMR_Q_QUERY_DOMAIN_INFO
* q_u
,
430 POLICY_HND
*domain_pol
, uint16 switch_value
)
432 DEBUG(5, ("samr_init_samr_q_query_dom_info\n"));
434 q_u
->domain_pol
= *domain_pol
;
435 q_u
->switch_value
= switch_value
;
438 /*******************************************************************
439 reads or writes a structure.
440 ********************************************************************/
442 BOOL
samr_io_q_query_dom_info(char *desc
, SAMR_Q_QUERY_DOMAIN_INFO
* q_u
,
443 prs_struct
*ps
, int depth
)
448 prs_debug(ps
, depth
, desc
, "samr_io_q_query_dom_info");
454 if(!smb_io_pol_hnd("domain_pol", &q_u
->domain_pol
, ps
, depth
))
457 if(!prs_uint16("switch_value", ps
, depth
, &q_u
->switch_value
))
464 /*******************************************************************
466 ********************************************************************/
468 void init_unk_info3(SAM_UNK_INFO_3
* u_3
)
470 u_3
->unknown_0
= 0x00000000;
471 u_3
->unknown_1
= 0x80000000;
474 /*******************************************************************
475 reads or writes a structure.
476 ********************************************************************/
478 static BOOL
sam_io_unk_info3(char *desc
, SAM_UNK_INFO_3
* u_3
,
479 prs_struct
*ps
, int depth
)
484 prs_debug(ps
, depth
, desc
, "sam_io_unk_info3");
487 if(!prs_uint32("unknown_0", ps
, depth
, &u_3
->unknown_0
)) /* 0x0000 0000 */
489 if(!prs_uint32("unknown_1", ps
, depth
, &u_3
->unknown_1
)) /* 0x8000 0000 */
495 /*******************************************************************
497 ********************************************************************/
499 void init_unk_info6(SAM_UNK_INFO_6
* u_6
)
501 u_6
->unknown_0
= 0x00000000;
503 memset(u_6
->padding
, 0, sizeof(u_6
->padding
)); /* 12 bytes zeros */
506 /*******************************************************************
507 reads or writes a structure.
508 ********************************************************************/
510 static BOOL
sam_io_unk_info6(char *desc
, SAM_UNK_INFO_6
* u_6
,
511 prs_struct
*ps
, int depth
)
516 prs_debug(ps
, depth
, desc
, "sam_io_unk_info6");
519 if(!prs_uint32("unknown_0", ps
, depth
, &u_6
->unknown_0
)) /* 0x0000 0000 */
521 if(!prs_uint32("ptr_0", ps
, depth
, &u_6
->ptr_0
)) /* pointer to unknown structure */
523 if(!prs_uint8s(False
, "padding", ps
, depth
, u_6
->padding
, sizeof(u_6
->padding
))) /* 12 bytes zeros */
529 /*******************************************************************
531 ********************************************************************/
533 void init_unk_info7(SAM_UNK_INFO_7
* u_7
)
535 u_7
->unknown_0
= 0x0003;
538 /*******************************************************************
539 reads or writes a structure.
540 ********************************************************************/
542 static BOOL
sam_io_unk_info7(char *desc
, SAM_UNK_INFO_7
* u_7
,
543 prs_struct
*ps
, int depth
)
548 prs_debug(ps
, depth
, desc
, "sam_io_unk_info7");
551 if(!prs_uint16("unknown_0", ps
, depth
, &u_7
->unknown_0
)) /* 0x0003 */
557 /*******************************************************************
559 ********************************************************************/
561 void init_unk_info12(SAM_UNK_INFO_12
* u_12
)
563 u_12
->unknown_0
= 0xcf1dcc00;
564 u_12
->unknown_1
= 0xfffffffb;
565 u_12
->unknown_2
= 0xcf1dcc00;
566 u_12
->unknown_3
= 0xfffffffb;
568 u_12
->unknown_4
= 0x8a880000;
571 /*******************************************************************
572 reads or writes a structure.
573 ********************************************************************/
575 static BOOL
sam_io_unk_info12(char *desc
, SAM_UNK_INFO_12
* u_12
,
576 prs_struct
*ps
, int depth
)
581 prs_debug(ps
, depth
, desc
, "sam_io_unk_info12");
584 if(!prs_uint32("unknown_0", ps
, depth
, &u_12
->unknown_0
))
586 if(!prs_uint32("unknown_1", ps
, depth
, &u_12
->unknown_1
))
588 if(!prs_uint32("unknown_2", ps
, depth
, &u_12
->unknown_2
))
590 if(!prs_uint32("unknown_3", ps
, depth
, &u_12
->unknown_3
))
592 if(!prs_uint32("unknown_4", ps
, depth
, &u_12
->unknown_4
))
598 /*******************************************************************
600 ********************************************************************/
601 void init_unk_info2(SAM_UNK_INFO_2
* u_2
,
602 char *domain
, char *server
,
605 int len_domain
= strlen(domain
);
606 int len_server
= strlen(server
);
608 u_2
->unknown_0
= 0x00000000;
609 u_2
->unknown_1
= 0x80000000;
610 u_2
->unknown_2
= 0x00000000;
613 init_uni_hdr(&u_2
->hdr_domain
, len_domain
);
614 init_uni_hdr(&u_2
->hdr_server
, len_server
);
616 u_2
->seq_num
= seq_num
;
617 u_2
->unknown_3
= 0x00000000;
619 u_2
->unknown_4
= 0x00000001;
620 u_2
->unknown_5
= 0x00000003;
621 u_2
->unknown_6
= 0x00000001;
622 u_2
->num_domain_usrs
= MAX_SAM_ENTRIES
;
623 u_2
->num_domain_grps
= MAX_SAM_ENTRIES
;
624 u_2
->num_local_grps
= MAX_SAM_ENTRIES
;
626 memset(u_2
->padding
, 0, sizeof(u_2
->padding
)); /* 12 bytes zeros */
628 init_unistr2(&u_2
->uni_domain
, domain
, len_domain
);
629 init_unistr2(&u_2
->uni_server
, server
, len_server
);
632 /*******************************************************************
633 reads or writes a structure.
634 ********************************************************************/
636 static BOOL
sam_io_unk_info2(char *desc
, SAM_UNK_INFO_2
* u_2
,
637 prs_struct
*ps
, int depth
)
642 prs_debug(ps
, depth
, desc
, "sam_io_unk_info2");
645 if(!prs_uint32("unknown_0", ps
, depth
, &u_2
->unknown_0
)) /* 0x0000 0000 */
647 if(!prs_uint32("unknown_1", ps
, depth
, &u_2
->unknown_1
)) /* 0x8000 0000 */
649 if(!prs_uint32("unknown_2", ps
, depth
, &u_2
->unknown_2
)) /* 0x0000 0000 */
652 if(!prs_uint32("ptr_0", ps
, depth
, &u_2
->ptr_0
))
654 if(!smb_io_unihdr("hdr_domain", &u_2
->hdr_domain
, ps
, depth
))
656 if(!smb_io_unihdr("hdr_server", &u_2
->hdr_server
, ps
, depth
))
659 /* put all the data in here, at the moment, including what the above
660 pointer is referring to
663 if(!prs_uint32("seq_num ", ps
, depth
, &u_2
->seq_num
)) /* 0x0000 0099 or 0x1000 0000 */
665 if(!prs_uint32("unknown_3 ", ps
, depth
, &u_2
->unknown_3
)) /* 0x0000 0000 */
668 if(!prs_uint32("unknown_4 ", ps
, depth
, &u_2
->unknown_4
)) /* 0x0000 0001 */
670 if(!prs_uint32("unknown_5 ", ps
, depth
, &u_2
->unknown_5
)) /* 0x0000 0003 */
672 if(!prs_uint32("unknown_6 ", ps
, depth
, &u_2
->unknown_6
)) /* 0x0000 0001 */
674 if(!prs_uint32("num_domain_usrs ", ps
, depth
, &u_2
->num_domain_usrs
))
676 if(!prs_uint32("num_domain_grps", ps
, depth
, &u_2
->num_domain_grps
))
678 if(!prs_uint32("num_local_grps", ps
, depth
, &u_2
->num_local_grps
))
681 if(!prs_uint8s(False
, "padding", ps
, depth
, u_2
->padding
,sizeof(u_2
->padding
)))
684 if(!smb_io_unistr2("uni_domain", &u_2
->uni_domain
, u_2
->hdr_domain
.buffer
, ps
, depth
))
686 if(!smb_io_unistr2("uni_server", &u_2
->uni_server
, u_2
->hdr_server
.buffer
, ps
, depth
))
692 /*******************************************************************
694 ********************************************************************/
696 void init_unk_info1(SAM_UNK_INFO_1
* u_1
)
698 memset(u_1
->padding
, 0, sizeof(u_1
->padding
)); /* 12 bytes zeros */
699 u_1
->unknown_1
= 0x80000000;
700 u_1
->unknown_2
= 0x00000000;
703 /*******************************************************************
704 reads or writes a structure.
705 ********************************************************************/
707 static BOOL
sam_io_unk_info1(char *desc
, SAM_UNK_INFO_1
* u_1
,
708 prs_struct
*ps
, int depth
)
713 prs_debug(ps
, depth
, desc
, "sam_io_unk_info1");
716 if(!prs_uint8s(False
, "padding", ps
, depth
, u_1
->padding
, sizeof(u_1
->padding
)))
719 if(!prs_uint32("unknown_1", ps
, depth
, &u_1
->unknown_1
)) /* 0x8000 0000 */
721 if(!prs_uint32("unknown_2", ps
, depth
, &u_1
->unknown_2
)) /* 0x0000 0000 */
727 /*******************************************************************
728 inits a SAMR_R_QUERY_DOMAIN_INFO structure.
729 ********************************************************************/
731 void init_samr_r_query_dom_info(SAMR_R_QUERY_DOMAIN_INFO
* r_u
,
732 uint16 switch_value
, SAM_UNK_CTR
* ctr
,
735 DEBUG(5, ("init_samr_r_query_dom_info\n"));
738 r_u
->switch_value
= 0;
739 r_u
->status
= status
; /* return status */
742 r_u
->switch_value
= switch_value
;
748 /*******************************************************************
749 reads or writes a structure.
750 ********************************************************************/
752 BOOL
samr_io_r_query_dom_info(char *desc
, SAMR_R_QUERY_DOMAIN_INFO
* r_u
,
753 prs_struct
*ps
, int depth
)
758 prs_debug(ps
, depth
, desc
, "samr_io_r_query_dom_info");
764 if(!prs_uint32("ptr_0 ", ps
, depth
, &r_u
->ptr_0
))
767 if (r_u
->ptr_0
!= 0 && r_u
->ctr
!= NULL
) {
768 if(!prs_uint16("switch_value", ps
, depth
, &r_u
->switch_value
))
773 switch (r_u
->switch_value
) {
775 if(!sam_io_unk_info12("unk_inf12", &r_u
->ctr
->info
.inf12
, ps
, depth
))
779 if(!sam_io_unk_info7("unk_inf7",&r_u
->ctr
->info
.inf7
, ps
,depth
))
783 if(!sam_io_unk_info6("unk_inf6",&r_u
->ctr
->info
.inf6
, ps
,depth
))
787 if(!sam_io_unk_info3("unk_inf3",&r_u
->ctr
->info
.inf3
, ps
,depth
))
791 if(!sam_io_unk_info2("unk_inf2",&r_u
->ctr
->info
.inf2
, ps
,depth
))
795 if(!sam_io_unk_info1("unk_inf1",&r_u
->ctr
->info
.inf1
, ps
,depth
))
799 DEBUG(0, ("samr_io_r_query_dom_info: unknown switch level 0x%x\n",
801 r_u
->status
= NT_STATUS_INVALID_INFO_CLASS
;
809 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
815 /*******************************************************************
816 reads or writes a SAMR_R_QUERY_SEC_OBJ structure.
817 ********************************************************************/
819 BOOL
samr_io_r_query_sec_obj(char *desc
, SAMR_R_QUERY_SEC_OBJ
* r_u
,
820 prs_struct
*ps
, int depth
)
825 prs_debug(ps
, depth
, desc
, "samr_io_r_query_sec_obj");
831 if(!prs_uint32("ptr", ps
, depth
, &r_u
->ptr
))
834 if(!sec_io_desc_buf("sec", &r_u
->buf
, ps
, depth
))
838 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
844 /*******************************************************************
845 reads or writes a SAM_STR1 structure.
846 ********************************************************************/
848 static BOOL
sam_io_sam_str1(char *desc
, SAM_STR1
* sam
, uint32 acct_buf
,
849 uint32 name_buf
, uint32 desc_buf
,
850 prs_struct
*ps
, int depth
)
855 prs_debug(ps
, depth
, desc
, "sam_io_sam_str1");
860 if (!smb_io_unistr2("name", &sam
->uni_acct_name
, acct_buf
, ps
, depth
))
863 if (!smb_io_unistr2("desc", &sam
->uni_acct_desc
, desc_buf
, ps
, depth
))
866 if (!smb_io_unistr2("full", &sam
->uni_full_name
, name_buf
, ps
, depth
))
872 /*******************************************************************
873 inits a SAM_ENTRY1 structure.
874 ********************************************************************/
876 static void init_sam_entry1(SAM_ENTRY1
* sam
, uint32 user_idx
,
877 uint32 len_sam_name
, uint32 len_sam_full
,
878 uint32 len_sam_desc
, uint32 rid_user
,
881 DEBUG(5, ("init_sam_entry1\n"));
883 sam
->user_idx
= user_idx
;
884 sam
->rid_user
= rid_user
;
885 sam
->acb_info
= acb_info
;
888 init_uni_hdr(&sam
->hdr_acct_name
, len_sam_name
);
889 init_uni_hdr(&sam
->hdr_user_name
, len_sam_full
);
890 init_uni_hdr(&sam
->hdr_user_desc
, len_sam_desc
);
893 /*******************************************************************
894 reads or writes a SAM_ENTRY1 structure.
895 ********************************************************************/
897 static BOOL
sam_io_sam_entry1(char *desc
, SAM_ENTRY1
* sam
,
898 prs_struct
*ps
, int depth
)
903 prs_debug(ps
, depth
, desc
, "sam_io_sam_entry1");
909 if(!prs_uint32("user_idx ", ps
, depth
, &sam
->user_idx
))
912 if(!prs_uint32("rid_user ", ps
, depth
, &sam
->rid_user
))
914 if(!prs_uint16("acb_info ", ps
, depth
, &sam
->acb_info
))
916 if(!prs_uint16("pad ", ps
, depth
, &sam
->pad
))
919 if (!smb_io_unihdr("hdr_acct_name", &sam
->hdr_acct_name
, ps
, depth
))
921 if (!smb_io_unihdr("hdr_user_desc", &sam
->hdr_user_desc
, ps
, depth
))
923 if (!smb_io_unihdr("hdr_user_name", &sam
->hdr_user_name
, ps
, depth
))
929 /*******************************************************************
930 reads or writes a SAM_STR2 structure.
931 ********************************************************************/
933 static BOOL
sam_io_sam_str2(char *desc
, SAM_STR2
* sam
, uint32 acct_buf
,
934 uint32 desc_buf
, prs_struct
*ps
, int depth
)
939 prs_debug(ps
, depth
, desc
, "sam_io_sam_str2");
945 if(!smb_io_unistr2("uni_srv_name", &sam
->uni_srv_name
, acct_buf
, ps
, depth
)) /* account name unicode string */
947 if(!smb_io_unistr2("uni_srv_desc", &sam
->uni_srv_desc
, desc_buf
, ps
, depth
)) /* account desc unicode string */
953 /*******************************************************************
954 inits a SAM_ENTRY2 structure.
955 ********************************************************************/
956 static void init_sam_entry2(SAM_ENTRY2
* sam
, uint32 user_idx
,
957 uint32 len_sam_name
, uint32 len_sam_desc
,
958 uint32 rid_user
, uint16 acb_info
)
960 DEBUG(5, ("init_sam_entry2\n"));
962 sam
->user_idx
= user_idx
;
963 sam
->rid_user
= rid_user
;
964 sam
->acb_info
= acb_info
;
967 init_uni_hdr(&sam
->hdr_srv_name
, len_sam_name
);
968 init_uni_hdr(&sam
->hdr_srv_desc
, len_sam_desc
);
971 /*******************************************************************
972 reads or writes a SAM_ENTRY2 structure.
973 ********************************************************************/
975 static BOOL
sam_io_sam_entry2(char *desc
, SAM_ENTRY2
* sam
,
976 prs_struct
*ps
, int depth
)
981 prs_debug(ps
, depth
, desc
, "sam_io_sam_entry2");
987 if(!prs_uint32("user_idx ", ps
, depth
, &sam
->user_idx
))
990 if(!prs_uint32("rid_user ", ps
, depth
, &sam
->rid_user
))
992 if(!prs_uint16("acb_info ", ps
, depth
, &sam
->acb_info
))
994 if(!prs_uint16("pad ", ps
, depth
, &sam
->pad
))
997 if(!smb_io_unihdr("unihdr", &sam
->hdr_srv_name
, ps
, depth
)) /* account name unicode string header */
999 if(!smb_io_unihdr("unihdr", &sam
->hdr_srv_desc
, ps
, depth
)) /* account name unicode string header */
1005 /*******************************************************************
1006 reads or writes a SAM_STR3 structure.
1007 ********************************************************************/
1009 static BOOL
sam_io_sam_str3(char *desc
, SAM_STR3
* sam
, uint32 acct_buf
,
1010 uint32 desc_buf
, prs_struct
*ps
, int depth
)
1015 prs_debug(ps
, depth
, desc
, "sam_io_sam_str3");
1021 if(!smb_io_unistr2("uni_grp_name", &sam
->uni_grp_name
, acct_buf
, ps
, depth
)) /* account name unicode string */
1023 if(!smb_io_unistr2("uni_grp_desc", &sam
->uni_grp_desc
, desc_buf
, ps
, depth
)) /* account desc unicode string */
1029 /*******************************************************************
1030 inits a SAM_ENTRY3 structure.
1031 ********************************************************************/
1033 static void init_sam_entry3(SAM_ENTRY3
* sam
, uint32 grp_idx
,
1034 uint32 len_grp_name
, uint32 len_grp_desc
,
1037 DEBUG(5, ("init_sam_entry3\n"));
1039 sam
->grp_idx
= grp_idx
;
1040 sam
->rid_grp
= rid_grp
;
1041 sam
->attr
= 0x07; /* group rid attributes - gets ignored by nt 4.0 */
1043 init_uni_hdr(&sam
->hdr_grp_name
, len_grp_name
);
1044 init_uni_hdr(&sam
->hdr_grp_desc
, len_grp_desc
);
1047 /*******************************************************************
1048 reads or writes a SAM_ENTRY3 structure.
1049 ********************************************************************/
1051 static BOOL
sam_io_sam_entry3(char *desc
, SAM_ENTRY3
* sam
,
1052 prs_struct
*ps
, int depth
)
1057 prs_debug(ps
, depth
, desc
, "sam_io_sam_entry3");
1063 if(!prs_uint32("grp_idx", ps
, depth
, &sam
->grp_idx
))
1066 if(!prs_uint32("rid_grp", ps
, depth
, &sam
->rid_grp
))
1068 if(!prs_uint32("attr ", ps
, depth
, &sam
->attr
))
1071 if(!smb_io_unihdr("unihdr", &sam
->hdr_grp_name
, ps
, depth
)) /* account name unicode string header */
1073 if(!smb_io_unihdr("unihdr", &sam
->hdr_grp_desc
, ps
, depth
)) /* account name unicode string header */
1079 /*******************************************************************
1080 inits a SAM_ENTRY4 structure.
1081 ********************************************************************/
1083 static void init_sam_entry4(SAM_ENTRY4
* sam
, uint32 user_idx
,
1084 uint32 len_acct_name
)
1086 DEBUG(5, ("init_sam_entry4\n"));
1088 sam
->user_idx
= user_idx
;
1089 init_str_hdr(&sam
->hdr_acct_name
, len_acct_name
, len_acct_name
,
1090 len_acct_name
!= 0);
1093 /*******************************************************************
1094 reads or writes a SAM_ENTRY4 structure.
1095 ********************************************************************/
1097 static BOOL
sam_io_sam_entry4(char *desc
, SAM_ENTRY4
* sam
,
1098 prs_struct
*ps
, int depth
)
1103 prs_debug(ps
, depth
, desc
, "sam_io_sam_entry4");
1109 if(!prs_uint32("user_idx", ps
, depth
, &sam
->user_idx
))
1111 if(!smb_io_strhdr("strhdr", &sam
->hdr_acct_name
, ps
, depth
))
1117 /*******************************************************************
1118 inits a SAM_ENTRY5 structure.
1119 ********************************************************************/
1121 static void init_sam_entry5(SAM_ENTRY5
* sam
, uint32 grp_idx
,
1122 uint32 len_grp_name
)
1124 DEBUG(5, ("init_sam_entry5\n"));
1126 sam
->grp_idx
= grp_idx
;
1127 init_str_hdr(&sam
->hdr_grp_name
, len_grp_name
, len_grp_name
,
1131 /*******************************************************************
1132 reads or writes a SAM_ENTRY5 structure.
1133 ********************************************************************/
1135 static BOOL
sam_io_sam_entry5(char *desc
, SAM_ENTRY5
* sam
,
1136 prs_struct
*ps
, int depth
)
1141 prs_debug(ps
, depth
, desc
, "sam_io_sam_entry5");
1147 if(!prs_uint32("grp_idx", ps
, depth
, &sam
->grp_idx
))
1149 if(!smb_io_strhdr("strhdr", &sam
->hdr_grp_name
, ps
, depth
))
1155 /*******************************************************************
1156 inits a SAM_ENTRY structure.
1157 ********************************************************************/
1159 void init_sam_entry(SAM_ENTRY
* sam
, uint32 len_sam_name
, uint32 rid
)
1161 DEBUG(10, ("init_sam_entry: %d %d\n", len_sam_name
, rid
));
1164 init_uni_hdr(&sam
->hdr_name
, len_sam_name
);
1167 /*******************************************************************
1168 reads or writes a SAM_ENTRY structure.
1169 ********************************************************************/
1171 static BOOL
sam_io_sam_entry(char *desc
, SAM_ENTRY
* sam
,
1172 prs_struct
*ps
, int depth
)
1177 prs_debug(ps
, depth
, desc
, "sam_io_sam_entry");
1182 if(!prs_uint32("rid", ps
, depth
, &sam
->rid
))
1184 if(!smb_io_unihdr("unihdr", &sam
->hdr_name
, ps
, depth
)) /* account name unicode string header */
1190 /*******************************************************************
1191 inits a SAMR_Q_ENUM_DOM_USERS structure.
1192 ********************************************************************/
1194 void init_samr_q_enum_dom_users(SAMR_Q_ENUM_DOM_USERS
* q_e
, POLICY_HND
*pol
,
1196 uint16 acb_mask
, uint16 unk_1
, uint32 size
)
1198 DEBUG(5, ("init_samr_q_enum_dom_users\n"));
1202 q_e
->start_idx
= start_idx
; /* zero indicates lots */
1203 q_e
->acb_mask
= acb_mask
;
1204 q_e
->unknown_1
= unk_1
;
1205 q_e
->max_size
= size
;
1208 /*******************************************************************
1209 reads or writes a structure.
1210 ********************************************************************/
1212 BOOL
samr_io_q_enum_dom_users(char *desc
, SAMR_Q_ENUM_DOM_USERS
* q_e
,
1213 prs_struct
*ps
, int depth
)
1218 prs_debug(ps
, depth
, desc
, "samr_io_q_enum_dom_users");
1224 if(!smb_io_pol_hnd("domain_pol", &q_e
->pol
, ps
, depth
))
1227 if(!prs_uint32("start_idx", ps
, depth
, &q_e
->start_idx
))
1229 if(!prs_uint16("acb_mask ", ps
, depth
, &q_e
->acb_mask
))
1231 if(!prs_uint16("unknown_1", ps
, depth
, &q_e
->unknown_1
))
1234 if(!prs_uint32("max_size ", ps
, depth
, &q_e
->max_size
))
1241 /*******************************************************************
1242 inits a SAMR_R_ENUM_DOM_USERS structure.
1243 ********************************************************************/
1245 void init_samr_r_enum_dom_users(SAMR_R_ENUM_DOM_USERS
* r_u
,
1246 uint32 next_idx
, uint32 num_sam_entries
)
1248 DEBUG(5, ("init_samr_r_enum_dom_users\n"));
1250 r_u
->next_idx
= next_idx
;
1252 if (num_sam_entries
!= 0) {
1253 r_u
->ptr_entries1
= 1;
1254 r_u
->ptr_entries2
= 1;
1255 r_u
->num_entries2
= num_sam_entries
;
1256 r_u
->num_entries3
= num_sam_entries
;
1258 r_u
->num_entries4
= num_sam_entries
;
1260 r_u
->ptr_entries1
= 0;
1261 r_u
->num_entries2
= num_sam_entries
;
1262 r_u
->ptr_entries2
= 1;
1266 /*******************************************************************
1267 reads or writes a structure.
1268 ********************************************************************/
1270 BOOL
samr_io_r_enum_dom_users(char *desc
, SAMR_R_ENUM_DOM_USERS
* r_u
,
1271 prs_struct
*ps
, int depth
)
1278 prs_debug(ps
, depth
, desc
, "samr_io_r_enum_dom_users");
1284 if(!prs_uint32("next_idx ", ps
, depth
, &r_u
->next_idx
))
1286 if(!prs_uint32("ptr_entries1", ps
, depth
, &r_u
->ptr_entries1
))
1289 if (r_u
->ptr_entries1
!= 0) {
1290 if(!prs_uint32("num_entries2", ps
, depth
, &r_u
->num_entries2
))
1292 if(!prs_uint32("ptr_entries2", ps
, depth
, &r_u
->ptr_entries2
))
1294 if(!prs_uint32("num_entries3", ps
, depth
, &r_u
->num_entries3
))
1297 if (UNMARSHALLING(ps
) && (r_u
->num_entries2
!= 0)) {
1298 r_u
->sam
= (SAM_ENTRY
*)prs_alloc_mem(ps
,sizeof(SAM_ENTRY
)*r_u
->num_entries2
);
1299 r_u
->uni_acct_name
= (UNISTR2
*)prs_alloc_mem(ps
,sizeof(UNISTR2
)*r_u
->num_entries2
);
1302 if ((r_u
->sam
== NULL
|| r_u
->uni_acct_name
== NULL
) && r_u
->num_entries2
!= 0) {
1303 DEBUG(0,("NULL pointers in SAMR_R_ENUM_DOM_USERS\n"));
1304 r_u
->num_entries4
= 0;
1305 r_u
->status
= NT_STATUS_MEMORY_NOT_ALLOCATED
;
1309 for (i
= 0; i
< r_u
->num_entries2
; i
++) {
1310 if(!sam_io_sam_entry("", &r_u
->sam
[i
], ps
, depth
))
1314 for (i
= 0; i
< r_u
->num_entries2
; i
++) {
1315 if(!smb_io_unistr2("", &r_u
->uni_acct_name
[i
],r_u
->sam
[i
].hdr_name
.buffer
, ps
,depth
))
1324 if(!prs_uint32("num_entries4", ps
, depth
, &r_u
->num_entries4
))
1326 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
1332 /*******************************************************************
1333 inits a SAMR_Q_QUERY_DISPINFO structure.
1334 ********************************************************************/
1336 void init_samr_q_query_dispinfo(SAMR_Q_QUERY_DISPINFO
* q_e
, POLICY_HND
*pol
,
1337 uint16 switch_level
, uint32 start_idx
,
1340 DEBUG(5, ("init_samr_q_query_dispinfo\n"));
1342 q_e
->domain_pol
= *pol
;
1344 q_e
->switch_level
= switch_level
;
1346 q_e
->start_idx
= start_idx
;
1347 q_e
->max_entries
= max_entries
;
1348 q_e
->max_size
= 0xffff; /* Not especially useful */
1351 /*******************************************************************
1352 reads or writes a structure.
1353 ********************************************************************/
1355 BOOL
samr_io_q_query_dispinfo(char *desc
, SAMR_Q_QUERY_DISPINFO
* q_e
,
1356 prs_struct
*ps
, int depth
)
1361 prs_debug(ps
, depth
, desc
, "samr_io_q_query_dispinfo");
1367 if(!smb_io_pol_hnd("domain_pol", &q_e
->domain_pol
, ps
, depth
))
1370 if(!prs_uint16("switch_level", ps
, depth
, &q_e
->switch_level
))
1375 if(!prs_uint32("start_idx ", ps
, depth
, &q_e
->start_idx
))
1377 if(!prs_uint32("max_entries ", ps
, depth
, &q_e
->max_entries
))
1379 if(!prs_uint32("max_size ", ps
, depth
, &q_e
->max_size
))
1385 /*******************************************************************
1386 inits a SAM_DISPINFO_1 structure.
1387 ********************************************************************/
1389 void init_sam_dispinfo_1(SAM_DISPINFO_1
* sam
, uint32
*num_entries
,
1390 uint32
*data_size
, uint32 start_idx
,
1391 SAM_USER_INFO_21 pass
[MAX_SAM_ENTRIES
])
1393 uint32 len_sam_name
, len_sam_full
, len_sam_desc
;
1394 uint32 max_entries
, max_data_size
;
1398 max_entries
= *num_entries
;
1399 max_data_size
= *data_size
;
1401 DEBUG(5, ("init_sam_dispinfo_1: max_entries: %d max_dsize: 0x%x\n",
1402 max_entries
, max_data_size
));
1404 for (i
= 0; (i
< max_entries
) && (dsize
< max_data_size
); i
++) {
1405 len_sam_name
= pass
[i
].uni_user_name
.uni_str_len
;
1406 len_sam_full
= pass
[i
].uni_full_name
.uni_str_len
;
1407 len_sam_desc
= pass
[i
].uni_acct_desc
.uni_str_len
;
1409 init_sam_entry1(&sam
->sam
[i
], start_idx
+ i
+ 1,
1410 len_sam_name
, len_sam_full
, len_sam_desc
,
1411 pass
[i
].user_rid
, pass
[i
].acb_info
);
1413 copy_unistr2(&sam
->str
[i
].uni_acct_name
, &pass
[i
].uni_user_name
);
1414 copy_unistr2(&sam
->str
[i
].uni_full_name
, &pass
[i
].uni_full_name
);
1415 copy_unistr2(&sam
->str
[i
].uni_acct_desc
, &pass
[i
].uni_acct_desc
);
1417 dsize
+= sizeof(SAM_ENTRY1
);
1418 dsize
+= len_sam_name
+ len_sam_full
+ len_sam_desc
;
1425 /*******************************************************************
1426 reads or writes a structure.
1427 ********************************************************************/
1429 static BOOL
sam_io_sam_dispinfo_1(char *desc
, SAM_DISPINFO_1
* sam
,
1431 prs_struct
*ps
, int depth
)
1438 prs_debug(ps
, depth
, desc
, "sam_io_sam_dispinfo_1");
1444 SMB_ASSERT_ARRAY(sam
->sam
, num_entries
);
1446 for (i
= 0; i
< num_entries
; i
++) {
1447 if(!sam_io_sam_entry1("", &sam
->sam
[i
], ps
, depth
))
1451 for (i
= 0; i
< num_entries
; i
++) {
1452 if(!sam_io_sam_str1("", &sam
->str
[i
],
1453 sam
->sam
[i
].hdr_acct_name
.buffer
,
1454 sam
->sam
[i
].hdr_user_name
.buffer
,
1455 sam
->sam
[i
].hdr_user_desc
.buffer
, ps
, depth
))
1462 /*******************************************************************
1463 inits a SAM_DISPINFO_2 structure.
1464 ********************************************************************/
1466 void init_sam_dispinfo_2(SAM_DISPINFO_2
* sam
, uint32
*num_entries
,
1467 uint32
*data_size
, uint32 start_idx
,
1468 SAM_USER_INFO_21 pass
[MAX_SAM_ENTRIES
])
1470 uint32 len_sam_name
, len_sam_desc
;
1471 uint32 max_entries
, max_data_size
;
1475 DEBUG(5, ("init_sam_dispinfo_2\n"));
1477 max_entries
= *num_entries
;
1478 max_data_size
= *data_size
;
1480 for (i
= 0; (i
< max_entries
) && (dsize
< max_data_size
); i
++) {
1481 len_sam_name
= pass
[i
].uni_user_name
.uni_str_len
;
1482 len_sam_desc
= pass
[i
].uni_acct_desc
.uni_str_len
;
1484 init_sam_entry2(&sam
->sam
[i
], start_idx
+ i
+ 1,
1485 len_sam_name
, len_sam_desc
,
1486 pass
[i
].user_rid
, pass
[i
].acb_info
);
1488 copy_unistr2(&sam
->str
[i
].uni_srv_name
,
1489 &pass
[i
].uni_user_name
);
1490 copy_unistr2(&sam
->str
[i
].uni_srv_desc
,
1491 &pass
[i
].uni_acct_desc
);
1493 dsize
+= sizeof(SAM_ENTRY2
);
1494 dsize
+= len_sam_name
+ len_sam_desc
;
1501 /*******************************************************************
1502 reads or writes a structure.
1503 ********************************************************************/
1505 static BOOL
sam_io_sam_dispinfo_2(char *desc
, SAM_DISPINFO_2
* sam
,
1507 prs_struct
*ps
, int depth
)
1514 prs_debug(ps
, depth
, desc
, "sam_io_sam_dispinfo_2");
1520 SMB_ASSERT_ARRAY(sam
->sam
, num_entries
);
1522 for (i
= 0; i
< num_entries
; i
++) {
1523 if(!sam_io_sam_entry2("", &sam
->sam
[i
], ps
, depth
))
1527 for (i
= 0; i
< num_entries
; i
++) {
1528 if(!sam_io_sam_str2("", &sam
->str
[i
],
1529 sam
->sam
[i
].hdr_srv_name
.buffer
,
1530 sam
->sam
[i
].hdr_srv_desc
.buffer
, ps
, depth
))
1537 /*******************************************************************
1538 inits a SAM_DISPINFO_3 structure.
1539 ********************************************************************/
1541 void init_sam_dispinfo_3(SAM_DISPINFO_3
* sam
, uint32
*num_entries
,
1542 uint32
*data_size
, uint32 start_idx
,
1545 uint32 len_sam_name
, len_sam_desc
;
1546 uint32 max_entries
, max_data_size
;
1550 DEBUG(5, ("init_sam_dispinfo_3\n"));
1552 max_entries
= *num_entries
;
1553 max_data_size
= *data_size
;
1555 for (i
= 0; (i
< max_entries
) && (dsize
< max_data_size
); i
++) {
1556 len_sam_name
= strlen(grp
[i
].name
);
1557 len_sam_desc
= strlen(grp
[i
].comment
);
1559 init_sam_entry3(&sam
->sam
[i
], start_idx
+ i
+ 1, len_sam_name
, len_sam_desc
, grp
[i
].rid
);
1561 init_unistr2(&sam
->str
[i
].uni_grp_name
, grp
[i
].name
, len_sam_name
);
1562 init_unistr2(&sam
->str
[i
].uni_grp_desc
, grp
[i
].comment
, len_sam_desc
);
1564 dsize
+= sizeof(SAM_ENTRY3
);
1565 dsize
+= (len_sam_name
+ len_sam_desc
) * 2;
1573 /*******************************************************************
1574 reads or writes a structure.
1575 ********************************************************************/
1577 static BOOL
sam_io_sam_dispinfo_3(char *desc
, SAM_DISPINFO_3
* sam
,
1579 prs_struct
*ps
, int depth
)
1586 prs_debug(ps
, depth
, desc
, "sam_io_sam_dispinfo_3");
1592 SMB_ASSERT_ARRAY(sam
->sam
, num_entries
);
1594 for (i
= 0; i
< num_entries
; i
++) {
1595 if(!sam_io_sam_entry3("", &sam
->sam
[i
], ps
, depth
))
1599 for (i
= 0; i
< num_entries
; i
++) {
1600 if(!sam_io_sam_str3("", &sam
->str
[i
],
1601 sam
->sam
[i
].hdr_grp_name
.buffer
,
1602 sam
->sam
[i
].hdr_grp_desc
.buffer
, ps
, depth
))
1609 /*******************************************************************
1610 inits a SAM_DISPINFO_4 structure.
1611 ********************************************************************/
1613 void init_sam_dispinfo_4(SAM_DISPINFO_4
* sam
, uint32
*num_entries
,
1614 uint32
*data_size
, uint32 start_idx
,
1615 SAM_USER_INFO_21 pass
[MAX_SAM_ENTRIES
])
1618 uint32 len_sam_name
;
1619 uint32 max_entries
, max_data_size
;
1623 DEBUG(5, ("init_sam_dispinfo_4\n"));
1625 max_entries
= *num_entries
;
1626 max_data_size
= *data_size
;
1628 for (i
= 0; (i
< max_entries
) && (dsize
< max_data_size
); i
++) {
1629 len_sam_name
= pass
[i
].uni_user_name
.uni_str_len
;
1631 init_sam_entry4(&sam
->sam
[i
], start_idx
+ i
+ 1,
1634 unistr2_to_ascii(sam_name
, &pass
[i
].uni_user_name
,
1636 init_string2(&sam
->str
[i
].acct_name
, sam_name
,
1639 dsize
+= sizeof(SAM_ENTRY4
);
1640 dsize
+= len_sam_name
;
1647 /*******************************************************************
1648 reads or writes a structure.
1649 ********************************************************************/
1651 static BOOL
sam_io_sam_dispinfo_4(char *desc
, SAM_DISPINFO_4
* sam
,
1653 prs_struct
*ps
, int depth
)
1660 prs_debug(ps
, depth
, desc
, "sam_io_sam_dispinfo_4");
1666 SMB_ASSERT_ARRAY(sam
->sam
, num_entries
);
1668 for (i
= 0; i
< num_entries
; i
++) {
1669 if(!sam_io_sam_entry4("", &sam
->sam
[i
], ps
, depth
))
1673 for (i
= 0; i
< num_entries
; i
++) {
1674 if(!smb_io_string2("acct_name", &sam
->str
[i
].acct_name
,
1675 sam
->sam
[i
].hdr_acct_name
.buffer
, ps
, depth
))
1684 /*******************************************************************
1685 inits a SAM_DISPINFO_5 structure.
1686 ********************************************************************/
1688 void init_sam_dispinfo_5(SAM_DISPINFO_5
* sam
, uint32
*num_entries
,
1689 uint32
*data_size
, uint32 start_idx
,
1692 uint32 len_sam_name
;
1693 uint32 max_entries
, max_data_size
;
1697 DEBUG(5, ("init_sam_dispinfo_5\n"));
1699 max_entries
= *num_entries
;
1700 max_data_size
= *data_size
;
1702 for (i
= 0; (i
< max_entries
) && (dsize
< max_data_size
); i
++) {
1703 len_sam_name
= strlen(grp
[i
].name
);
1705 init_sam_entry5(&sam
->sam
[i
], start_idx
+ i
+ 1,
1708 init_string2(&sam
->str
[i
].grp_name
, grp
[i
].name
,
1711 dsize
+= sizeof(SAM_ENTRY5
);
1712 dsize
+= len_sam_name
;
1719 /*******************************************************************
1720 reads or writes a structure.
1721 ********************************************************************/
1723 static BOOL
sam_io_sam_dispinfo_5(char *desc
, SAM_DISPINFO_5
* sam
,
1725 prs_struct
*ps
, int depth
)
1732 prs_debug(ps
, depth
, desc
, "sam_io_sam_dispinfo_5");
1738 SMB_ASSERT_ARRAY(sam
->sam
, num_entries
);
1740 for (i
= 0; i
< num_entries
; i
++) {
1741 if(!sam_io_sam_entry5("", &sam
->sam
[i
], ps
, depth
))
1745 for (i
= 0; i
< num_entries
; i
++) {
1746 if(!smb_io_string2("grp_name", &sam
->str
[i
].grp_name
,
1747 sam
->sam
[i
].hdr_grp_name
.buffer
, ps
, depth
))
1756 /*******************************************************************
1757 inits a SAMR_R_QUERY_DISPINFO structure.
1758 ********************************************************************/
1760 void init_samr_r_query_dispinfo(SAMR_R_QUERY_DISPINFO
* r_u
,
1761 uint32 num_entries
, uint32 data_size
,
1762 uint16 switch_level
, SAM_DISPINFO_CTR
* ctr
,
1765 DEBUG(5, ("init_samr_r_query_dispinfo: level %d\n", switch_level
));
1767 r_u
->total_size
= data_size
; /* not calculated */
1768 r_u
->data_size
= data_size
;
1770 r_u
->switch_level
= switch_level
;
1771 r_u
->num_entries
= num_entries
;
1774 r_u
->ptr_entries
= 0;
1776 r_u
->ptr_entries
= 1;
1778 r_u
->num_entries2
= num_entries
;
1781 r_u
->status
= status
;
1784 /*******************************************************************
1785 reads or writes a structure.
1786 ********************************************************************/
1788 BOOL
samr_io_r_query_dispinfo(char *desc
, SAMR_R_QUERY_DISPINFO
* r_u
,
1789 prs_struct
*ps
, int depth
)
1794 prs_debug(ps
, depth
, desc
, "samr_io_r_query_dispinfo");
1800 if(!prs_uint32("total_size ", ps
, depth
, &r_u
->total_size
))
1802 if(!prs_uint32("data_size ", ps
, depth
, &r_u
->data_size
))
1804 if(!prs_uint16("switch_level", ps
, depth
, &r_u
->switch_level
))
1809 if(!prs_uint32("num_entries ", ps
, depth
, &r_u
->num_entries
))
1811 if(!prs_uint32("ptr_entries ", ps
, depth
, &r_u
->ptr_entries
))
1814 if (r_u
->ptr_entries
==0) {
1817 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
1823 if(!prs_uint32("num_entries2", ps
, depth
, &r_u
->num_entries2
))
1826 switch (r_u
->switch_level
) {
1828 if(!sam_io_sam_dispinfo_1("users", r_u
->ctr
->sam
.info1
,
1829 r_u
->num_entries
, ps
, depth
))
1833 if(!sam_io_sam_dispinfo_2("servers", r_u
->ctr
->sam
.info2
,
1834 r_u
->num_entries
, ps
, depth
))
1838 if(!sam_io_sam_dispinfo_3("groups", r_u
->ctr
->sam
.info3
,
1839 r_u
->num_entries
, ps
, depth
))
1843 if(!sam_io_sam_dispinfo_4("user list",
1844 r_u
->ctr
->sam
.info4
,
1845 r_u
->num_entries
, ps
, depth
))
1849 if(!sam_io_sam_dispinfo_5("group list",
1850 r_u
->ctr
->sam
.info5
,
1851 r_u
->num_entries
, ps
, depth
))
1855 DEBUG(0,("samr_io_r_query_dispinfo: unknown switch value\n"));
1861 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
1867 /*******************************************************************
1868 inits a SAMR_Q_OPEN_GROUP structure.
1869 ********************************************************************/
1871 void init_samr_q_open_group(SAMR_Q_OPEN_GROUP
* q_c
,
1873 uint32 access_mask
, uint32 rid
)
1875 DEBUG(5, ("init_samr_q_open_group\n"));
1877 q_c
->domain_pol
= *hnd
;
1878 q_c
->access_mask
= access_mask
;
1879 q_c
->rid_group
= rid
;
1882 /*******************************************************************
1883 reads or writes a structure.
1884 ********************************************************************/
1886 BOOL
samr_io_q_open_group(char *desc
, SAMR_Q_OPEN_GROUP
* q_u
,
1887 prs_struct
*ps
, int depth
)
1892 prs_debug(ps
, depth
, desc
, "samr_io_q_open_group");
1898 if(!smb_io_pol_hnd("domain_pol", &q_u
->domain_pol
, ps
, depth
))
1901 if(!prs_uint32("access_mask", ps
, depth
, &q_u
->access_mask
))
1903 if(!prs_uint32("rid_group", ps
, depth
, &q_u
->rid_group
))
1909 /*******************************************************************
1910 reads or writes a structure.
1911 ********************************************************************/
1913 BOOL
samr_io_r_open_group(char *desc
, SAMR_R_OPEN_GROUP
* r_u
,
1914 prs_struct
*ps
, int depth
)
1919 prs_debug(ps
, depth
, desc
, "samr_io_r_open_group");
1925 if(!smb_io_pol_hnd("pol", &r_u
->pol
, ps
, depth
))
1928 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
1934 /*******************************************************************
1935 inits a GROUP_INFO1 structure.
1936 ********************************************************************/
1938 void init_samr_group_info1(GROUP_INFO1
* gr1
,
1939 char *acct_name
, char *acct_desc
,
1942 int desc_len
= acct_desc
!= NULL
? strlen(acct_desc
) : 0;
1943 int acct_len
= acct_name
!= NULL
? strlen(acct_name
) : 0;
1945 DEBUG(5, ("init_samr_group_info1\n"));
1947 init_uni_hdr(&gr1
->hdr_acct_name
, acct_len
);
1949 gr1
->unknown_1
= 0x3;
1950 gr1
->num_members
= num_members
;
1952 init_uni_hdr(&gr1
->hdr_acct_desc
, desc_len
);
1954 init_unistr2(&gr1
->uni_acct_name
, acct_name
, acct_len
);
1955 init_unistr2(&gr1
->uni_acct_desc
, acct_desc
, desc_len
);
1958 /*******************************************************************
1959 reads or writes a structure.
1960 ********************************************************************/
1962 BOOL
samr_io_group_info1(char *desc
, GROUP_INFO1
* gr1
,
1963 prs_struct
*ps
, int depth
)
1968 prs_debug(ps
, depth
, desc
, "samr_io_group_info1");
1974 if(!smb_io_unihdr("hdr_acct_name", &gr1
->hdr_acct_name
, ps
, depth
))
1977 if(!prs_uint32("unknown_1", ps
, depth
, &gr1
->unknown_1
))
1979 if(!prs_uint32("num_members", ps
, depth
, &gr1
->num_members
))
1982 if(!smb_io_unihdr("hdr_acct_desc", &gr1
->hdr_acct_desc
, ps
, depth
))
1985 if(!smb_io_unistr2("uni_acct_name", &gr1
->uni_acct_name
,
1986 gr1
->hdr_acct_name
.buffer
, ps
, depth
))
1989 if(!smb_io_unistr2("uni_acct_desc", &gr1
->uni_acct_desc
,
1990 gr1
->hdr_acct_desc
.buffer
, ps
, depth
))
1996 /*******************************************************************
1997 inits a GROUP_INFO4 structure.
1998 ********************************************************************/
2000 void init_samr_group_info4(GROUP_INFO4
* gr4
, char *acct_desc
)
2002 int acct_len
= acct_desc
!= NULL
? strlen(acct_desc
) : 0;
2004 DEBUG(5, ("init_samr_group_info4\n"));
2006 init_uni_hdr(&gr4
->hdr_acct_desc
, acct_len
);
2007 init_unistr2(&gr4
->uni_acct_desc
, acct_desc
, acct_len
);
2010 /*******************************************************************
2011 reads or writes a structure.
2012 ********************************************************************/
2014 BOOL
samr_io_group_info4(char *desc
, GROUP_INFO4
* gr4
,
2015 prs_struct
*ps
, int depth
)
2020 prs_debug(ps
, depth
, desc
, "samr_io_group_info4");
2026 if(!smb_io_unihdr("hdr_acct_desc", &gr4
->hdr_acct_desc
, ps
, depth
))
2028 if(!smb_io_unistr2("uni_acct_desc", &gr4
->uni_acct_desc
,
2029 gr4
->hdr_acct_desc
.buffer
, ps
, depth
))
2035 /*******************************************************************
2036 reads or writes a structure.
2037 ********************************************************************/
2039 static BOOL
samr_group_info_ctr(char *desc
, GROUP_INFO_CTR
* ctr
,
2040 prs_struct
*ps
, int depth
)
2045 prs_debug(ps
, depth
, desc
, "samr_group_info_ctr");
2048 if(!prs_uint16("switch_value1", ps
, depth
, &ctr
->switch_value1
))
2050 if(!prs_uint16("switch_value2", ps
, depth
, &ctr
->switch_value2
))
2053 switch (ctr
->switch_value1
) {
2055 if(!samr_io_group_info1("group_info1",
2056 &ctr
->group
.info1
, ps
, depth
))
2060 if(!samr_io_group_info4("group_info4",
2061 &ctr
->group
.info4
, ps
, depth
))
2065 DEBUG(0,("samr_group_info_ctr: unsupported switch level\n"));
2072 /*******************************************************************
2073 inits a SAMR_Q_CREATE_DOM_GROUP structure.
2074 ********************************************************************/
2076 void init_samr_q_create_dom_group(SAMR_Q_CREATE_DOM_GROUP
* q_e
,
2077 POLICY_HND
*pol
, char *acct_desc
,
2080 int acct_len
= acct_desc
!= NULL
? strlen(acct_desc
) : 0;
2082 DEBUG(5, ("init_samr_q_create_dom_group\n"));
2086 init_uni_hdr(&q_e
->hdr_acct_desc
, acct_len
);
2087 init_unistr2(&q_e
->uni_acct_desc
, acct_desc
, acct_len
);
2089 q_e
->access_mask
= access_mask
;
2092 /*******************************************************************
2093 reads or writes a structure.
2094 ********************************************************************/
2096 BOOL
samr_io_q_create_dom_group(char *desc
, SAMR_Q_CREATE_DOM_GROUP
* q_e
,
2097 prs_struct
*ps
, int depth
)
2102 prs_debug(ps
, depth
, desc
, "samr_io_q_create_dom_group");
2108 if(!smb_io_pol_hnd("pol", &q_e
->pol
, ps
, depth
))
2111 if(!smb_io_unihdr("hdr_acct_desc", &q_e
->hdr_acct_desc
, ps
, depth
))
2113 if(!smb_io_unistr2("uni_acct_desc", &q_e
->uni_acct_desc
,
2114 q_e
->hdr_acct_desc
.buffer
, ps
, depth
))
2119 if(!prs_uint32("access", ps
, depth
, &q_e
->access_mask
))
2125 /*******************************************************************
2126 reads or writes a structure.
2127 ********************************************************************/
2129 BOOL
samr_io_r_create_dom_group(char *desc
, SAMR_R_CREATE_DOM_GROUP
* r_u
,
2130 prs_struct
*ps
, int depth
)
2135 prs_debug(ps
, depth
, desc
, "samr_io_r_create_dom_group");
2141 if(!smb_io_pol_hnd("pol", &r_u
->pol
, ps
, depth
))
2144 if(!prs_uint32("rid ", ps
, depth
, &r_u
->rid
))
2146 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
2152 /*******************************************************************
2153 inits a SAMR_Q_DELETE_DOM_GROUP structure.
2154 ********************************************************************/
2156 void init_samr_q_delete_dom_group(SAMR_Q_DELETE_DOM_GROUP
* q_c
,
2159 DEBUG(5, ("init_samr_q_delete_dom_group\n"));
2161 q_c
->group_pol
= *hnd
;
2164 /*******************************************************************
2165 reads or writes a structure.
2166 ********************************************************************/
2168 BOOL
samr_io_q_delete_dom_group(char *desc
, SAMR_Q_DELETE_DOM_GROUP
* q_u
,
2169 prs_struct
*ps
, int depth
)
2174 prs_debug(ps
, depth
, desc
, "samr_io_q_delete_dom_group");
2180 if(!smb_io_pol_hnd("group_pol", &q_u
->group_pol
, ps
, depth
))
2186 /*******************************************************************
2187 reads or writes a structure.
2188 ********************************************************************/
2190 BOOL
samr_io_r_delete_dom_group(char *desc
, SAMR_R_DELETE_DOM_GROUP
* r_u
,
2191 prs_struct
*ps
, int depth
)
2196 prs_debug(ps
, depth
, desc
, "samr_io_r_delete_dom_group");
2202 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
2208 /*******************************************************************
2209 inits a SAMR_Q_DEL_GROUPMEM structure.
2210 ********************************************************************/
2212 void init_samr_q_del_groupmem(SAMR_Q_DEL_GROUPMEM
* q_e
,
2213 POLICY_HND
*pol
, uint32 rid
)
2215 DEBUG(5, ("init_samr_q_del_groupmem\n"));
2221 /*******************************************************************
2222 reads or writes a structure.
2223 ********************************************************************/
2225 BOOL
samr_io_q_del_groupmem(char *desc
, SAMR_Q_DEL_GROUPMEM
* q_e
,
2226 prs_struct
*ps
, int depth
)
2231 prs_debug(ps
, depth
, desc
, "samr_io_q_del_groupmem");
2237 if(!smb_io_pol_hnd("pol", &q_e
->pol
, ps
, depth
))
2240 if(!prs_uint32("rid", ps
, depth
, &q_e
->rid
))
2246 /*******************************************************************
2247 inits a SAMR_R_DEL_GROUPMEM structure.
2248 ********************************************************************/
2250 void init_samr_r_del_groupmem(SAMR_R_DEL_GROUPMEM
* r_u
, POLICY_HND
*pol
,
2253 DEBUG(5, ("init_samr_r_del_groupmem\n"));
2255 r_u
->status
= status
;
2258 /*******************************************************************
2259 reads or writes a structure.
2260 ********************************************************************/
2262 BOOL
samr_io_r_del_groupmem(char *desc
, SAMR_R_DEL_GROUPMEM
* r_u
,
2263 prs_struct
*ps
, int depth
)
2268 prs_debug(ps
, depth
, desc
, "samr_io_r_del_groupmem");
2274 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
2280 /*******************************************************************
2281 inits a SAMR_Q_ADD_GROUPMEM structure.
2282 ********************************************************************/
2284 void init_samr_q_add_groupmem(SAMR_Q_ADD_GROUPMEM
* q_e
,
2285 POLICY_HND
*pol
, uint32 rid
)
2287 DEBUG(5, ("init_samr_q_add_groupmem\n"));
2291 q_e
->unknown
= 0x0005;
2294 /*******************************************************************
2295 reads or writes a structure.
2296 ********************************************************************/
2298 BOOL
samr_io_q_add_groupmem(char *desc
, SAMR_Q_ADD_GROUPMEM
* q_e
,
2299 prs_struct
*ps
, int depth
)
2304 prs_debug(ps
, depth
, desc
, "samr_io_q_add_groupmem");
2310 if(!smb_io_pol_hnd("pol", &q_e
->pol
, ps
, depth
))
2313 if(!prs_uint32("rid ", ps
, depth
, &q_e
->rid
))
2315 if(!prs_uint32("unknown", ps
, depth
, &q_e
->unknown
))
2321 /*******************************************************************
2322 inits a SAMR_R_ADD_GROUPMEM structure.
2323 ********************************************************************/
2325 void init_samr_r_add_groupmem(SAMR_R_ADD_GROUPMEM
* r_u
, POLICY_HND
*pol
,
2328 DEBUG(5, ("init_samr_r_add_groupmem\n"));
2330 r_u
->status
= status
;
2333 /*******************************************************************
2334 reads or writes a structure.
2335 ********************************************************************/
2337 BOOL
samr_io_r_add_groupmem(char *desc
, SAMR_R_ADD_GROUPMEM
* r_u
,
2338 prs_struct
*ps
, int depth
)
2343 prs_debug(ps
, depth
, desc
, "samr_io_r_add_groupmem");
2349 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
2355 /*******************************************************************
2356 inits a SAMR_Q_SET_GROUPINFO structure.
2357 ********************************************************************/
2359 void init_samr_q_set_groupinfo(SAMR_Q_SET_GROUPINFO
* q_e
,
2360 POLICY_HND
*pol
, GROUP_INFO_CTR
* ctr
)
2362 DEBUG(5, ("init_samr_q_set_groupinfo\n"));
2368 /*******************************************************************
2369 reads or writes a structure.
2370 ********************************************************************/
2372 BOOL
samr_io_q_set_groupinfo(char *desc
, SAMR_Q_SET_GROUPINFO
* q_e
,
2373 prs_struct
*ps
, int depth
)
2378 prs_debug(ps
, depth
, desc
, "samr_io_q_set_groupinfo");
2384 if(!smb_io_pol_hnd("pol", &q_e
->pol
, ps
, depth
))
2387 if(!samr_group_info_ctr("ctr", q_e
->ctr
, ps
, depth
))
2393 /*******************************************************************
2394 inits a SAMR_R_SET_GROUPINFO structure.
2395 ********************************************************************/
2397 void init_samr_r_set_groupinfo(SAMR_R_SET_GROUPINFO
* r_u
, uint32 status
)
2399 DEBUG(5, ("init_samr_r_set_groupinfo\n"));
2401 r_u
->status
= status
;
2404 /*******************************************************************
2405 reads or writes a structure.
2406 ********************************************************************/
2408 BOOL
samr_io_r_set_groupinfo(char *desc
, SAMR_R_SET_GROUPINFO
* r_u
,
2409 prs_struct
*ps
, int depth
)
2414 prs_debug(ps
, depth
, desc
, "samr_io_r_set_groupinfo");
2420 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
2426 /*******************************************************************
2427 inits a SAMR_Q_QUERY_GROUPINFO structure.
2428 ********************************************************************/
2430 void init_samr_q_query_groupinfo(SAMR_Q_QUERY_GROUPINFO
* q_e
,
2431 POLICY_HND
*pol
, uint16 switch_level
)
2433 DEBUG(5, ("init_samr_q_query_groupinfo\n"));
2437 q_e
->switch_level
= switch_level
;
2440 /*******************************************************************
2441 reads or writes a structure.
2442 ********************************************************************/
2444 BOOL
samr_io_q_query_groupinfo(char *desc
, SAMR_Q_QUERY_GROUPINFO
* q_e
,
2445 prs_struct
*ps
, int depth
)
2450 prs_debug(ps
, depth
, desc
, "samr_io_q_query_groupinfo");
2456 if(!smb_io_pol_hnd("pol", &q_e
->pol
, ps
, depth
))
2459 if(!prs_uint16("switch_level", ps
, depth
, &q_e
->switch_level
))
2465 /*******************************************************************
2466 inits a SAMR_R_QUERY_GROUPINFO structure.
2467 ********************************************************************/
2469 void init_samr_r_query_groupinfo(SAMR_R_QUERY_GROUPINFO
* r_u
,
2470 GROUP_INFO_CTR
* ctr
, uint32 status
)
2472 DEBUG(5, ("init_samr_r_query_groupinfo\n"));
2474 r_u
->ptr
= (status
== 0x0 && ctr
!= NULL
) ? 1 : 0;
2476 r_u
->status
= status
;
2479 /*******************************************************************
2480 reads or writes a structure.
2481 ********************************************************************/
2483 BOOL
samr_io_r_query_groupinfo(char *desc
, SAMR_R_QUERY_GROUPINFO
* r_u
,
2484 prs_struct
*ps
, int depth
)
2489 prs_debug(ps
, depth
, desc
, "samr_io_r_query_groupinfo");
2495 if(!prs_uint32("ptr", ps
, depth
, &r_u
->ptr
))
2498 if (r_u
->ptr
!= 0) {
2499 if(!samr_group_info_ctr("ctr", r_u
->ctr
, ps
, depth
))
2505 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
2511 /*******************************************************************
2512 inits a SAMR_Q_QUERY_GROUPMEM structure.
2513 ********************************************************************/
2515 void init_samr_q_query_groupmem(SAMR_Q_QUERY_GROUPMEM
* q_c
, POLICY_HND
*hnd
)
2517 DEBUG(5, ("init_samr_q_query_groupmem\n"));
2519 q_c
->group_pol
= *hnd
;
2522 /*******************************************************************
2523 reads or writes a structure.
2524 ********************************************************************/
2526 BOOL
samr_io_q_query_groupmem(char *desc
, SAMR_Q_QUERY_GROUPMEM
* q_u
,
2527 prs_struct
*ps
, int depth
)
2532 prs_debug(ps
, depth
, desc
, "samr_io_q_query_groupmem");
2538 if(!smb_io_pol_hnd("group_pol", &q_u
->group_pol
, ps
, depth
))
2544 /*******************************************************************
2545 inits a SAMR_R_QUERY_GROUPMEM structure.
2546 ********************************************************************/
2548 void init_samr_r_query_groupmem(SAMR_R_QUERY_GROUPMEM
* r_u
,
2549 uint32 num_entries
, uint32
*rid
,
2550 uint32
*attr
, uint32 status
)
2552 DEBUG(5, ("init_samr_r_query_groupmem\n"));
2554 if (status
== 0x0) {
2556 r_u
->num_entries
= num_entries
;
2558 r_u
->ptr_attrs
= attr
!= NULL
? 1 : 0;
2559 r_u
->ptr_rids
= rid
!= NULL
? 1 : 0;
2561 r_u
->num_rids
= num_entries
;
2564 r_u
->num_attrs
= num_entries
;
2568 r_u
->num_entries
= 0;
2571 r_u
->status
= status
;
2574 /*******************************************************************
2575 reads or writes a structure.
2576 ********************************************************************/
2578 BOOL
samr_io_r_query_groupmem(char *desc
, SAMR_R_QUERY_GROUPMEM
* r_u
,
2579 prs_struct
*ps
, int depth
)
2586 if (UNMARSHALLING(ps
))
2589 prs_debug(ps
, depth
, desc
, "samr_io_r_query_groupmem");
2595 if(!prs_uint32("ptr", ps
, depth
, &r_u
->ptr
))
2597 if(!prs_uint32("num_entries ", ps
, depth
, &r_u
->num_entries
))
2600 if (r_u
->ptr
!= 0) {
2601 if(!prs_uint32("ptr_rids ", ps
, depth
, &r_u
->ptr_rids
))
2603 if(!prs_uint32("ptr_attrs", ps
, depth
, &r_u
->ptr_attrs
))
2606 if (r_u
->ptr_rids
!= 0) {
2607 if(!prs_uint32("num_rids", ps
, depth
, &r_u
->num_rids
))
2609 if (UNMARSHALLING(ps
) && r_u
->num_rids
!= 0) {
2610 r_u
->rid
= (uint32
*)prs_alloc_mem(ps
,sizeof(r_u
->rid
[0])*r_u
->num_rids
);
2611 if (r_u
->rid
== NULL
)
2615 for (i
= 0; i
< r_u
->num_rids
; i
++) {
2616 if(!prs_uint32("", ps
, depth
, &r_u
->rid
[i
]))
2621 if (r_u
->ptr_attrs
!= 0) {
2622 if(!prs_uint32("num_attrs", ps
, depth
, &r_u
->num_attrs
))
2625 if (UNMARSHALLING(ps
) && r_u
->num_attrs
!= 0) {
2626 r_u
->attr
= (uint32
*)prs_alloc_mem(ps
,sizeof(r_u
->attr
[0])*r_u
->num_attrs
);
2627 if (r_u
->attr
== NULL
)
2631 for (i
= 0; i
< r_u
->num_attrs
; i
++) {
2632 if(!prs_uint32("", ps
, depth
, &r_u
->attr
[i
]))
2638 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
2644 /*******************************************************************
2645 inits a SAMR_Q_QUERY_USERGROUPS structure.
2646 ********************************************************************/
2648 void init_samr_q_query_usergroups(SAMR_Q_QUERY_USERGROUPS
* q_u
,
2651 DEBUG(5, ("init_samr_q_query_usergroups\n"));
2656 /*******************************************************************
2657 reads or writes a structure.
2658 ********************************************************************/
2660 BOOL
samr_io_q_query_usergroups(char *desc
, SAMR_Q_QUERY_USERGROUPS
* q_u
,
2661 prs_struct
*ps
, int depth
)
2666 prs_debug(ps
, depth
, desc
, "samr_io_q_query_usergroups");
2672 if(!smb_io_pol_hnd("pol", &q_u
->pol
, ps
, depth
))
2678 /*******************************************************************
2679 inits a SAMR_R_QUERY_USERGROUPS structure.
2680 ********************************************************************/
2682 void init_samr_r_query_usergroups(SAMR_R_QUERY_USERGROUPS
* r_u
,
2683 uint32 num_gids
, DOM_GID
* gid
,
2686 DEBUG(5, ("init_samr_r_query_usergroups\n"));
2690 r_u
->num_entries
= num_gids
;
2691 r_u
->ptr_1
= (num_gids
!= 0) ? 1 : 0;
2692 r_u
->num_entries2
= num_gids
;
2697 r_u
->num_entries
= 0;
2702 r_u
->status
= status
;
2705 /*******************************************************************
2706 reads or writes a structure.
2707 ********************************************************************/
2709 BOOL
samr_io_gids(char *desc
, uint32
*num_gids
, DOM_GID
** gid
,
2710 prs_struct
*ps
, int depth
)
2716 prs_debug(ps
, depth
, desc
, "samr_io_gids");
2722 if(!prs_uint32("num_gids", ps
, depth
, num_gids
))
2725 if ((*num_gids
) != 0) {
2726 if (UNMARSHALLING(ps
)) {
2727 (*gid
) = (DOM_GID
*)prs_alloc_mem(ps
,sizeof(DOM_GID
)*(*num_gids
));
2730 if ((*gid
) == NULL
) {
2734 for (i
= 0; i
< (*num_gids
); i
++) {
2735 if(!smb_io_gid("gids", &(*gid
)[i
], ps
, depth
))
2743 /*******************************************************************
2744 reads or writes a structure.
2745 ********************************************************************/
2747 BOOL
samr_io_r_query_usergroups(char *desc
, SAMR_R_QUERY_USERGROUPS
* r_u
,
2748 prs_struct
*ps
, int depth
)
2753 prs_debug(ps
, depth
, desc
, "samr_io_r_query_usergroups");
2759 if(!prs_uint32("ptr_0 ", ps
, depth
, &r_u
->ptr_0
))
2762 if (r_u
->ptr_0
!= 0) {
2763 if(!prs_uint32("num_entries ", ps
, depth
, &r_u
->num_entries
))
2765 if(!prs_uint32("ptr_1 ", ps
, depth
, &r_u
->ptr_1
))
2768 if (r_u
->num_entries
!= 0 && r_u
->ptr_1
!= 0) {
2769 if(!samr_io_gids("gids", &r_u
->num_entries2
, &r_u
->gid
, ps
, depth
))
2776 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
2782 /*******************************************************************
2783 inits a SAMR_Q_ENUM_DOMAINS structure.
2784 ********************************************************************/
2786 void init_samr_q_enum_domains(SAMR_Q_ENUM_DOMAINS
* q_e
,
2788 uint32 start_idx
, uint32 size
)
2790 DEBUG(5, ("init_samr_q_enum_domains\n"));
2794 q_e
->start_idx
= start_idx
;
2795 q_e
->max_size
= size
;
2798 /*******************************************************************
2799 reads or writes a structure.
2800 ********************************************************************/
2802 BOOL
samr_io_q_enum_domains(char *desc
, SAMR_Q_ENUM_DOMAINS
* q_e
,
2803 prs_struct
*ps
, int depth
)
2808 prs_debug(ps
, depth
, desc
, "samr_io_q_enum_domains");
2814 if(!smb_io_pol_hnd("pol", &q_e
->pol
, ps
, depth
))
2817 if(!prs_uint32("start_idx", ps
, depth
, &q_e
->start_idx
))
2819 if(!prs_uint32("max_size ", ps
, depth
, &q_e
->max_size
))
2825 /*******************************************************************
2826 inits a SAMR_R_ENUM_DOMAINS structure.
2827 ********************************************************************/
2829 void init_samr_r_enum_domains(SAMR_R_ENUM_DOMAINS
* r_u
,
2830 uint32 next_idx
, uint32 num_sam_entries
)
2832 DEBUG(5, ("init_samr_r_enum_domains\n"));
2834 r_u
->next_idx
= next_idx
;
2836 if (num_sam_entries
!= 0) {
2837 r_u
->ptr_entries1
= 1;
2838 r_u
->ptr_entries2
= 1;
2839 r_u
->num_entries2
= num_sam_entries
;
2840 r_u
->num_entries3
= num_sam_entries
;
2842 r_u
->num_entries4
= num_sam_entries
;
2844 r_u
->ptr_entries1
= 0;
2845 r_u
->num_entries2
= num_sam_entries
;
2846 r_u
->ptr_entries2
= 1;
2850 /*******************************************************************
2851 reads or writes a structure.
2852 ********************************************************************/
2854 BOOL
samr_io_r_enum_domains(char *desc
, SAMR_R_ENUM_DOMAINS
* r_u
,
2855 prs_struct
*ps
, int depth
)
2862 prs_debug(ps
, depth
, desc
, "samr_io_r_enum_domains");
2868 if(!prs_uint32("next_idx ", ps
, depth
, &r_u
->next_idx
))
2870 if(!prs_uint32("ptr_entries1", ps
, depth
, &r_u
->ptr_entries1
))
2873 if (r_u
->ptr_entries1
!= 0) {
2874 if(!prs_uint32("num_entries2", ps
, depth
, &r_u
->num_entries2
))
2876 if(!prs_uint32("ptr_entries2", ps
, depth
, &r_u
->ptr_entries2
))
2878 if(!prs_uint32("num_entries3", ps
, depth
, &r_u
->num_entries3
))
2881 if (UNMARSHALLING(ps
)) {
2882 r_u
->sam
= (SAM_ENTRY
*)prs_alloc_mem(ps
,sizeof(SAM_ENTRY
)*r_u
->num_entries2
);
2883 r_u
->uni_dom_name
= (UNISTR2
*)prs_alloc_mem(ps
,sizeof(UNISTR2
)*r_u
->num_entries2
);
2886 if ((r_u
->sam
== NULL
|| r_u
->uni_dom_name
== NULL
) && r_u
->num_entries2
!= 0) {
2887 DEBUG(0, ("NULL pointers in SAMR_R_ENUM_DOMAINS\n"));
2888 r_u
->num_entries4
= 0;
2889 r_u
->status
= NT_STATUS_MEMORY_NOT_ALLOCATED
;
2893 for (i
= 0; i
< r_u
->num_entries2
; i
++) {
2895 slprintf(tmp
, sizeof(tmp
) - 1, "dom[%d]", i
);
2896 if(!sam_io_sam_entry(tmp
, &r_u
->sam
[i
], ps
, depth
))
2900 for (i
= 0; i
< r_u
->num_entries2
; i
++) {
2902 slprintf(tmp
, sizeof(tmp
) - 1, "dom[%d]", i
);
2903 if(!smb_io_unistr2(tmp
, &r_u
->uni_dom_name
[i
],
2904 r_u
->sam
[i
].hdr_name
.buffer
, ps
,
2913 if(!prs_uint32("num_entries4", ps
, depth
, &r_u
->num_entries4
))
2915 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
2921 /*******************************************************************
2922 inits a SAMR_Q_ENUM_DOM_GROUPS structure.
2923 ********************************************************************/
2925 void init_samr_q_enum_dom_groups(SAMR_Q_ENUM_DOM_GROUPS
* q_e
,
2927 uint32 start_idx
, uint32 size
)
2929 DEBUG(5, ("init_samr_q_enum_dom_groups\n"));
2933 q_e
->start_idx
= start_idx
;
2934 q_e
->max_size
= size
;
2937 /*******************************************************************
2938 reads or writes a structure.
2939 ********************************************************************/
2941 BOOL
samr_io_q_enum_dom_groups(char *desc
, SAMR_Q_ENUM_DOM_GROUPS
* q_e
,
2942 prs_struct
*ps
, int depth
)
2947 prs_debug(ps
, depth
, desc
, "samr_io_q_enum_dom_groups");
2953 if(!smb_io_pol_hnd("pol", &(q_e
->pol
), ps
, depth
))
2956 if(!prs_uint32("start_idx", ps
, depth
, &q_e
->start_idx
))
2958 if(!prs_uint32("max_size ", ps
, depth
, &q_e
->max_size
))
2964 /*******************************************************************
2965 inits a SAMR_R_ENUM_DOM_GROUPS structure.
2966 ********************************************************************/
2968 void init_samr_r_enum_dom_groups(SAMR_R_ENUM_DOM_GROUPS
* r_u
,
2969 uint32 next_idx
, uint32 num_sam_entries
)
2971 DEBUG(5, ("init_samr_r_enum_dom_groups\n"));
2973 r_u
->next_idx
= next_idx
;
2975 if (num_sam_entries
!= 0) {
2976 r_u
->ptr_entries1
= 1;
2977 r_u
->ptr_entries2
= 1;
2978 r_u
->num_entries2
= num_sam_entries
;
2979 r_u
->num_entries3
= num_sam_entries
;
2981 r_u
->num_entries4
= num_sam_entries
;
2983 r_u
->ptr_entries1
= 0;
2984 r_u
->num_entries2
= num_sam_entries
;
2985 r_u
->ptr_entries2
= 1;
2989 /*******************************************************************
2990 reads or writes a structure.
2991 ********************************************************************/
2993 BOOL
samr_io_r_enum_dom_groups(char *desc
, SAMR_R_ENUM_DOM_GROUPS
* r_u
,
2994 prs_struct
*ps
, int depth
)
3001 prs_debug(ps
, depth
, desc
, "samr_io_r_enum_dom_groups");
3007 if(!prs_uint32("next_idx ", ps
, depth
, &r_u
->next_idx
))
3009 if(!prs_uint32("ptr_entries1", ps
, depth
, &r_u
->ptr_entries1
))
3012 if (r_u
->ptr_entries1
!= 0) {
3013 if(!prs_uint32("num_entries2", ps
, depth
, &r_u
->num_entries2
))
3015 if(!prs_uint32("ptr_entries2", ps
, depth
, &r_u
->ptr_entries2
))
3017 if(!prs_uint32("num_entries3", ps
, depth
, &r_u
->num_entries3
))
3020 if (UNMARSHALLING(ps
)) {
3021 r_u
->sam
= (SAM_ENTRY
*)prs_alloc_mem(ps
,sizeof(SAM_ENTRY
)*r_u
->num_entries2
);
3022 r_u
->uni_grp_name
= (UNISTR2
*)prs_alloc_mem(ps
,sizeof(UNISTR2
)*r_u
->num_entries2
);
3025 if ((r_u
->sam
== NULL
|| r_u
->uni_grp_name
== NULL
) && r_u
->num_entries2
!= 0) {
3027 ("NULL pointers in SAMR_R_ENUM_DOM_GROUPS\n"));
3028 r_u
->num_entries4
= 0;
3029 r_u
->status
= NT_STATUS_MEMORY_NOT_ALLOCATED
;
3033 for (i
= 0; i
< r_u
->num_entries2
; i
++) {
3034 if(!sam_io_sam_entry("", &r_u
->sam
[i
], ps
, depth
))
3038 for (i
= 0; i
< r_u
->num_entries2
; i
++) {
3039 if(!smb_io_unistr2("", &r_u
->uni_grp_name
[i
],
3040 r_u
->sam
[i
].hdr_name
.buffer
, ps
, depth
))
3047 if(!prs_uint32("num_entries4", ps
, depth
, &r_u
->num_entries4
))
3049 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
3055 /*******************************************************************
3056 inits a SAMR_Q_ENUM_DOM_ALIASES structure.
3057 ********************************************************************/
3059 void init_samr_q_enum_dom_aliases(SAMR_Q_ENUM_DOM_ALIASES
* q_e
,
3060 POLICY_HND
*pol
, uint32 start_idx
,
3063 DEBUG(5, ("init_samr_q_enum_dom_aliases\n"));
3067 q_e
->start_idx
= start_idx
;
3068 q_e
->max_size
= size
;
3072 /*******************************************************************
3073 reads or writes a structure.
3074 ********************************************************************/
3076 BOOL
samr_io_q_enum_dom_aliases(char *desc
, SAMR_Q_ENUM_DOM_ALIASES
* q_e
,
3077 prs_struct
*ps
, int depth
)
3082 prs_debug(ps
, depth
, desc
, "samr_io_q_enum_dom_aliases");
3088 if(!smb_io_pol_hnd("pol", &q_e
->pol
, ps
, depth
))
3091 if(!prs_uint32("start_idx", ps
, depth
, &q_e
->start_idx
))
3093 if(!prs_uint32("max_size ", ps
, depth
, &q_e
->max_size
))
3099 /*******************************************************************
3100 inits a SAMR_R_ENUM_DOM_ALIASES structure.
3101 ********************************************************************/
3103 void init_samr_r_enum_dom_aliases(SAMR_R_ENUM_DOM_ALIASES
*r_u
, uint32 next_idx
, uint32 num_sam_entries
)
3105 DEBUG(5, ("init_samr_r_enum_dom_aliases\n"));
3107 r_u
->next_idx
= next_idx
;
3109 if (num_sam_entries
!= 0) {
3110 r_u
->ptr_entries1
= 1;
3111 r_u
->ptr_entries2
= 1;
3112 r_u
->num_entries2
= num_sam_entries
;
3113 r_u
->num_entries3
= num_sam_entries
;
3115 r_u
->num_entries4
= num_sam_entries
;
3117 r_u
->ptr_entries1
= 0;
3118 r_u
->num_entries2
= num_sam_entries
;
3119 r_u
->ptr_entries2
= 1;
3123 /*******************************************************************
3124 reads or writes a structure.
3125 ********************************************************************/
3127 BOOL
samr_io_r_enum_dom_aliases(char *desc
, SAMR_R_ENUM_DOM_ALIASES
* r_u
,
3128 prs_struct
*ps
, int depth
)
3135 prs_debug(ps
, depth
, desc
, "samr_io_r_enum_dom_aliases");
3141 if(!prs_uint32("next_idx ", ps
, depth
, &r_u
->next_idx
))
3143 if(!prs_uint32("ptr_entries1", ps
, depth
, &r_u
->ptr_entries1
))
3146 if (r_u
->ptr_entries1
!= 0) {
3147 if(!prs_uint32("num_entries2", ps
, depth
, &r_u
->num_entries2
))
3149 if(!prs_uint32("ptr_entries2", ps
, depth
, &r_u
->ptr_entries2
))
3151 if(!prs_uint32("num_entries3", ps
, depth
, &r_u
->num_entries3
))
3154 if (UNMARSHALLING(ps
) && (r_u
->num_entries2
> 0)) {
3155 r_u
->sam
= (SAM_ENTRY
*)prs_alloc_mem(ps
,sizeof(SAM_ENTRY
)*r_u
->num_entries2
);
3156 r_u
->uni_grp_name
= (UNISTR2
*)prs_alloc_mem(ps
,sizeof(UNISTR2
)*r_u
->num_entries2
);
3159 if (r_u
->num_entries2
!= 0 &&
3160 (r_u
->sam
== NULL
|| r_u
->uni_grp_name
== NULL
)) {
3161 DEBUG(0,("NULL pointers in SAMR_R_ENUM_DOM_ALIASES\n"));
3162 r_u
->num_entries4
= 0;
3163 r_u
->status
= NT_STATUS_MEMORY_NOT_ALLOCATED
;
3167 for (i
= 0; i
< r_u
->num_entries2
; i
++) {
3168 if(!sam_io_sam_entry("", &r_u
->sam
[i
], ps
, depth
))
3172 for (i
= 0; i
< r_u
->num_entries2
; i
++) {
3173 if(!smb_io_unistr2("", &r_u
->uni_grp_name
[i
],
3174 r_u
->sam
[i
].hdr_name
.buffer
, ps
,
3182 if(!prs_uint32("num_entries4", ps
, depth
, &r_u
->num_entries4
))
3184 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
3190 /*******************************************************************
3191 inits a ALIAS_INFO3 structure.
3192 ********************************************************************/
3194 void init_samr_alias_info3(ALIAS_INFO3
* al3
, char *acct_desc
)
3196 int acct_len
= acct_desc
!= NULL
? strlen(acct_desc
) : 0;
3198 DEBUG(5, ("init_samr_alias_info3\n"));
3200 init_uni_hdr(&al3
->hdr_acct_desc
, acct_len
);
3201 init_unistr2(&al3
->uni_acct_desc
, acct_desc
, acct_len
);
3204 /*******************************************************************
3205 reads or writes a structure.
3206 ********************************************************************/
3208 BOOL
samr_io_alias_info3(char *desc
, ALIAS_INFO3
* al3
,
3209 prs_struct
*ps
, int depth
)
3214 prs_debug(ps
, depth
, desc
, "samr_io_alias_info3");
3220 if(!smb_io_unihdr("hdr_acct_desc", &al3
->hdr_acct_desc
, ps
, depth
))
3222 if(!smb_io_unistr2("uni_acct_desc", &al3
->uni_acct_desc
,
3223 al3
->hdr_acct_desc
.buffer
, ps
, depth
))
3229 /*******************************************************************
3230 reads or writes a structure.
3231 ********************************************************************/
3233 BOOL
samr_alias_info_ctr(char *desc
, ALIAS_INFO_CTR
* ctr
,
3234 prs_struct
*ps
, int depth
)
3239 prs_debug(ps
, depth
, desc
, "samr_alias_info_ctr");
3242 if(!prs_uint16("switch_value1", ps
, depth
, &ctr
->switch_value1
))
3244 if(!prs_uint16("switch_value2", ps
, depth
, &ctr
->switch_value2
))
3247 switch (ctr
->switch_value1
) {
3249 if(!samr_io_alias_info3("alias_info3", &ctr
->alias
.info3
, ps
, depth
))
3253 DEBUG(0,("samr_alias_info_ctr: unsupported switch level\n"));
3260 /*******************************************************************
3261 inits a SAMR_Q_QUERY_ALIASINFO structure.
3262 ********************************************************************/
3264 void init_samr_q_query_aliasinfo(SAMR_Q_QUERY_ALIASINFO
* q_e
,
3265 POLICY_HND
*pol
, uint16 switch_level
)
3267 DEBUG(5, ("init_samr_q_query_aliasinfo\n"));
3270 q_e
->switch_level
= switch_level
;
3273 /*******************************************************************
3274 reads or writes a structure.
3275 ********************************************************************/
3277 BOOL
samr_io_q_query_aliasinfo(char *desc
, SAMR_Q_QUERY_ALIASINFO
* q_e
,
3278 prs_struct
*ps
, int depth
)
3283 prs_debug(ps
, depth
, desc
, "samr_io_q_query_aliasinfo");
3289 if(!smb_io_pol_hnd("pol", &(q_e
->pol
), ps
, depth
))
3292 if(!prs_uint16("switch_level", ps
, depth
, &q_e
->switch_level
))
3298 /*******************************************************************
3299 inits a SAMR_R_QUERY_ALIASINFO structure.
3300 ********************************************************************/
3302 void init_samr_r_query_aliasinfo(SAMR_R_QUERY_ALIASINFO
* r_u
,
3303 ALIAS_INFO_CTR
* ctr
, uint32 status
)
3305 DEBUG(5, ("init_samr_r_query_aliasinfo\n"));
3307 r_u
->ptr
= (status
== 0x0 && ctr
!= NULL
) ? 1 : 0;
3309 r_u
->status
= status
;
3312 /*******************************************************************
3313 reads or writes a structure.
3314 ********************************************************************/
3316 BOOL
samr_io_r_query_aliasinfo(char *desc
, SAMR_R_QUERY_ALIASINFO
* r_u
,
3317 prs_struct
*ps
, int depth
)
3322 prs_debug(ps
, depth
, desc
, "samr_io_r_query_aliasinfo");
3328 if(!prs_uint32("ptr", ps
, depth
, &r_u
->ptr
))
3331 if (r_u
->ptr
!= 0) {
3332 if(!samr_alias_info_ctr("ctr", &r_u
->ctr
, ps
, depth
))
3338 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
3344 /*******************************************************************
3345 inits a SAMR_Q_SET_ALIASINFO structure.
3346 ********************************************************************/
3348 void init_samr_q_set_aliasinfo(SAMR_Q_SET_ALIASINFO
* q_u
,
3349 POLICY_HND
*hnd
, ALIAS_INFO_CTR
* ctr
)
3351 DEBUG(5, ("init_samr_q_set_aliasinfo\n"));
3353 q_u
->alias_pol
= *hnd
;
3357 /*******************************************************************
3358 reads or writes a structure.
3359 ********************************************************************/
3361 BOOL
samr_io_q_set_aliasinfo(char *desc
, SAMR_Q_SET_ALIASINFO
* q_u
,
3362 prs_struct
*ps
, int depth
)
3367 prs_debug(ps
, depth
, desc
, "samr_io_q_set_aliasinfo");
3373 if(!smb_io_pol_hnd("alias_pol", &q_u
->alias_pol
, ps
, depth
))
3375 if(!samr_alias_info_ctr("ctr", &q_u
->ctr
, ps
, depth
))
3381 /*******************************************************************
3382 reads or writes a structure.
3383 ********************************************************************/
3385 BOOL
samr_io_r_set_aliasinfo(char *desc
, SAMR_R_SET_ALIASINFO
* r_u
,
3386 prs_struct
*ps
, int depth
)
3391 prs_debug(ps
, depth
, desc
, "samr_io_r_set_aliasinfo");
3396 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
3402 /*******************************************************************
3403 inits a SAMR_Q_QUERY_USERALIASES structure.
3404 ********************************************************************/
3406 void init_samr_q_query_useraliases(SAMR_Q_QUERY_USERALIASES
* q_u
,
3409 uint32
*ptr_sid
, DOM_SID2
* sid
)
3411 DEBUG(5, ("init_samr_q_query_useraliases\n"));
3415 q_u
->num_sids1
= num_sids
;
3417 q_u
->num_sids2
= num_sids
;
3419 q_u
->ptr_sid
= ptr_sid
;
3423 /*******************************************************************
3424 reads or writes a SAMR_Q_QUERY_USERALIASES structure.
3425 ********************************************************************/
3427 BOOL
samr_io_q_query_useraliases(char *desc
, SAMR_Q_QUERY_USERALIASES
* q_u
,
3428 prs_struct
*ps
, int depth
)
3436 prs_debug(ps
, depth
, desc
, "samr_io_q_query_useraliases");
3442 if(!smb_io_pol_hnd("pol", &q_u
->pol
, ps
, depth
))
3445 if(!prs_uint32("num_sids1", ps
, depth
, &q_u
->num_sids1
))
3447 if(!prs_uint32("ptr ", ps
, depth
, &q_u
->ptr
))
3453 if(!prs_uint32("num_sids2", ps
, depth
, &q_u
->num_sids2
))
3456 if (UNMARSHALLING(ps
) && (q_u
->num_sids2
!= 0)) {
3457 q_u
->ptr_sid
= (uint32
*)prs_alloc_mem(ps
,sizeof(q_u
->ptr_sid
[0])*q_u
->num_sids2
);
3458 if (q_u
->ptr_sid
== NULL
)
3461 q_u
->sid
= (DOM_SID2
*)prs_alloc_mem(ps
, sizeof(q_u
->sid
[0]) * q_u
->num_sids2
);
3462 if (q_u
->sid
== NULL
)
3466 for (i
= 0; i
< q_u
->num_sids2
; i
++) {
3467 slprintf(tmp
, sizeof(tmp
) - 1, "ptr[%02d]", i
);
3468 if(!prs_uint32(tmp
, ps
, depth
, &q_u
->ptr_sid
[i
]))
3472 for (i
= 0; i
< q_u
->num_sids2
; i
++) {
3473 if (q_u
->ptr_sid
[i
] != 0) {
3474 slprintf(tmp
, sizeof(tmp
) - 1, "sid[%02d]", i
);
3475 if(!smb_io_dom_sid2(tmp
, &q_u
->sid
[i
], ps
, depth
))
3483 /*******************************************************************
3484 inits a SAMR_R_QUERY_USERALIASES structure.
3485 ********************************************************************/
3487 void init_samr_r_query_useraliases(SAMR_R_QUERY_USERALIASES
* r_u
,
3488 uint32 num_rids
, uint32
*rid
,
3491 DEBUG(5, ("init_samr_r_query_useraliases\n"));
3493 if (status
== 0x0) {
3494 r_u
->num_entries
= num_rids
;
3496 r_u
->num_entries2
= num_rids
;
3500 r_u
->num_entries
= 0;
3502 r_u
->num_entries2
= 0;
3505 r_u
->status
= status
;
3508 /*******************************************************************
3509 reads or writes a structure.
3510 ********************************************************************/
3512 BOOL
samr_io_rids(char *desc
, uint32
*num_rids
, uint32
**rid
,
3513 prs_struct
*ps
, int depth
)
3520 prs_debug(ps
, depth
, desc
, "samr_io_rids");
3526 if(!prs_uint32("num_rids", ps
, depth
, num_rids
))
3529 if ((*num_rids
) != 0) {
3530 if (UNMARSHALLING(ps
)) {
3532 (*rid
) = (uint32
*)prs_alloc_mem(ps
,sizeof(uint32
)*(*num_rids
));
3537 for (i
= 0; i
< (*num_rids
); i
++) {
3538 slprintf(tmp
, sizeof(tmp
) - 1, "rid[%02d]", i
);
3539 if(!prs_uint32(tmp
, ps
, depth
, &((*rid
)[i
])))
3547 /*******************************************************************
3548 reads or writes a structure.
3549 ********************************************************************/
3551 BOOL
samr_io_r_query_useraliases(char *desc
, SAMR_R_QUERY_USERALIASES
* r_u
,
3552 prs_struct
*ps
, int depth
)
3557 prs_debug(ps
, depth
, desc
, "samr_io_r_query_useraliases");
3563 if(!prs_uint32("num_entries", ps
, depth
, &r_u
->num_entries
))
3565 if(!prs_uint32("ptr ", ps
, depth
, &r_u
->ptr
))
3568 if (r_u
->ptr
!= 0) {
3569 if(!samr_io_rids("rids", &r_u
->num_entries2
, &r_u
->rid
, ps
, depth
))
3575 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
3581 /*******************************************************************
3582 inits a SAMR_Q_OPEN_ALIAS structure.
3583 ********************************************************************/
3585 void init_samr_q_open_alias(SAMR_Q_OPEN_ALIAS
* q_u
, POLICY_HND
*pol
,
3586 uint32 unknown_0
, uint32 rid
)
3588 DEBUG(5, ("init_samr_q_open_alias\n"));
3590 q_u
->dom_pol
= *pol
;
3592 /* example values: 0x0000 0008 */
3593 q_u
->unknown_0
= unknown_0
;
3595 q_u
->rid_alias
= rid
;
3598 /*******************************************************************
3599 reads or writes a structure.
3600 ********************************************************************/
3602 BOOL
samr_io_q_open_alias(char *desc
, SAMR_Q_OPEN_ALIAS
* q_u
,
3603 prs_struct
*ps
, int depth
)
3608 prs_debug(ps
, depth
, desc
, "samr_io_q_open_alias");
3614 if(!smb_io_pol_hnd("domain_pol", &q_u
->dom_pol
, ps
, depth
))
3617 if(!prs_uint32("unknown_0", ps
, depth
, &q_u
->unknown_0
))
3619 if(!prs_uint32("rid_alias", ps
, depth
, &q_u
->rid_alias
))
3625 /*******************************************************************
3626 reads or writes a structure.
3627 ********************************************************************/
3629 BOOL
samr_io_r_open_alias(char *desc
, SAMR_R_OPEN_ALIAS
* r_u
,
3630 prs_struct
*ps
, int depth
)
3635 prs_debug(ps
, depth
, desc
, "samr_io_r_open_alias");
3641 if(!smb_io_pol_hnd("pol", &r_u
->pol
, ps
, depth
))
3644 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
3650 /*******************************************************************
3651 inits a SAMR_Q_LOOKUP_RIDS structure.
3652 ********************************************************************/
3654 void init_samr_q_lookup_rids(TALLOC_CTX
*ctx
, SAMR_Q_LOOKUP_RIDS
* q_u
,
3655 POLICY_HND
*pol
, uint32 flags
,
3656 uint32 num_rids
, uint32
*rid
)
3658 DEBUG(5, ("init_samr_q_lookup_rids\n"));
3662 q_u
->num_rids1
= num_rids
;
3665 q_u
->num_rids2
= num_rids
;
3666 q_u
->rid
= (uint32
*)talloc(ctx
, num_rids
* sizeof(q_u
->rid
[0]));
3667 if (q_u
->rid
== NULL
) {
3673 /*******************************************************************
3674 reads or writes a structure.
3675 ********************************************************************/
3677 BOOL
samr_io_q_lookup_rids(char *desc
, SAMR_Q_LOOKUP_RIDS
* q_u
,
3678 prs_struct
*ps
, int depth
)
3686 prs_debug(ps
, depth
, desc
, "samr_io_q_lookup_rids");
3689 if (UNMARSHALLING(ps
))
3695 if(!smb_io_pol_hnd("pol", &q_u
->pol
, ps
, depth
))
3698 if(!prs_uint32("num_rids1", ps
, depth
, &q_u
->num_rids1
))
3700 if(!prs_uint32("flags ", ps
, depth
, &q_u
->flags
))
3702 if(!prs_uint32("ptr ", ps
, depth
, &q_u
->ptr
))
3704 if(!prs_uint32("num_rids2", ps
, depth
, &q_u
->num_rids2
))
3707 if (UNMARSHALLING(ps
) && (q_u
->num_rids2
!= 0)) {
3708 q_u
->rid
= (uint32
*)prs_alloc_mem(ps
, sizeof(q_u
->rid
[0])*q_u
->num_rids2
);
3709 if (q_u
->rid
== NULL
)
3713 for (i
= 0; i
< q_u
->num_rids2
; i
++) {
3714 slprintf(tmp
, sizeof(tmp
) - 1, "rid[%02d] ", i
);
3715 if(!prs_uint32(tmp
, ps
, depth
, &q_u
->rid
[i
]))
3722 /*******************************************************************
3723 inits a SAMR_R_LOOKUP_RIDS structure.
3724 ********************************************************************/
3726 void init_samr_r_lookup_rids(SAMR_R_LOOKUP_RIDS
* r_u
,
3727 uint32 num_names
, UNIHDR
* hdr_name
,
3728 UNISTR2
*uni_name
, uint32
*type
)
3730 DEBUG(5, ("init_samr_r_lookup_rids\n"));
3732 r_u
->hdr_name
= NULL
;
3733 r_u
->uni_name
= NULL
;
3736 if (num_names
!= 0) {
3737 r_u
->num_names1
= num_names
;
3739 r_u
->num_names2
= num_names
;
3741 r_u
->num_types1
= num_names
;
3743 r_u
->num_types2
= num_names
;
3745 r_u
->hdr_name
= hdr_name
;
3746 r_u
->uni_name
= uni_name
;
3749 r_u
->num_names1
= num_names
;
3751 r_u
->num_names2
= num_names
;
3753 r_u
->num_types1
= num_names
;
3755 r_u
->num_types2
= num_names
;
3759 /*******************************************************************
3760 reads or writes a structure.
3761 ********************************************************************/
3763 BOOL
samr_io_r_lookup_rids(char *desc
, SAMR_R_LOOKUP_RIDS
* r_u
,
3764 prs_struct
*ps
, int depth
)
3771 prs_debug(ps
, depth
, desc
, "samr_io_r_lookup_rids");
3777 if(!prs_uint32("num_names1", ps
, depth
, &r_u
->num_names1
))
3779 if(!prs_uint32("ptr_names ", ps
, depth
, &r_u
->ptr_names
))
3782 if (r_u
->ptr_names
!= 0) {
3784 if(!prs_uint32("num_names2", ps
, depth
, &r_u
->num_names2
))
3788 if (UNMARSHALLING(ps
) && (r_u
->num_names2
!= 0)) {
3789 r_u
->hdr_name
= (UNIHDR
*) prs_alloc_mem(ps
, r_u
->num_names2
* sizeof(r_u
->hdr_name
[0]));
3790 if (r_u
->hdr_name
== NULL
)
3793 r_u
->uni_name
= (UNISTR2
*)prs_alloc_mem(ps
, r_u
->num_names2
* sizeof(r_u
->uni_name
[0]));
3794 if (r_u
->uni_name
== NULL
)
3798 for (i
= 0; i
< r_u
->num_names2
; i
++) {
3799 slprintf(tmp
, sizeof(tmp
) - 1, "hdr[%02d] ", i
);
3800 if(!smb_io_unihdr("", &r_u
->hdr_name
[i
], ps
, depth
))
3803 for (i
= 0; i
< r_u
->num_names2
; i
++) {
3804 slprintf(tmp
, sizeof(tmp
) - 1, "str[%02d] ", i
);
3805 if(!smb_io_unistr2("", &r_u
->uni_name
[i
], r_u
->hdr_name
[i
].buffer
, ps
, depth
))
3813 if(!prs_uint32("num_types1", ps
, depth
, &r_u
->num_types1
))
3815 if(!prs_uint32("ptr_types ", ps
, depth
, &r_u
->ptr_types
))
3818 if (r_u
->ptr_types
!= 0) {
3820 if(!prs_uint32("num_types2", ps
, depth
, &r_u
->num_types2
))
3823 if (UNMARSHALLING(ps
) && (r_u
->num_types2
!= 0)) {
3824 r_u
->type
= (uint32
*)prs_alloc_mem(ps
, r_u
->num_types2
* sizeof(r_u
->type
[0]));
3825 if (r_u
->type
== NULL
)
3829 for (i
= 0; i
< r_u
->num_types2
; i
++) {
3830 slprintf(tmp
, sizeof(tmp
) - 1, "type[%02d] ", i
);
3831 if(!prs_uint32(tmp
, ps
, depth
, &r_u
->type
[i
]))
3836 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
3842 /*******************************************************************
3843 inits a SAMR_Q_OPEN_ALIAS structure.
3844 ********************************************************************/
3846 void init_samr_q_delete_alias(SAMR_Q_DELETE_DOM_ALIAS
* q_u
, POLICY_HND
*hnd
)
3848 DEBUG(5, ("init_samr_q_delete_alias\n"));
3850 q_u
->alias_pol
= *hnd
;
3853 /*******************************************************************
3854 reads or writes a structure.
3855 ********************************************************************/
3857 BOOL
samr_io_q_delete_alias(char *desc
, SAMR_Q_DELETE_DOM_ALIAS
* q_u
,
3858 prs_struct
*ps
, int depth
)
3863 prs_debug(ps
, depth
, desc
, "samr_io_q_delete_alias");
3869 if(!smb_io_pol_hnd("alias_pol", &q_u
->alias_pol
, ps
, depth
))
3875 /*******************************************************************
3876 reads or writes a structure.
3877 ********************************************************************/
3879 BOOL
samr_io_r_delete_alias(char *desc
, SAMR_R_DELETE_DOM_ALIAS
* r_u
,
3880 prs_struct
*ps
, int depth
)
3885 prs_debug(ps
, depth
, desc
, "samr_io_r_delete_alias");
3891 if(!smb_io_pol_hnd("pol", &r_u
->pol
, ps
, depth
))
3893 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
3899 /*******************************************************************
3900 inits a SAMR_Q_CREATE_DOM_ALIAS structure.
3901 ********************************************************************/
3903 void init_samr_q_create_dom_alias(SAMR_Q_CREATE_DOM_ALIAS
* q_u
,
3904 POLICY_HND
*hnd
, char *acct_desc
)
3906 int acct_len
= acct_desc
!= NULL
? strlen(acct_desc
) : 0;
3908 DEBUG(5, ("init_samr_q_create_dom_alias\n"));
3910 q_u
->dom_pol
= *hnd
;
3912 init_uni_hdr(&q_u
->hdr_acct_desc
, acct_len
);
3913 init_unistr2(&q_u
->uni_acct_desc
, acct_desc
, acct_len
);
3915 q_u
->access_mask
= 0x001f000f;
3918 /*******************************************************************
3919 reads or writes a structure.
3920 ********************************************************************/
3922 BOOL
samr_io_q_create_dom_alias(char *desc
, SAMR_Q_CREATE_DOM_ALIAS
* q_u
,
3923 prs_struct
*ps
, int depth
)
3928 prs_debug(ps
, depth
, desc
, "samr_io_q_create_dom_alias");
3934 if(!smb_io_pol_hnd("dom_pol", &q_u
->dom_pol
, ps
, depth
))
3937 if(!smb_io_unihdr("hdr_acct_desc", &q_u
->hdr_acct_desc
, ps
, depth
))
3939 if(!smb_io_unistr2("uni_acct_desc", &q_u
->uni_acct_desc
,
3940 q_u
->hdr_acct_desc
.buffer
, ps
, depth
))
3945 if(!prs_uint32("access_mask", ps
, depth
, &q_u
->access_mask
))
3951 /*******************************************************************
3952 reads or writes a structure.
3953 ********************************************************************/
3955 BOOL
samr_io_r_create_dom_alias(char *desc
, SAMR_R_CREATE_DOM_ALIAS
* r_u
,
3956 prs_struct
*ps
, int depth
)
3961 prs_debug(ps
, depth
, desc
, "samr_io_r_create_dom_alias");
3967 if(!smb_io_pol_hnd("alias_pol", &r_u
->alias_pol
, ps
, depth
))
3970 if(!prs_uint32("rid", ps
, depth
, &r_u
->rid
))
3973 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
3979 /*******************************************************************
3980 inits a SAMR_Q_ADD_ALIASMEM structure.
3981 ********************************************************************/
3983 void init_samr_q_add_aliasmem(SAMR_Q_ADD_ALIASMEM
* q_u
, POLICY_HND
*hnd
,
3986 DEBUG(5, ("init_samr_q_add_aliasmem\n"));
3988 q_u
->alias_pol
= *hnd
;
3989 init_dom_sid2(&q_u
->sid
, sid
);
3992 /*******************************************************************
3993 reads or writes a structure.
3994 ********************************************************************/
3996 BOOL
samr_io_q_add_aliasmem(char *desc
, SAMR_Q_ADD_ALIASMEM
* q_u
,
3997 prs_struct
*ps
, int depth
)
4002 prs_debug(ps
, depth
, desc
, "samr_io_q_add_aliasmem");
4008 if(!smb_io_pol_hnd("alias_pol", &q_u
->alias_pol
, ps
, depth
))
4010 if(!smb_io_dom_sid2("sid ", &q_u
->sid
, ps
, depth
))
4016 /*******************************************************************
4017 reads or writes a structure.
4018 ********************************************************************/
4020 BOOL
samr_io_r_add_aliasmem(char *desc
, SAMR_R_ADD_ALIASMEM
* r_u
,
4021 prs_struct
*ps
, int depth
)
4026 prs_debug(ps
, depth
, desc
, "samr_io_r_add_aliasmem");
4032 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
4038 /*******************************************************************
4039 inits a SAMR_Q_DEL_ALIASMEM structure.
4040 ********************************************************************/
4042 void init_samr_q_del_aliasmem(SAMR_Q_DEL_ALIASMEM
* q_u
, POLICY_HND
*hnd
,
4045 DEBUG(5, ("init_samr_q_del_aliasmem\n"));
4047 q_u
->alias_pol
= *hnd
;
4048 init_dom_sid2(&q_u
->sid
, sid
);
4051 /*******************************************************************
4052 reads or writes a structure.
4053 ********************************************************************/
4055 BOOL
samr_io_q_del_aliasmem(char *desc
, SAMR_Q_DEL_ALIASMEM
* q_u
,
4056 prs_struct
*ps
, int depth
)
4061 prs_debug(ps
, depth
, desc
, "samr_io_q_del_aliasmem");
4067 if(!smb_io_pol_hnd("alias_pol", &q_u
->alias_pol
, ps
, depth
))
4069 if(!smb_io_dom_sid2("sid ", &q_u
->sid
, ps
, depth
))
4075 /*******************************************************************
4076 reads or writes a structure.
4077 ********************************************************************/
4079 BOOL
samr_io_r_del_aliasmem(char *desc
, SAMR_R_DEL_ALIASMEM
* r_u
,
4080 prs_struct
*ps
, int depth
)
4085 prs_debug(ps
, depth
, desc
, "samr_io_r_del_aliasmem");
4091 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
4097 /*******************************************************************
4098 inits a SAMR_Q_DELETE_DOM_ALIAS structure.
4099 ********************************************************************/
4101 void init_samr_q_delete_dom_alias(SAMR_Q_DELETE_DOM_ALIAS
* q_c
,
4104 DEBUG(5, ("init_samr_q_delete_dom_alias\n"));
4106 q_c
->alias_pol
= *hnd
;
4109 /*******************************************************************
4110 reads or writes a structure.
4111 ********************************************************************/
4113 BOOL
samr_io_q_delete_dom_alias(char *desc
, SAMR_Q_DELETE_DOM_ALIAS
* q_u
,
4114 prs_struct
*ps
, int depth
)
4119 prs_debug(ps
, depth
, desc
, "samr_io_q_delete_dom_alias");
4125 if(!smb_io_pol_hnd("alias_pol", &q_u
->alias_pol
, ps
, depth
))
4131 /*******************************************************************
4132 inits a SAMR_R_DELETE_DOM_ALIAS structure.
4133 ********************************************************************/
4135 void init_samr_r_delete_dom_alias(SAMR_R_DELETE_DOM_ALIAS
* r_u
,
4138 DEBUG(5, ("init_samr_r_delete_dom_alias\n"));
4140 r_u
->status
= status
;
4143 /*******************************************************************
4144 reads or writes a structure.
4145 ********************************************************************/
4147 BOOL
samr_io_r_delete_dom_alias(char *desc
, SAMR_R_DELETE_DOM_ALIAS
* r_u
,
4148 prs_struct
*ps
, int depth
)
4153 prs_debug(ps
, depth
, desc
, "samr_io_r_delete_dom_alias");
4159 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
4165 /*******************************************************************
4166 inits a SAMR_Q_QUERY_ALIASMEM structure.
4167 ********************************************************************/
4169 void init_samr_q_query_aliasmem(SAMR_Q_QUERY_ALIASMEM
* q_c
,
4172 DEBUG(5, ("init_samr_q_query_aliasmem\n"));
4174 q_c
->alias_pol
= *hnd
;
4177 /*******************************************************************
4178 reads or writes a structure.
4179 ********************************************************************/
4181 BOOL
samr_io_q_query_aliasmem(char *desc
, SAMR_Q_QUERY_ALIASMEM
* q_u
,
4182 prs_struct
*ps
, int depth
)
4187 prs_debug(ps
, depth
, desc
, "samr_io_q_query_aliasmem");
4193 if(!smb_io_pol_hnd("alias_pol", &q_u
->alias_pol
, ps
, depth
))
4199 /*******************************************************************
4200 inits a SAMR_R_QUERY_ALIASMEM structure.
4201 ********************************************************************/
4203 void init_samr_r_query_aliasmem(SAMR_R_QUERY_ALIASMEM
* r_u
,
4204 uint32 num_sids
, DOM_SID2
* sid
,
4207 DEBUG(5, ("init_samr_r_query_aliasmem\n"));
4210 r_u
->num_sids
= num_sids
;
4211 r_u
->ptr
= (num_sids
!= 0) ? 1 : 0;
4212 r_u
->num_sids1
= num_sids
;
4220 r_u
->status
= status
;
4223 /*******************************************************************
4224 reads or writes a structure.
4225 ********************************************************************/
4227 BOOL
samr_io_r_query_aliasmem(char *desc
, SAMR_R_QUERY_ALIASMEM
* r_u
,
4228 prs_struct
*ps
, int depth
)
4231 uint32 ptr_sid
[MAX_LOOKUP_SIDS
];
4236 prs_debug(ps
, depth
, desc
, "samr_io_r_query_aliasmem");
4242 if(!prs_uint32("num_sids ", ps
, depth
, &r_u
->num_sids
))
4244 if(!prs_uint32("ptr", ps
, depth
, &r_u
->ptr
))
4247 if (r_u
->ptr
!= 0) {
4248 SMB_ASSERT_ARRAY(ptr_sid
, r_u
->num_sids
);
4250 if (r_u
->num_sids
!= 0) {
4251 if(!prs_uint32("num_sids1", ps
, depth
, &r_u
->num_sids1
))
4254 for (i
= 0; i
< r_u
->num_sids1
; i
++) {
4256 if(!prs_uint32("", ps
, depth
, &ptr_sid
[i
]))
4260 for (i
= 0; i
< r_u
->num_sids1
; i
++) {
4261 if (ptr_sid
[i
] != 0) {
4262 if(!smb_io_dom_sid2("", &r_u
->sid
[i
], ps
, depth
))
4271 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
4277 /*******************************************************************
4278 inits a SAMR_Q_LOOKUP_NAMES structure.
4279 ********************************************************************/
4281 void init_samr_q_lookup_names(SAMR_Q_LOOKUP_NAMES
* q_u
,
4282 POLICY_HND
*pol
, uint32 flags
,
4283 uint32 num_names
, char **name
)
4287 DEBUG(5, ("init_samr_q_lookup_names\n"));
4291 q_u
->num_names1
= num_names
;
4294 q_u
->num_names2
= num_names
;
4296 for (i
= 0; i
< num_names
; i
++) {
4297 int len_name
= name
[i
] != NULL
? strlen(name
[i
]) : 0;
4298 init_uni_hdr(&q_u
->hdr_name
[i
], len_name
); /* unicode header for user_name */
4299 init_unistr2(&q_u
->uni_name
[i
], name
[i
], len_name
); /* unicode string for machine account */
4303 /*******************************************************************
4304 reads or writes a structure.
4305 ********************************************************************/
4307 BOOL
samr_io_q_lookup_names(char *desc
, SAMR_Q_LOOKUP_NAMES
* q_u
,
4308 prs_struct
*ps
, int depth
)
4315 prs_debug(ps
, depth
, desc
, "samr_io_q_lookup_names");
4318 if (UNMARSHALLING(ps
))
4324 if(!smb_io_pol_hnd("pol", &q_u
->pol
, ps
, depth
))
4327 if(!prs_uint32("num_names1", ps
, depth
, &q_u
->num_names1
))
4329 if(!prs_uint32("flags ", ps
, depth
, &q_u
->flags
))
4331 if(!prs_uint32("ptr ", ps
, depth
, &q_u
->ptr
))
4333 if(!prs_uint32("num_names2", ps
, depth
, &q_u
->num_names2
))
4336 SMB_ASSERT_ARRAY(q_u
->hdr_name
, q_u
->num_names2
);
4338 for (i
= 0; i
< q_u
->num_names2
; i
++) {
4339 if(!smb_io_unihdr("", &q_u
->hdr_name
[i
], ps
, depth
))
4343 for (i
= 0; i
< q_u
->num_names2
; i
++) {
4344 if(!smb_io_unistr2("", &q_u
->uni_name
[i
], q_u
->hdr_name
[i
].buffer
, ps
, depth
))
4351 /*******************************************************************
4352 inits a SAMR_R_LOOKUP_NAMES structure.
4353 ********************************************************************/
4355 void init_samr_r_lookup_names(TALLOC_CTX
*ctx
, SAMR_R_LOOKUP_NAMES
* r_u
,
4357 uint32
*rid
, uint32
*type
,
4360 DEBUG(5, ("init_samr_r_lookup_names\n"));
4362 if ((status
== 0) && (num_rids
!= 0)) {
4365 r_u
->num_types1
= num_rids
;
4367 r_u
->num_types2
= num_rids
;
4369 r_u
->num_rids1
= num_rids
;
4371 r_u
->num_rids2
= num_rids
;
4373 r_u
->rids
= (uint32
*)talloc(ctx
, sizeof(uint32
)*num_rids
);
4374 r_u
->types
= (uint32
*)talloc(ctx
, sizeof(uint32
)*num_rids
);
4376 if (!r_u
->rids
|| !r_u
->types
)
4379 for (i
= 0; i
< num_rids
; i
++) {
4380 r_u
->rids
[i
] = rid
[i
];
4381 r_u
->types
[i
] = type
[i
];
4386 r_u
->num_types1
= 0;
4388 r_u
->num_types2
= 0;
4398 r_u
->status
= status
;
4401 /*******************************************************************
4402 reads or writes a structure.
4403 ********************************************************************/
4405 BOOL
samr_io_r_lookup_names(char *desc
, SAMR_R_LOOKUP_NAMES
* r_u
,
4406 prs_struct
*ps
, int depth
)
4414 prs_debug(ps
, depth
, desc
, "samr_io_r_lookup_names");
4417 if (UNMARSHALLING(ps
))
4423 if(!prs_uint32("num_rids1", ps
, depth
, &r_u
->num_rids1
))
4425 if(!prs_uint32("ptr_rids ", ps
, depth
, &r_u
->ptr_rids
))
4428 if (r_u
->ptr_rids
!= 0) {
4429 if(!prs_uint32("num_rids2", ps
, depth
, &r_u
->num_rids2
))
4432 if (r_u
->num_rids2
!= r_u
->num_rids1
) {
4437 if (UNMARSHALLING(ps
))
4438 r_u
->rids
= (uint32
*)prs_alloc_mem(ps
, sizeof(uint32
)*r_u
->num_rids2
);
4441 DEBUG(0, ("NULL rids in samr_io_r_lookup_names\n"));
4445 for (i
= 0; i
< r_u
->num_rids2
; i
++) {
4446 slprintf(tmp
, sizeof(tmp
) - 1, "rid[%02d] ", i
);
4447 if(!prs_uint32(tmp
, ps
, depth
, &r_u
->rids
[i
]))
4452 if(!prs_uint32("num_types1", ps
, depth
, &r_u
->num_types1
))
4454 if(!prs_uint32("ptr_types ", ps
, depth
, &r_u
->ptr_types
))
4457 if (r_u
->ptr_types
!= 0) {
4458 if(!prs_uint32("num_types2", ps
, depth
, &r_u
->num_types2
))
4461 if (r_u
->num_types2
!= r_u
->num_types1
) {
4466 if (UNMARSHALLING(ps
))
4467 r_u
->types
= (uint32
*)prs_alloc_mem(ps
, sizeof(uint32
)*r_u
->num_types2
);
4470 DEBUG(0, ("NULL types in samr_io_r_lookup_names\n"));
4474 for (i
= 0; i
< r_u
->num_types2
; i
++) {
4475 slprintf(tmp
, sizeof(tmp
) - 1, "type[%02d] ", i
);
4476 if(!prs_uint32(tmp
, ps
, depth
, &r_u
->types
[i
]))
4481 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
4487 /*******************************************************************
4488 inits a SAMR_Q_DELETE_DOM_USER structure.
4489 ********************************************************************/
4491 void init_samr_q_delete_dom_user(SAMR_Q_DELETE_DOM_USER
* q_c
,
4494 DEBUG(5, ("init_samr_q_delete_dom_user\n"));
4496 q_c
->user_pol
= *hnd
;
4499 /*******************************************************************
4500 reads or writes a structure.
4501 ********************************************************************/
4503 BOOL
samr_io_q_delete_dom_user(char *desc
, SAMR_Q_DELETE_DOM_USER
* q_u
,
4504 prs_struct
*ps
, int depth
)
4509 prs_debug(ps
, depth
, desc
, "samr_io_q_delete_dom_user");
4515 if(!smb_io_pol_hnd("user_pol", &q_u
->user_pol
, ps
, depth
))
4521 /*******************************************************************
4522 reads or writes a structure.
4523 ********************************************************************/
4525 BOOL
samr_io_r_delete_dom_user(char *desc
, SAMR_R_DELETE_DOM_USER
* r_u
,
4526 prs_struct
*ps
, int depth
)
4531 prs_debug(ps
, depth
, desc
, "samr_io_r_delete_dom_user");
4537 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
4543 /*******************************************************************
4544 reads or writes a structure.
4545 ********************************************************************/
4547 void init_samr_q_open_user(SAMR_Q_OPEN_USER
* q_u
,
4549 uint32 access_mask
, uint32 rid
)
4551 DEBUG(5, ("samr_init_samr_q_open_user\n"));
4553 q_u
->domain_pol
= *pol
;
4554 q_u
->access_mask
= access_mask
;
4555 q_u
->user_rid
= rid
;
4558 /*******************************************************************
4559 reads or writes a structure.
4560 ********************************************************************/
4562 BOOL
samr_io_q_open_user(char *desc
, SAMR_Q_OPEN_USER
* q_u
,
4563 prs_struct
*ps
, int depth
)
4568 prs_debug(ps
, depth
, desc
, "samr_io_q_open_user");
4574 if(!smb_io_pol_hnd("domain_pol", &q_u
->domain_pol
, ps
, depth
))
4577 if(!prs_uint32("access_mask", ps
, depth
, &q_u
->access_mask
))
4579 if(!prs_uint32("user_rid ", ps
, depth
, &q_u
->user_rid
))
4585 /*******************************************************************
4586 reads or writes a structure.
4587 ********************************************************************/
4589 BOOL
samr_io_r_open_user(char *desc
, SAMR_R_OPEN_USER
* r_u
,
4590 prs_struct
*ps
, int depth
)
4595 prs_debug(ps
, depth
, desc
, "samr_io_r_open_user");
4601 if(!smb_io_pol_hnd("user_pol", &r_u
->user_pol
, ps
, depth
))
4604 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
4611 /*******************************************************************
4612 reads or writes a structure.
4613 ********************************************************************/
4615 void init_samr_q_create_user(SAMR_Q_CREATE_USER
* q_u
,
4618 uint32 acb_info
, uint32 access_mask
)
4621 len_name
= strlen(name
);
4623 DEBUG(5, ("samr_init_samr_q_create_user\n"));
4625 q_u
->domain_pol
= *pol
;
4627 init_uni_hdr(&q_u
->hdr_name
, len_name
);
4628 init_unistr2(&q_u
->uni_name
, name
, len_name
);
4630 q_u
->acb_info
= acb_info
;
4631 q_u
->access_mask
= access_mask
;
4634 /*******************************************************************
4635 reads or writes a structure.
4636 ********************************************************************/
4638 BOOL
samr_io_q_create_user(char *desc
, SAMR_Q_CREATE_USER
* q_u
,
4639 prs_struct
*ps
, int depth
)
4644 prs_debug(ps
, depth
, desc
, "samr_io_q_create_user");
4650 if(!smb_io_pol_hnd("domain_pol", &q_u
->domain_pol
, ps
, depth
))
4653 if(!smb_io_unihdr("hdr_name", &q_u
->hdr_name
, ps
, depth
))
4655 if(!smb_io_unistr2("uni_name", &q_u
->uni_name
, q_u
->hdr_name
.buffer
, ps
, depth
))
4660 if(!prs_uint32("acb_info ", ps
, depth
, &q_u
->acb_info
))
4662 if(!prs_uint32("access_mask", ps
, depth
, &q_u
->access_mask
))
4668 /*******************************************************************
4669 reads or writes a structure.
4670 ********************************************************************/
4672 BOOL
samr_io_r_create_user(char *desc
, SAMR_R_CREATE_USER
* r_u
,
4673 prs_struct
*ps
, int depth
)
4678 prs_debug(ps
, depth
, desc
, "samr_io_r_create_user");
4684 if(!smb_io_pol_hnd("user_pol", &r_u
->user_pol
, ps
, depth
))
4687 if(!prs_uint32("unknown_0", ps
, depth
, &r_u
->unknown_0
))
4689 if(!prs_uint32("user_rid ", ps
, depth
, &r_u
->user_rid
))
4691 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
4697 /*******************************************************************
4698 inits a SAMR_Q_QUERY_USERINFO structure.
4699 ********************************************************************/
4701 void init_samr_q_query_userinfo(SAMR_Q_QUERY_USERINFO
* q_u
,
4702 POLICY_HND
*hnd
, uint16 switch_value
)
4704 DEBUG(5, ("init_samr_q_query_userinfo\n"));
4707 q_u
->switch_value
= switch_value
;
4710 /*******************************************************************
4711 reads or writes a structure.
4712 ********************************************************************/
4714 BOOL
samr_io_q_query_userinfo(char *desc
, SAMR_Q_QUERY_USERINFO
* q_u
,
4715 prs_struct
*ps
, int depth
)
4720 prs_debug(ps
, depth
, desc
, "samr_io_q_query_userinfo");
4726 if(!smb_io_pol_hnd("pol", &q_u
->pol
, ps
, depth
))
4729 if(!prs_uint16("switch_value", ps
, depth
, &q_u
->switch_value
)) /* 0x0015 or 0x0011 */
4735 /*******************************************************************
4736 reads or writes a LOGON_HRS structure.
4737 ********************************************************************/
4739 static BOOL
sam_io_logon_hrs(char *desc
, LOGON_HRS
* hrs
,
4740 prs_struct
*ps
, int depth
)
4745 prs_debug(ps
, depth
, desc
, "sam_io_logon_hrs");
4751 if(!prs_uint32("len ", ps
, depth
, &hrs
->len
))
4754 if (hrs
->len
> sizeof(hrs
->hours
)) {
4755 DEBUG(3, ("sam_io_logon_hrs: truncating length from %d\n", hrs
->len
));
4756 hrs
->len
= sizeof(hrs
->hours
);
4759 if(!prs_uint8s(False
, "hours", ps
, depth
, hrs
->hours
, hrs
->len
))
4765 /*******************************************************************
4766 inits a SAM_USER_INFO_12 structure.
4767 ********************************************************************/
4769 void init_sam_user_info12(SAM_USER_INFO_12
* usr
,
4770 uint8 lm_pwd
[16], uint8 nt_pwd
[16])
4772 DEBUG(5, ("init_sam_user_info12\n"));
4774 usr
->lm_pwd_active
=
4775 memcpy(usr
->lm_pwd
, lm_pwd
, sizeof(usr
->lm_pwd
)) ? 1 : 0;
4776 usr
->nt_pwd_active
=
4777 memcpy(usr
->nt_pwd
, nt_pwd
, sizeof(usr
->nt_pwd
)) ? 1 : 0;
4780 /*******************************************************************
4781 reads or writes a structure.
4782 ********************************************************************/
4784 static BOOL
sam_io_user_info12(char *desc
, SAM_USER_INFO_12
* u
,
4785 prs_struct
*ps
, int depth
)
4790 DEBUG(0, ("possible security breach!\n"));
4792 prs_debug(ps
, depth
, desc
, "samr_io_r_user_info12");
4798 if(!prs_uint8s(False
, "lm_pwd", ps
, depth
, u
->lm_pwd
, sizeof(u
->lm_pwd
)))
4800 if(!prs_uint8s(False
, "nt_pwd", ps
, depth
, u
->nt_pwd
, sizeof(u
->nt_pwd
)))
4803 if(!prs_uint8("lm_pwd_active", ps
, depth
, &u
->lm_pwd_active
))
4805 if(!prs_uint8("nt_pwd_active", ps
, depth
, &u
->nt_pwd_active
))
4811 /*******************************************************************
4812 inits a SAM_USER_INFO_10 structure.
4813 ********************************************************************/
4815 void init_sam_user_info10(SAM_USER_INFO_10
* usr
, uint32 acb_info
)
4817 DEBUG(5, ("init_sam_user_info10\n"));
4819 usr
->acb_info
= acb_info
;
4822 /*******************************************************************
4823 reads or writes a structure.
4824 ********************************************************************/
4826 static BOOL
sam_io_user_info10(char *desc
, SAM_USER_INFO_10
* usr
,
4827 prs_struct
*ps
, int depth
)
4832 prs_debug(ps
, depth
, desc
, "samr_io_r_user_info10");
4838 if(!prs_uint32("acb_info", ps
, depth
, &usr
->acb_info
))
4844 /*******************************************************************
4845 inits a SAM_USER_INFO_11 structure.
4846 ********************************************************************/
4848 void init_sam_user_info11(SAM_USER_INFO_11
* usr
,
4851 uint32 rid_user
, uint32 rid_group
, uint16 acct_ctrl
)
4855 DEBUG(5, ("init_sam_user_info11\n"));
4857 len_mach_acct
= strlen(mach_acct
);
4859 memcpy(&(usr
->expiry
), expiry
, sizeof(usr
->expiry
)); /* expiry time or something? */
4860 ZERO_STRUCT(usr
->padding_1
); /* 0 - padding 24 bytes */
4862 init_uni_hdr(&usr
->hdr_mach_acct
, len_mach_acct
); /* unicode header for machine account */
4863 usr
->padding_2
= 0; /* 0 - padding 4 bytes */
4865 usr
->ptr_1
= 1; /* pointer */
4866 ZERO_STRUCT(usr
->padding_3
); /* 0 - padding 32 bytes */
4867 usr
->padding_4
= 0; /* 0 - padding 4 bytes */
4869 usr
->ptr_2
= 1; /* pointer */
4870 usr
->padding_5
= 0; /* 0 - padding 4 bytes */
4872 usr
->ptr_3
= 1; /* pointer */
4873 ZERO_STRUCT(usr
->padding_6
); /* 0 - padding 32 bytes */
4875 usr
->rid_user
= rid_user
;
4876 usr
->rid_group
= rid_group
;
4878 usr
->acct_ctrl
= acct_ctrl
;
4879 usr
->unknown_3
= 0x0000;
4881 usr
->unknown_4
= 0x003f; /* 0x003f - 16 bit unknown */
4882 usr
->unknown_5
= 0x003c; /* 0x003c - 16 bit unknown */
4884 ZERO_STRUCT(usr
->padding_7
); /* 0 - padding 16 bytes */
4885 usr
->padding_8
= 0; /* 0 - padding 4 bytes */
4887 init_unistr2(&usr
->uni_mach_acct
, mach_acct
, len_mach_acct
); /* unicode string for machine account */
4890 /*******************************************************************
4891 reads or writes a structure.
4892 ********************************************************************/
4894 static BOOL
sam_io_user_info11(char *desc
, SAM_USER_INFO_11
* usr
,
4895 prs_struct
*ps
, int depth
)
4900 prs_debug(ps
, depth
, desc
, "samr_io_r_unknown_11");
4906 if(!prs_uint8s(False
, "padding_0", ps
, depth
, usr
->padding_0
, sizeof(usr
->padding_0
)))
4909 if(!smb_io_time("time", &usr
->expiry
, ps
, depth
))
4912 if(!prs_uint8s(False
, "padding_1", ps
, depth
, usr
->padding_1
, sizeof(usr
->padding_1
)))
4915 if(!smb_io_unihdr("unihdr", &usr
->hdr_mach_acct
, ps
, depth
))
4918 if(!prs_uint32("padding_2", ps
, depth
, &usr
->padding_2
))
4921 if(!prs_uint32("ptr_1 ", ps
, depth
, &usr
->ptr_1
))
4923 if(!prs_uint8s(False
, "padding_3", ps
, depth
, usr
->padding_3
, sizeof(usr
->padding_3
)))
4926 if(!prs_uint32("padding_4", ps
, depth
, &usr
->padding_4
))
4929 if(!prs_uint32("ptr_2 ", ps
, depth
, &usr
->ptr_2
))
4931 if(!prs_uint32("padding_5", ps
, depth
, &usr
->padding_5
))
4934 if(!prs_uint32("ptr_3 ", ps
, depth
, &usr
->ptr_3
))
4936 if(!prs_uint8s(False
, "padding_6", ps
, depth
, usr
->padding_6
,sizeof(usr
->padding_6
)))
4939 if(!prs_uint32("rid_user ", ps
, depth
, &usr
->rid_user
))
4941 if(!prs_uint32("rid_group", ps
, depth
, &usr
->rid_group
))
4943 if(!prs_uint16("acct_ctrl", ps
, depth
, &usr
->acct_ctrl
))
4945 if(!prs_uint16("unknown_3", ps
, depth
, &usr
->unknown_3
))
4947 if(!prs_uint16("unknown_4", ps
, depth
, &usr
->unknown_4
))
4949 if(!prs_uint16("unknown_5", ps
, depth
, &usr
->unknown_5
))
4952 if(!prs_uint8s(False
, "padding_7", ps
, depth
, usr
->padding_7
, sizeof(usr
->padding_7
)))
4955 if(!prs_uint32("padding_8", ps
, depth
, &(usr
->padding_8
)))
4958 if(!smb_io_unistr2("unistr2", &usr
->uni_mach_acct
, True
, ps
, depth
))
4964 if(!prs_uint8s(False
, "padding_9", ps
, depth
, usr
->padding_9
, sizeof(usr
->padding_9
)))
4970 /*************************************************************************
4973 unknown_3 = 0x09f8 27fa
4974 unknown_5 = 0x0001 0000
4975 unknown_6 = 0x0000 04ec
4977 *************************************************************************/
4979 void init_sam_user_info24(SAM_USER_INFO_24
* usr
,
4980 char newpass
[516], uint16 passlen
)
4982 DEBUG(10, ("init_sam_user_info24: passlen: %d\n", passlen
));
4983 memcpy(usr
->pass
, newpass
, sizeof(usr
->pass
));
4984 usr
->unk_0
= passlen
;
4987 /*******************************************************************
4988 reads or writes a structure.
4989 ********************************************************************/
4991 static BOOL
sam_io_user_info24(char *desc
, SAM_USER_INFO_24
* usr
,
4992 prs_struct
*ps
, int depth
)
4997 prs_debug(ps
, depth
, desc
, "sam_io_user_info24");
5003 if(!prs_uint8s(False
, "password", ps
, depth
, usr
->pass
, sizeof(usr
->pass
)))
5005 if(!prs_uint16("unk_0", ps
, depth
, &usr
->unk_0
)) /* unknown */
5011 /*************************************************************************
5012 init_sam_user_info23
5014 unknown_3 = 0x09f8 27fa
5015 unknown_5 = 0x0001 0000
5016 unknown_6 = 0x0000 04ec
5018 *************************************************************************/
5020 void init_sam_user_info23W(SAM_USER_INFO_23
* usr
, NTTIME
* logon_time
, /* all zeros */
5021 NTTIME
* logoff_time
, /* all zeros */
5022 NTTIME
* kickoff_time
, /* all zeros */
5023 NTTIME
* pass_last_set_time
, /* all zeros */
5024 NTTIME
* pass_can_change_time
, /* all zeros */
5025 NTTIME
* pass_must_change_time
, /* all zeros */
5036 uint32 user_rid
, /* 0x0000 0000 */
5043 char newpass
[516], uint32 unknown_6
)
5045 int len_user_name
= user_name
!= NULL
? user_name
->uni_str_len
: 0;
5046 int len_full_name
= full_name
!= NULL
? full_name
->uni_str_len
: 0;
5047 int len_home_dir
= home_dir
!= NULL
? home_dir
->uni_str_len
: 0;
5048 int len_dir_drive
= dir_drive
!= NULL
? dir_drive
->uni_str_len
: 0;
5049 int len_logon_script
= log_scr
!= NULL
? log_scr
->uni_str_len
: 0;
5050 int len_profile_path
= prof_path
!= NULL
? prof_path
->uni_str_len
: 0;
5051 int len_description
= desc
!= NULL
? desc
->uni_str_len
: 0;
5052 int len_workstations
= wkstas
!= NULL
? wkstas
->uni_str_len
: 0;
5053 int len_unknown_str
= unk_str
!= NULL
? unk_str
->uni_str_len
: 0;
5054 int len_munged_dial
= mung_dial
!= NULL
? mung_dial
->uni_str_len
: 0;
5056 usr
->logon_time
= *logon_time
; /* all zeros */
5057 usr
->logoff_time
= *logoff_time
; /* all zeros */
5058 usr
->kickoff_time
= *kickoff_time
; /* all zeros */
5059 usr
->pass_last_set_time
= *pass_last_set_time
; /* all zeros */
5060 usr
->pass_can_change_time
= *pass_can_change_time
; /* all zeros */
5061 usr
->pass_must_change_time
= *pass_must_change_time
; /* all zeros */
5063 init_uni_hdr(&usr
->hdr_user_name
, len_user_name
); /* NULL */
5064 init_uni_hdr(&usr
->hdr_full_name
, len_full_name
);
5065 init_uni_hdr(&usr
->hdr_home_dir
, len_home_dir
);
5066 init_uni_hdr(&usr
->hdr_dir_drive
, len_dir_drive
);
5067 init_uni_hdr(&usr
->hdr_logon_script
, len_logon_script
);
5068 init_uni_hdr(&usr
->hdr_profile_path
, len_profile_path
);
5069 init_uni_hdr(&usr
->hdr_acct_desc
, len_description
);
5070 init_uni_hdr(&usr
->hdr_workstations
, len_workstations
);
5071 init_uni_hdr(&usr
->hdr_unknown_str
, len_unknown_str
);
5072 init_uni_hdr(&usr
->hdr_munged_dial
, len_munged_dial
);
5074 ZERO_STRUCT(usr
->nt_pwd
);
5075 ZERO_STRUCT(usr
->lm_pwd
);
5077 usr
->user_rid
= user_rid
; /* 0x0000 0000 */
5078 usr
->group_rid
= group_rid
;
5079 usr
->acb_info
= acb_info
;
5080 usr
->unknown_3
= unknown_3
; /* 09f8 27fa */
5082 usr
->logon_divs
= logon_divs
; /* should be 168 (hours/week) */
5083 usr
->ptr_logon_hrs
= hrs
? 1 : 0;
5085 ZERO_STRUCT(usr
->padding1
);
5087 usr
->unknown_5
= unknown_5
; /* 0x0001 0000 */
5089 memcpy(usr
->pass
, newpass
, sizeof(usr
->pass
));
5091 copy_unistr2(&usr
->uni_user_name
, user_name
);
5092 copy_unistr2(&usr
->uni_full_name
, full_name
);
5093 copy_unistr2(&usr
->uni_home_dir
, home_dir
);
5094 copy_unistr2(&usr
->uni_dir_drive
, dir_drive
);
5095 copy_unistr2(&usr
->uni_logon_script
, log_scr
);
5096 copy_unistr2(&usr
->uni_profile_path
, prof_path
);
5097 copy_unistr2(&usr
->uni_acct_desc
, desc
);
5098 copy_unistr2(&usr
->uni_workstations
, wkstas
);
5099 copy_unistr2(&usr
->uni_unknown_str
, unk_str
);
5100 copy_unistr2(&usr
->uni_munged_dial
, mung_dial
);
5102 usr
->unknown_6
= unknown_6
; /* 0x0000 04ec */
5105 memcpy(&usr
->logon_hrs
, hrs
, sizeof(usr
->logon_hrs
));
5108 /*************************************************************************
5109 init_sam_user_info23
5111 unknown_3 = 0x09f8 27fa
5112 unknown_5 = 0x0001 0000
5113 unknown_6 = 0x0000 04ec
5115 *************************************************************************/
5117 void init_sam_user_info23A(SAM_USER_INFO_23
* usr
, NTTIME
* logon_time
, /* all zeros */
5118 NTTIME
* logoff_time
, /* all zeros */
5119 NTTIME
* kickoff_time
, /* all zeros */
5120 NTTIME
* pass_last_set_time
, /* all zeros */
5121 NTTIME
* pass_can_change_time
, /* all zeros */
5122 NTTIME
* pass_must_change_time
, /* all zeros */
5123 char *user_name
, /* NULL */
5125 char *home_dir
, char *dir_drive
, char *log_scr
,
5126 char *prof_path
, char *desc
, char *wkstas
,
5127 char *unk_str
, char *mung_dial
, uint32 user_rid
, /* 0x0000 0000 */
5128 uint32 group_rid
, uint32 acb_info
,
5129 uint32 unknown_3
, uint16 logon_divs
,
5130 LOGON_HRS
* hrs
, uint32 unknown_5
,
5131 char newpass
[516], uint32 unknown_6
)
5133 int len_user_name
= user_name
!= NULL
? strlen(user_name
) : 0;
5134 int len_full_name
= full_name
!= NULL
? strlen(full_name
) : 0;
5135 int len_home_dir
= home_dir
!= NULL
? strlen(home_dir
) : 0;
5136 int len_dir_drive
= dir_drive
!= NULL
? strlen(dir_drive
) : 0;
5137 int len_logon_script
= log_scr
!= NULL
? strlen(log_scr
) : 0;
5138 int len_profile_path
= prof_path
!= NULL
? strlen(prof_path
) : 0;
5139 int len_description
= desc
!= NULL
? strlen(desc
) : 0;
5140 int len_workstations
= wkstas
!= NULL
? strlen(wkstas
) : 0;
5141 int len_unknown_str
= unk_str
!= NULL
? strlen(unk_str
) : 0;
5142 int len_munged_dial
= mung_dial
!= NULL
? strlen(mung_dial
) : 0;
5144 usr
->logon_time
= *logon_time
; /* all zeros */
5145 usr
->logoff_time
= *logoff_time
; /* all zeros */
5146 usr
->kickoff_time
= *kickoff_time
; /* all zeros */
5147 usr
->pass_last_set_time
= *pass_last_set_time
; /* all zeros */
5148 usr
->pass_can_change_time
= *pass_can_change_time
; /* all zeros */
5149 usr
->pass_must_change_time
= *pass_must_change_time
; /* all zeros */
5151 init_uni_hdr(&usr
->hdr_user_name
, len_user_name
); /* NULL */
5152 init_uni_hdr(&usr
->hdr_full_name
, len_full_name
);
5153 init_uni_hdr(&usr
->hdr_home_dir
, len_home_dir
);
5154 init_uni_hdr(&usr
->hdr_dir_drive
, len_dir_drive
);
5155 init_uni_hdr(&usr
->hdr_logon_script
, len_logon_script
);
5156 init_uni_hdr(&usr
->hdr_profile_path
, len_profile_path
);
5157 init_uni_hdr(&usr
->hdr_acct_desc
, len_description
);
5158 init_uni_hdr(&usr
->hdr_workstations
, len_workstations
);
5159 init_uni_hdr(&usr
->hdr_unknown_str
, len_unknown_str
);
5160 init_uni_hdr(&usr
->hdr_munged_dial
, len_munged_dial
);
5162 ZERO_STRUCT(usr
->nt_pwd
);
5163 ZERO_STRUCT(usr
->lm_pwd
);
5165 usr
->user_rid
= user_rid
; /* 0x0000 0000 */
5166 usr
->group_rid
= group_rid
;
5167 usr
->acb_info
= acb_info
;
5168 usr
->unknown_3
= unknown_3
; /* 09f8 27fa */
5170 usr
->logon_divs
= logon_divs
; /* should be 168 (hours/week) */
5171 usr
->ptr_logon_hrs
= hrs
? 1 : 0;
5173 ZERO_STRUCT(usr
->padding1
);
5175 usr
->unknown_5
= unknown_5
; /* 0x0001 0000 */
5177 memcpy(usr
->pass
, newpass
, sizeof(usr
->pass
));
5179 init_unistr2(&usr
->uni_user_name
, user_name
, len_user_name
); /* NULL */
5180 init_unistr2(&usr
->uni_full_name
, full_name
, len_full_name
);
5181 init_unistr2(&usr
->uni_home_dir
, home_dir
, len_home_dir
);
5182 init_unistr2(&usr
->uni_dir_drive
, dir_drive
, len_dir_drive
);
5183 init_unistr2(&usr
->uni_logon_script
, log_scr
, len_logon_script
);
5184 init_unistr2(&usr
->uni_profile_path
, prof_path
, len_profile_path
);
5185 init_unistr2(&usr
->uni_acct_desc
, desc
, len_description
);
5186 init_unistr2(&usr
->uni_workstations
, wkstas
, len_workstations
);
5187 init_unistr2(&usr
->uni_unknown_str
, unk_str
, len_unknown_str
);
5188 init_unistr2(&usr
->uni_munged_dial
, mung_dial
, len_munged_dial
);
5190 usr
->unknown_6
= unknown_6
; /* 0x0000 04ec */
5193 memcpy(&usr
->logon_hrs
, hrs
, sizeof(usr
->logon_hrs
));
5196 /*******************************************************************
5197 reads or writes a structure.
5198 ********************************************************************/
5200 static BOOL
sam_io_user_info23(char *desc
, SAM_USER_INFO_23
* usr
,
5201 prs_struct
*ps
, int depth
)
5206 prs_debug(ps
, depth
, desc
, "sam_io_user_info23");
5212 if(!smb_io_time("logon_time ", &usr
->logon_time
, ps
, depth
))
5214 if(!smb_io_time("logoff_time ", &usr
->logoff_time
, ps
, depth
))
5216 if(!smb_io_time("kickoff_time ", &usr
->kickoff_time
, ps
, depth
))
5218 if(!smb_io_time("pass_last_set_time ", &usr
->pass_last_set_time
, ps
, depth
))
5220 if(!smb_io_time("pass_can_change_time ", &usr
->pass_can_change_time
, ps
, depth
))
5222 if(!smb_io_time("pass_must_change_time", &usr
->pass_must_change_time
, ps
, depth
))
5225 if(!smb_io_unihdr("hdr_user_name ", &usr
->hdr_user_name
, ps
, depth
)) /* username unicode string header */
5227 if(!smb_io_unihdr("hdr_full_name ", &usr
->hdr_full_name
, ps
, depth
)) /* user's full name unicode string header */
5229 if(!smb_io_unihdr("hdr_home_dir ", &usr
->hdr_home_dir
, ps
, depth
)) /* home directory unicode string header */
5231 if(!smb_io_unihdr("hdr_dir_drive ", &usr
->hdr_dir_drive
, ps
, depth
)) /* home directory drive */
5233 if(!smb_io_unihdr("hdr_logon_script", &usr
->hdr_logon_script
, ps
, depth
)) /* logon script unicode string header */
5235 if(!smb_io_unihdr("hdr_profile_path", &usr
->hdr_profile_path
, ps
, depth
)) /* profile path unicode string header */
5237 if(!smb_io_unihdr("hdr_acct_desc ", &usr
->hdr_acct_desc
, ps
, depth
)) /* account desc */
5239 if(!smb_io_unihdr("hdr_workstations", &usr
->hdr_workstations
, ps
, depth
)) /* wkstas user can log on from */
5241 if(!smb_io_unihdr("hdr_unknown_str ", &usr
->hdr_unknown_str
, ps
, depth
)) /* unknown string */
5243 if(!smb_io_unihdr("hdr_munged_dial ", &usr
->hdr_munged_dial
, ps
, depth
)) /* wkstas user can log on from */
5246 if(!prs_uint8s(False
, "lm_pwd ", ps
, depth
, usr
->lm_pwd
, sizeof(usr
->lm_pwd
)))
5248 if(!prs_uint8s(False
, "nt_pwd ", ps
, depth
, usr
->nt_pwd
, sizeof(usr
->nt_pwd
)))
5251 if(!prs_uint32("user_rid ", ps
, depth
, &usr
->user_rid
)) /* User ID */
5253 if(!prs_uint32("group_rid ", ps
, depth
, &usr
->group_rid
)) /* Group ID */
5255 if(!prs_uint32("acb_info ", ps
, depth
, &usr
->acb_info
))
5258 if(!prs_uint32("unknown_3 ", ps
, depth
, &usr
->unknown_3
))
5260 if(!prs_uint16("logon_divs ", ps
, depth
, &usr
->logon_divs
)) /* logon divisions per week */
5264 if(!prs_uint32("ptr_logon_hrs ", ps
, depth
, &usr
->ptr_logon_hrs
))
5266 if(!prs_uint8s(False
, "padding1 ", ps
, depth
, usr
->padding1
, sizeof(usr
->padding1
)))
5268 if(!prs_uint32("unknown_5 ", ps
, depth
, &usr
->unknown_5
))
5271 if(!prs_uint8s(False
, "password ", ps
, depth
, usr
->pass
, sizeof(usr
->pass
)))
5274 /* here begins pointed-to data */
5276 if(!smb_io_unistr2("uni_user_name ", &usr
->uni_user_name
, usr
->hdr_user_name
.buffer
, ps
, depth
)) /* username unicode string */
5279 if(!smb_io_unistr2("uni_full_name ", &usr
->uni_full_name
, usr
->hdr_full_name
.buffer
, ps
, depth
)) /* user's full name unicode string */
5282 if(!smb_io_unistr2("uni_home_dir ", &usr
->uni_home_dir
, usr
->hdr_home_dir
.buffer
, ps
, depth
)) /* home directory unicode string */
5285 if(!smb_io_unistr2("uni_dir_drive ", &usr
->uni_dir_drive
, usr
->hdr_dir_drive
.buffer
, ps
, depth
)) /* home directory drive unicode string */
5288 if(!smb_io_unistr2("uni_logon_script", &usr
->uni_logon_script
, usr
->hdr_logon_script
.buffer
, ps
, depth
)) /* logon script unicode string */
5291 if(!smb_io_unistr2("uni_profile_path", &usr
->uni_profile_path
, usr
->hdr_profile_path
.buffer
, ps
, depth
)) /* profile path unicode string */
5294 if(!smb_io_unistr2("uni_acct_desc ", &usr
->uni_acct_desc
, usr
->hdr_acct_desc
.buffer
, ps
, depth
)) /* user desc unicode string */
5297 if(!smb_io_unistr2("uni_workstations", &usr
->uni_workstations
, usr
->hdr_workstations
.buffer
, ps
, depth
)) /* worksations user can log on from */
5300 if(!smb_io_unistr2("uni_unknown_str ", &usr
->uni_unknown_str
, usr
->hdr_unknown_str
.buffer
, ps
, depth
)) /* unknown string */
5303 if(!smb_io_unistr2("uni_munged_dial ", &usr
->uni_munged_dial
, usr
->hdr_munged_dial
.buffer
, ps
, depth
))
5306 /* ok, this is only guess-work (as usual) */
5307 if (usr
->ptr_logon_hrs
) {
5308 if(!prs_uint32("unknown_6 ", ps
, depth
, &usr
->unknown_6
))
5310 if(!prs_uint32("padding4 ", ps
, depth
, &usr
->padding4
))
5312 if(!sam_io_logon_hrs("logon_hrs", &usr
->logon_hrs
, ps
, depth
))
5314 } else if (UNMARSHALLING(ps
)) {
5323 /*************************************************************************
5324 init_sam_user_info21W
5326 unknown_3 = 0x00ff ffff
5327 unknown_5 = 0x0002 0000
5328 unknown_6 = 0x0000 04ec
5330 *************************************************************************/
5332 void init_sam_user_info21W(SAM_USER_INFO_21
* usr
,
5333 NTTIME
* logon_time
,
5334 NTTIME
* logoff_time
,
5335 NTTIME
* kickoff_time
,
5336 NTTIME
* pass_last_set_time
,
5337 NTTIME
* pass_can_change_time
,
5338 NTTIME
* pass_must_change_time
,
5357 uint32 unknown_5
, uint32 unknown_6
)
5359 int len_user_name
= user_name
!= NULL
? user_name
->uni_str_len
: 0;
5360 int len_full_name
= full_name
!= NULL
? full_name
->uni_str_len
: 0;
5361 int len_home_dir
= home_dir
!= NULL
? home_dir
->uni_str_len
: 0;
5362 int len_dir_drive
= dir_drive
!= NULL
? dir_drive
->uni_str_len
: 0;
5363 int len_logon_script
= log_scr
!= NULL
? log_scr
->uni_str_len
: 0;
5364 int len_profile_path
= prof_path
!= NULL
? prof_path
->uni_str_len
: 0;
5365 int len_description
= desc
!= NULL
? desc
->uni_str_len
: 0;
5366 int len_workstations
= wkstas
!= NULL
? wkstas
->uni_str_len
: 0;
5367 int len_unknown_str
= unk_str
!= NULL
? unk_str
->uni_str_len
: 0;
5368 int len_munged_dial
= mung_dial
!= NULL
? mung_dial
->uni_str_len
: 0;
5370 usr
->logon_time
= *logon_time
;
5371 usr
->logoff_time
= *logoff_time
;
5372 usr
->kickoff_time
= *kickoff_time
;
5373 usr
->pass_last_set_time
= *pass_last_set_time
;
5374 usr
->pass_can_change_time
= *pass_can_change_time
;
5375 usr
->pass_must_change_time
= *pass_must_change_time
;
5377 init_uni_hdr(&usr
->hdr_user_name
, len_user_name
);
5378 init_uni_hdr(&usr
->hdr_full_name
, len_full_name
);
5379 init_uni_hdr(&usr
->hdr_home_dir
, len_home_dir
);
5380 init_uni_hdr(&usr
->hdr_dir_drive
, len_dir_drive
);
5381 init_uni_hdr(&usr
->hdr_logon_script
, len_logon_script
);
5382 init_uni_hdr(&usr
->hdr_profile_path
, len_profile_path
);
5383 init_uni_hdr(&usr
->hdr_acct_desc
, len_description
);
5384 init_uni_hdr(&usr
->hdr_workstations
, len_workstations
);
5385 init_uni_hdr(&usr
->hdr_unknown_str
, len_unknown_str
);
5386 init_uni_hdr(&usr
->hdr_munged_dial
, len_munged_dial
);
5388 memcpy(usr
->lm_pwd
, lm_pwd
, sizeof(usr
->lm_pwd
));
5389 memcpy(usr
->nt_pwd
, nt_pwd
, sizeof(usr
->nt_pwd
));
5391 usr
->user_rid
= user_rid
;
5392 usr
->group_rid
= group_rid
;
5393 usr
->acb_info
= acb_info
;
5394 usr
->unknown_3
= unknown_3
; /* 0x00ff ffff */
5396 usr
->logon_divs
= logon_divs
; /* should be 168 (hours/week) */
5397 usr
->ptr_logon_hrs
= hrs
? 1 : 0;
5398 usr
->unknown_5
= unknown_5
; /* 0x0002 0000 */
5400 ZERO_STRUCT(usr
->padding1
);
5402 copy_unistr2(&usr
->uni_user_name
, user_name
);
5403 copy_unistr2(&usr
->uni_full_name
, full_name
);
5404 copy_unistr2(&usr
->uni_home_dir
, home_dir
);
5405 copy_unistr2(&usr
->uni_dir_drive
, dir_drive
);
5406 copy_unistr2(&usr
->uni_logon_script
, log_scr
);
5407 copy_unistr2(&usr
->uni_profile_path
, prof_path
);
5408 copy_unistr2(&usr
->uni_acct_desc
, desc
);
5409 copy_unistr2(&usr
->uni_workstations
, wkstas
);
5410 copy_unistr2(&usr
->uni_unknown_str
, unk_str
);
5411 copy_unistr2(&usr
->uni_munged_dial
, mung_dial
);
5413 usr
->unknown_6
= unknown_6
; /* 0x0000 04ec */
5416 memcpy(&usr
->logon_hrs
, hrs
, sizeof(usr
->logon_hrs
));
5419 /*************************************************************************
5420 init_sam_user_info21
5422 unknown_3 = 0x00ff ffff
5423 unknown_5 = 0x0002 0000
5424 unknown_6 = 0x0000 04ec
5426 *************************************************************************/
5428 void init_sam_user_info21A(SAM_USER_INFO_21
* usr
,
5429 NTTIME
* logon_time
,
5430 NTTIME
* logoff_time
,
5431 NTTIME
* kickoff_time
,
5432 NTTIME
* pass_last_set_time
,
5433 NTTIME
* pass_can_change_time
,
5434 NTTIME
* pass_must_change_time
,
5451 uint32 unknown_5
, uint32 unknown_6
)
5453 int len_user_name
= user_name
!= NULL
? strlen(user_name
) : 0;
5454 int len_full_name
= full_name
!= NULL
? strlen(full_name
) : 0;
5455 int len_home_dir
= home_dir
!= NULL
? strlen(home_dir
) : 0;
5456 int len_dir_drive
= dir_drive
!= NULL
? strlen(dir_drive
) : 0;
5457 int len_logon_script
= log_scr
!= NULL
? strlen(log_scr
) : 0;
5458 int len_profile_path
= prof_path
!= NULL
? strlen(prof_path
) : 0;
5459 int len_description
= desc
!= NULL
? strlen(desc
) : 0;
5460 int len_workstations
= wkstas
!= NULL
? strlen(wkstas
) : 0;
5461 int len_unknown_str
= unk_str
!= NULL
? strlen(unk_str
) : 0;
5462 int len_munged_dial
= mung_dial
!= NULL
? strlen(mung_dial
) : 0;
5464 usr
->logon_time
= *logon_time
;
5465 usr
->logoff_time
= *logoff_time
;
5466 usr
->kickoff_time
= *kickoff_time
;
5467 usr
->pass_last_set_time
= *pass_last_set_time
;
5468 usr
->pass_can_change_time
= *pass_can_change_time
;
5469 usr
->pass_must_change_time
= *pass_must_change_time
;
5471 init_uni_hdr(&usr
->hdr_user_name
, len_user_name
);
5472 init_uni_hdr(&usr
->hdr_full_name
, len_full_name
);
5473 init_uni_hdr(&usr
->hdr_home_dir
, len_home_dir
);
5474 init_uni_hdr(&usr
->hdr_dir_drive
, len_dir_drive
);
5475 init_uni_hdr(&usr
->hdr_logon_script
, len_logon_script
);
5476 init_uni_hdr(&usr
->hdr_profile_path
, len_profile_path
);
5477 init_uni_hdr(&usr
->hdr_acct_desc
, len_description
);
5478 init_uni_hdr(&usr
->hdr_workstations
, len_workstations
);
5479 init_uni_hdr(&usr
->hdr_unknown_str
, len_unknown_str
);
5480 init_uni_hdr(&usr
->hdr_munged_dial
, len_munged_dial
);
5482 ZERO_STRUCT(usr
->nt_pwd
);
5483 ZERO_STRUCT(usr
->lm_pwd
);
5485 usr
->user_rid
= user_rid
;
5486 usr
->group_rid
= group_rid
;
5487 usr
->acb_info
= acb_info
;
5488 usr
->unknown_3
= unknown_3
; /* 0x00ff ffff */
5490 usr
->logon_divs
= logon_divs
; /* should be 168 (hours/week) */
5491 usr
->ptr_logon_hrs
= hrs
? 1 : 0;
5492 usr
->unknown_5
= unknown_5
; /* 0x0002 0000 */
5494 ZERO_STRUCT(usr
->padding1
);
5496 init_unistr2(&usr
->uni_user_name
, user_name
, len_user_name
);
5497 init_unistr2(&usr
->uni_full_name
, full_name
, len_full_name
);
5498 init_unistr2(&usr
->uni_home_dir
, home_dir
, len_home_dir
);
5499 init_unistr2(&usr
->uni_dir_drive
, dir_drive
, len_dir_drive
);
5500 init_unistr2(&usr
->uni_logon_script
, log_scr
, len_logon_script
);
5501 init_unistr2(&usr
->uni_profile_path
, prof_path
, len_profile_path
);
5502 init_unistr2(&usr
->uni_acct_desc
, desc
, len_description
);
5503 init_unistr2(&usr
->uni_workstations
, wkstas
, len_workstations
);
5504 init_unistr2(&usr
->uni_unknown_str
, unk_str
, len_unknown_str
);
5505 init_unistr2(&usr
->uni_munged_dial
, mung_dial
, len_munged_dial
);
5507 usr
->unknown_6
= unknown_6
; /* 0x0000 04ec */
5510 memcpy(&usr
->logon_hrs
, hrs
, sizeof(usr
->logon_hrs
));
5513 /*******************************************************************
5514 reads or writes a structure.
5515 ********************************************************************/
5517 static BOOL
sam_io_user_info21(char *desc
, SAM_USER_INFO_21
* usr
,
5518 prs_struct
*ps
, int depth
)
5523 prs_debug(ps
, depth
, desc
, "sam_io_user_info21");
5529 if(!smb_io_time("logon_time ", &usr
->logon_time
, ps
, depth
))
5531 if(!smb_io_time("logoff_time ", &usr
->logoff_time
, ps
, depth
))
5533 if(!smb_io_time("pass_last_set_time ", &usr
->pass_last_set_time
, ps
,depth
))
5535 if(!smb_io_time("kickoff_time ", &usr
->kickoff_time
, ps
, depth
))
5537 if(!smb_io_time("pass_can_change_time ", &usr
->pass_can_change_time
, ps
,depth
))
5539 if(!smb_io_time("pass_must_change_time", &usr
->pass_must_change_time
, ps
, depth
))
5542 if(!smb_io_unihdr("hdr_user_name ", &usr
->hdr_user_name
, ps
, depth
)) /* username unicode string header */
5544 if(!smb_io_unihdr("hdr_full_name ", &usr
->hdr_full_name
, ps
, depth
)) /* user's full name unicode string header */
5546 if(!smb_io_unihdr("hdr_home_dir ", &usr
->hdr_home_dir
, ps
, depth
)) /* home directory unicode string header */
5548 if(!smb_io_unihdr("hdr_dir_drive ", &usr
->hdr_dir_drive
, ps
, depth
)) /* home directory drive */
5550 if(!smb_io_unihdr("hdr_logon_script", &usr
->hdr_logon_script
, ps
, depth
)) /* logon script unicode string header */
5552 if(!smb_io_unihdr("hdr_profile_path", &usr
->hdr_profile_path
, ps
, depth
)) /* profile path unicode string header */
5554 if(!smb_io_unihdr("hdr_acct_desc ", &usr
->hdr_acct_desc
, ps
, depth
)) /* account desc */
5556 if(!smb_io_unihdr("hdr_workstations", &usr
->hdr_workstations
, ps
, depth
)) /* wkstas user can log on from */
5558 if(!smb_io_unihdr("hdr_unknown_str ", &usr
->hdr_unknown_str
, ps
, depth
)) /* unknown string */
5560 if(!smb_io_unihdr("hdr_munged_dial ", &usr
->hdr_munged_dial
, ps
, depth
)) /* wkstas user can log on from */
5563 if(!prs_uint8s(False
, "lm_pwd ", ps
, depth
, usr
->lm_pwd
, sizeof(usr
->lm_pwd
)))
5565 if(!prs_uint8s(False
, "nt_pwd ", ps
, depth
, usr
->nt_pwd
, sizeof(usr
->nt_pwd
)))
5568 if(!prs_uint32("user_rid ", ps
, depth
, &usr
->user_rid
)) /* User ID */
5570 if(!prs_uint32("group_rid ", ps
, depth
, &usr
->group_rid
)) /* Group ID */
5572 if(!prs_uint32("acb_info ", ps
, depth
, &usr
->acb_info
))
5575 if(!prs_uint32("unknown_3 ", ps
, depth
, &usr
->unknown_3
))
5577 if(!prs_uint16("logon_divs ", ps
, depth
, &usr
->logon_divs
)) /* logon divisions per week */
5581 if(!prs_uint32("ptr_logon_hrs ", ps
, depth
, &usr
->ptr_logon_hrs
))
5583 if(!prs_uint32("unknown_5 ", ps
, depth
, &usr
->unknown_5
))
5586 if(!prs_uint8s(False
, "padding1 ", ps
, depth
, usr
->padding1
, sizeof(usr
->padding1
)))
5589 /* here begins pointed-to data */
5591 if(!smb_io_unistr2("uni_user_name ", &usr
->uni_user_name
,usr
->hdr_user_name
.buffer
, ps
, depth
)) /* username unicode string */
5593 if(!smb_io_unistr2("uni_full_name ", &usr
->uni_full_name
, usr
->hdr_full_name
.buffer
, ps
, depth
)) /* user's full name unicode string */
5595 if(!smb_io_unistr2("uni_home_dir ", &usr
->uni_home_dir
, usr
->hdr_home_dir
.buffer
, ps
, depth
)) /* home directory unicode string */
5597 if(!smb_io_unistr2("uni_dir_drive ", &usr
->uni_dir_drive
, usr
->hdr_dir_drive
.buffer
, ps
, depth
)) /* home directory drive unicode string */
5599 if(!smb_io_unistr2("uni_logon_script", &usr
->uni_logon_script
, usr
->hdr_logon_script
.buffer
, ps
, depth
)) /* logon script unicode string */
5601 if(!smb_io_unistr2("uni_profile_path", &usr
->uni_profile_path
, usr
->hdr_profile_path
.buffer
, ps
, depth
)) /* profile path unicode string */
5603 if(!smb_io_unistr2("uni_acct_desc ", &usr
->uni_acct_desc
, usr
->hdr_acct_desc
.buffer
, ps
, depth
)) /* user desc unicode string */
5605 if(!smb_io_unistr2("uni_workstations", &usr
->uni_workstations
, usr
->hdr_workstations
.buffer
, ps
, depth
)) /* worksations user can log on from */
5607 if(!smb_io_unistr2("uni_unknown_str ", &usr
->uni_unknown_str
, usr
->hdr_unknown_str
.buffer
, ps
, depth
)) /* unknown string */
5609 if(!smb_io_unistr2("uni_munged_dial ", &usr
->uni_munged_dial
,usr
->hdr_munged_dial
.buffer
, ps
, depth
)) /* worksations user can log on from */
5612 /* ok, this is only guess-work (as usual) */
5613 if (usr
->ptr_logon_hrs
) {
5616 if(!prs_uint32("unknown_6 ", ps
, depth
, &usr
->unknown_6
))
5618 if(!prs_uint32("padding4 ", ps
, depth
, &usr
->padding4
))
5620 if(!sam_io_logon_hrs("logon_hrs", &usr
->logon_hrs
, ps
, depth
))
5622 } else if (UNMARSHALLING(ps
)) {
5630 /*******************************************************************
5631 inits a SAM_USERINFO_CTR structure.
5632 ********************************************************************/
5634 uint32
make_samr_userinfo_ctr_usr21(TALLOC_CTX
*ctx
, SAM_USERINFO_CTR
* ctr
,
5635 uint16 switch_value
,
5636 SAM_USER_INFO_21
* usr
)
5638 DEBUG(5, ("init_samr_userinfo_ctr\n"));
5640 ctr
->switch_value
= switch_value
;
5641 ctr
->info
.id
= NULL
;
5643 switch (switch_value
) {
5645 ctr
->info
.id10
= (SAM_USER_INFO_10
*)talloc(ctx
,sizeof(SAM_USER_INFO_10
));
5646 if (ctr
->info
.id10
== NULL
)
5647 return NT_STATUS_NO_MEMORY
;
5649 init_sam_user_info10(ctr
->info
.id10
, usr
->acb_info
);
5652 /* whoops - got this wrong. i think. or don't understand what's happening. */
5656 info
= (void *)&id11
;
5658 expire
.low
= 0xffffffff;
5659 expire
.high
= 0x7fffffff;
5661 ctr
->info
.id
= (SAM_USER_INFO_11
*) talloc(ctx
,sizeof(*ctr
->info
.id11
));
5662 init_sam_user_info11(ctr
->info
.id11
, &expire
,
5663 "BROOKFIELDS$", /* name */
5664 0x03ef, /* user rid */
5665 0x201, /* group rid */
5666 0x0080); /* acb info */
5672 ctr
->info
.id12
= (SAM_USER_INFO_12
*)talloc(ctx
,sizeof(SAM_USER_INFO_12
));
5673 if (ctr
->info
.id12
== NULL
)
5674 return NT_STATUS_NO_MEMORY
;
5676 init_sam_user_info12(ctr
->info
.id12
, usr
->lm_pwd
, usr
->nt_pwd
);
5680 SAM_USER_INFO_21
*cusr
;
5681 cusr
= (SAM_USER_INFO_21
*)talloc(ctx
,sizeof(SAM_USER_INFO_21
));
5682 ctr
->info
.id21
= cusr
;
5683 if (ctr
->info
.id21
== NULL
)
5684 return NT_STATUS_NO_MEMORY
;
5685 memcpy(cusr
, usr
, sizeof(*usr
));
5686 memset(cusr
->lm_pwd
, 0, sizeof(cusr
->lm_pwd
));
5687 memset(cusr
->nt_pwd
, 0, sizeof(cusr
->nt_pwd
));
5691 DEBUG(4,("make_samr_userinfo_ctr: unsupported info\n"));
5692 return NT_STATUS_INVALID_INFO_CLASS
;
5695 return NT_STATUS_NOPROBLEMO
;
5698 /*******************************************************************
5699 inits a SAM_USERINFO_CTR structure.
5700 ********************************************************************/
5702 void init_samr_userinfo_ctr(SAM_USERINFO_CTR
* ctr
, uchar
* sess_key
,
5703 uint16 switch_value
, void *info
)
5705 DEBUG(5, ("init_samr_userinfo_ctr\n"));
5707 ctr
->switch_value
= switch_value
;
5708 ctr
->info
.id
= info
;
5710 switch (switch_value
) {
5712 SamOEMhash(ctr
->info
.id24
->pass
, sess_key
, 1);
5713 dump_data(100, sess_key
, 16);
5714 dump_data(100, ctr
->info
.id24
->pass
, 516);
5717 SamOEMhash(ctr
->info
.id23
->pass
, sess_key
, 1);
5718 dump_data(100, sess_key
, 16);
5719 dump_data(100, ctr
->info
.id23
->pass
, 516);
5722 DEBUG(4,("init_samr_userinfo_ctr: unsupported switch level\n"));
5726 /*******************************************************************
5727 reads or writes a structure.
5728 ********************************************************************/
5730 static BOOL
samr_io_userinfo_ctr(char *desc
, SAM_USERINFO_CTR
**ppctr
,
5731 prs_struct
*ps
, int depth
)
5734 SAM_USERINFO_CTR
*ctr
;
5736 prs_debug(ps
, depth
, desc
, "samr_io_userinfo_ctr");
5739 if (UNMARSHALLING(ps
)) {
5740 ctr
= (SAM_USERINFO_CTR
*)prs_alloc_mem(ps
,sizeof(SAM_USERINFO_CTR
));
5750 /* lkclXXXX DO NOT ALIGN BEFORE READING SWITCH VALUE! */
5752 if(!prs_uint16("switch_value", ps
, depth
, &ctr
->switch_value
))
5759 switch (ctr
->switch_value
) {
5761 if (UNMARSHALLING(ps
))
5762 ctr
->info
.id10
= (SAM_USER_INFO_10
*)prs_alloc_mem(ps
,sizeof(SAM_USER_INFO_10
));
5763 if (ctr
->info
.id10
== NULL
) {
5764 DEBUG(2,("samr_io_userinfo_ctr: info pointer not initialised\n"));
5767 ret
= sam_io_user_info10("", ctr
->info
.id10
, ps
, depth
);
5770 if (UNMARSHALLING(ps
))
5771 ctr
->info
.id11
= (SAM_USER_INFO_11
*)prs_alloc_mem(ps
,sizeof(SAM_USER_INFO_11
));
5773 if (ctr
->info
.id11
== NULL
) {
5774 DEBUG(2,("samr_io_userinfo_ctr: info pointer not initialised\n"));
5777 ret
= sam_io_user_info11("", ctr
->info
.id11
, ps
, depth
);
5780 if (UNMARSHALLING(ps
))
5781 ctr
->info
.id12
= (SAM_USER_INFO_12
*)prs_alloc_mem(ps
,sizeof(SAM_USER_INFO_12
));
5783 if (ctr
->info
.id12
== NULL
) {
5784 DEBUG(2,("samr_io_userinfo_ctr: info pointer not initialised\n"));
5787 ret
= sam_io_user_info12("", ctr
->info
.id12
, ps
, depth
);
5790 if (UNMARSHALLING(ps
))
5791 ctr
->info
.id21
= (SAM_USER_INFO_21
*)prs_alloc_mem(ps
,sizeof(SAM_USER_INFO_21
));
5793 if (ctr
->info
.id21
== NULL
) {
5794 DEBUG(2,("samr_io_userinfo_ctr: info pointer not initialised\n"));
5797 ret
= sam_io_user_info21("", ctr
->info
.id21
, ps
, depth
);
5800 if (UNMARSHALLING(ps
))
5801 ctr
->info
.id23
= (SAM_USER_INFO_23
*)prs_alloc_mem(ps
,sizeof(SAM_USER_INFO_23
));
5803 if (ctr
->info
.id23
== NULL
) {
5804 DEBUG(2,("samr_io_userinfo_ctr: info pointer not initialised\n"));
5807 ret
= sam_io_user_info23("", ctr
->info
.id23
, ps
, depth
);
5810 if (UNMARSHALLING(ps
))
5811 ctr
->info
.id24
= (SAM_USER_INFO_24
*)prs_alloc_mem(ps
,sizeof(SAM_USER_INFO_24
));
5813 if (ctr
->info
.id24
== NULL
) {
5814 DEBUG(2,("samr_io_userinfo_ctr: info pointer not initialised\n"));
5817 ret
= sam_io_user_info24("", ctr
->info
.id24
, ps
, depth
);
5820 DEBUG(2, ("samr_io_userinfo_ctr: unknown switch level 0x%x\n", ctr
->switch_value
));
5828 /*******************************************************************
5829 inits a SAMR_R_QUERY_USERINFO structure.
5830 ********************************************************************/
5832 void init_samr_r_query_userinfo(SAMR_R_QUERY_USERINFO
* r_u
,
5833 SAM_USERINFO_CTR
* ctr
, uint32 status
)
5835 DEBUG(5, ("init_samr_r_query_userinfo\n"));
5845 r_u
->status
= status
; /* return status */
5848 /*******************************************************************
5849 reads or writes a structure.
5850 ********************************************************************/
5852 BOOL
samr_io_r_query_userinfo(char *desc
, SAMR_R_QUERY_USERINFO
* r_u
,
5853 prs_struct
*ps
, int depth
)
5858 prs_debug(ps
, depth
, desc
, "samr_io_r_query_userinfo");
5864 if(!prs_uint32("ptr", ps
, depth
, &r_u
->ptr
))
5867 if (r_u
->ptr
!= 0) {
5868 if(!samr_io_userinfo_ctr("ctr", &r_u
->ctr
, ps
, depth
))
5874 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
5880 /*******************************************************************
5881 inits a SAMR_Q_SET_USERINFO structure.
5882 ********************************************************************/
5884 void init_samr_q_set_userinfo(SAMR_Q_SET_USERINFO
* q_u
,
5885 POLICY_HND
*hnd
, unsigned char sess_key
[16],
5886 uint16 switch_value
, void *info
)
5888 DEBUG(5, ("init_samr_q_set_userinfo\n"));
5891 q_u
->switch_value
= switch_value
;
5892 init_samr_userinfo_ctr(q_u
->ctr
, sess_key
, switch_value
, info
);
5895 /*******************************************************************
5896 reads or writes a structure.
5897 ********************************************************************/
5899 BOOL
samr_io_q_set_userinfo(char *desc
, SAMR_Q_SET_USERINFO
* q_u
,
5900 prs_struct
*ps
, int depth
)
5905 prs_debug(ps
, depth
, desc
, "samr_io_q_set_userinfo");
5911 smb_io_pol_hnd("pol", &(q_u
->pol
), ps
, depth
);
5913 if(!prs_uint16("switch_value", ps
, depth
, &q_u
->switch_value
))
5915 if(!samr_io_userinfo_ctr("ctr", &q_u
->ctr
, ps
, depth
))
5921 /*******************************************************************
5922 inits a SAMR_R_SET_USERINFO structure.
5923 ********************************************************************/
5925 void init_samr_r_set_userinfo(SAMR_R_SET_USERINFO
* r_u
, uint32 status
)
5927 DEBUG(5, ("init_samr_r_set_userinfo\n"));
5929 r_u
->status
= status
; /* return status */
5932 /*******************************************************************
5933 reads or writes a structure.
5934 ********************************************************************/
5936 BOOL
samr_io_r_set_userinfo(char *desc
, SAMR_R_SET_USERINFO
* r_u
,
5937 prs_struct
*ps
, int depth
)
5942 prs_debug(ps
, depth
, desc
, "samr_io_r_set_userinfo");
5948 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
5954 /*******************************************************************
5955 inits a SAMR_Q_SET_USERINFO2 structure.
5956 ********************************************************************/
5958 void init_samr_q_set_userinfo2(SAMR_Q_SET_USERINFO2
* q_u
,
5959 POLICY_HND
*hnd
, unsigned char sess_key
[16],
5960 uint16 switch_value
, SAM_USERINFO_CTR
* ctr
)
5962 DEBUG(5, ("init_samr_q_set_userinfo2\n"));
5965 q_u
->switch_value
= switch_value
;
5968 if (q_u
->ctr
!= NULL
)
5969 q_u
->ctr
->switch_value
= switch_value
;
5971 switch (switch_value
) {
5973 SamOEMhash(ctr
->info
.id12
->lm_pwd
, sess_key
, 0);
5974 SamOEMhash(ctr
->info
.id12
->nt_pwd
, sess_key
, 0);
5975 dump_data(100, sess_key
, 16);
5976 dump_data(100, ctr
->info
.id12
->lm_pwd
, 16);
5977 dump_data(100, ctr
->info
.id12
->nt_pwd
, 16);
5982 /*******************************************************************
5983 reads or writes a structure.
5984 ********************************************************************/
5986 BOOL
samr_io_q_set_userinfo2(char *desc
, SAMR_Q_SET_USERINFO2
* q_u
,
5987 prs_struct
*ps
, int depth
)
5992 prs_debug(ps
, depth
, desc
, "samr_io_q_set_userinfo2");
5998 if(!smb_io_pol_hnd("pol", &q_u
->pol
, ps
, depth
))
6001 if(!prs_uint16("switch_value", ps
, depth
, &q_u
->switch_value
))
6003 if(!samr_io_userinfo_ctr("ctr", &q_u
->ctr
, ps
, depth
))
6009 /*******************************************************************
6010 inits a SAMR_R_SET_USERINFO2 structure.
6011 ********************************************************************/
6013 void init_samr_r_set_userinfo2(SAMR_R_SET_USERINFO2
* r_u
, uint32 status
)
6015 DEBUG(5, ("init_samr_r_set_userinfo2\n"));
6017 r_u
->status
= status
; /* return status */
6020 /*******************************************************************
6021 reads or writes a structure.
6022 ********************************************************************/
6024 BOOL
samr_io_r_set_userinfo2(char *desc
, SAMR_R_SET_USERINFO2
* r_u
,
6025 prs_struct
*ps
, int depth
)
6030 prs_debug(ps
, depth
, desc
, "samr_io_r_set_userinfo2");
6036 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
6042 /*******************************************************************
6043 inits a SAMR_Q_CONNECT structure.
6044 ********************************************************************/
6046 void init_samr_q_connect(SAMR_Q_CONNECT
* q_u
,
6047 char *srv_name
, uint32 access_mask
)
6049 int len_srv_name
= strlen(srv_name
);
6051 DEBUG(5, ("init_samr_q_connect\n"));
6053 /* make PDC server name \\server */
6054 q_u
->ptr_srv_name
= len_srv_name
> 0 ? 1 : 0;
6055 init_unistr2(&q_u
->uni_srv_name
, srv_name
, len_srv_name
+ 1);
6057 /* example values: 0x0000 0002 */
6058 q_u
->access_mask
= access_mask
;
6061 /*******************************************************************
6062 reads or writes a structure.
6063 ********************************************************************/
6065 BOOL
samr_io_q_connect(char *desc
, SAMR_Q_CONNECT
* q_u
,
6066 prs_struct
*ps
, int depth
)
6071 prs_debug(ps
, depth
, desc
, "samr_io_q_connect");
6077 if(!prs_uint32("ptr_srv_name", ps
, depth
, &q_u
->ptr_srv_name
))
6079 if(!smb_io_unistr2("", &q_u
->uni_srv_name
, q_u
->ptr_srv_name
, ps
, depth
))
6084 if(!prs_uint32("access_mask", ps
, depth
, &q_u
->access_mask
))
6090 /*******************************************************************
6091 reads or writes a structure.
6092 ********************************************************************/
6094 BOOL
samr_io_r_connect(char *desc
, SAMR_R_CONNECT
* r_u
,
6095 prs_struct
*ps
, int depth
)
6100 prs_debug(ps
, depth
, desc
, "samr_io_r_connect");
6106 if(!smb_io_pol_hnd("connect_pol", &r_u
->connect_pol
, ps
, depth
))
6109 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
6115 /*******************************************************************
6116 inits a SAMR_Q_CONNECT_ANON structure.
6117 ********************************************************************/
6119 void init_samr_q_connect_anon(SAMR_Q_CONNECT_ANON
* q_u
)
6121 DEBUG(5, ("init_samr_q_connect_anon\n"));
6124 q_u
->unknown_0
= 0x5c; /* server name (?!!) */
6125 q_u
->unknown_1
= 0x01;
6126 q_u
->access_mask
= 0x20;
6129 /*******************************************************************
6130 reads or writes a structure.
6131 ********************************************************************/
6133 BOOL
samr_io_q_connect_anon(char *desc
, SAMR_Q_CONNECT_ANON
* q_u
,
6134 prs_struct
*ps
, int depth
)
6139 prs_debug(ps
, depth
, desc
, "samr_io_q_connect_anon");
6145 if(!prs_uint32("ptr ", ps
, depth
, &q_u
->ptr
))
6147 if(!prs_uint16("unknown_0", ps
, depth
, &q_u
->unknown_0
))
6149 if(!prs_uint16("unknown_1", ps
, depth
, &q_u
->unknown_1
))
6151 if(!prs_uint32("access_mask", ps
, depth
, &q_u
->access_mask
))
6157 /*******************************************************************
6158 reads or writes a structure.
6159 ********************************************************************/
6161 BOOL
samr_io_r_connect_anon(char *desc
, SAMR_R_CONNECT_ANON
* r_u
,
6162 prs_struct
*ps
, int depth
)
6167 prs_debug(ps
, depth
, desc
, "samr_io_r_connect_anon");
6173 if(!smb_io_pol_hnd("connect_pol", &r_u
->connect_pol
, ps
, depth
))
6176 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
6182 /*******************************************************************
6183 inits a SAMR_Q_GET_DOM_PWINFO structure.
6184 ********************************************************************/
6186 void init_samr_q_get_dom_pwinfo(SAMR_Q_GET_DOM_PWINFO
* q_u
,
6189 int len_srv_name
= strlen(srv_name
);
6191 DEBUG(5, ("init_samr_q_get_dom_pwinfo\n"));
6194 init_uni_hdr(&q_u
->hdr_srv_name
, len_srv_name
);
6195 init_unistr2(&q_u
->uni_srv_name
, srv_name
, len_srv_name
);
6198 /*******************************************************************
6199 reads or writes a structure.
6200 ********************************************************************/
6202 BOOL
samr_io_q_get_dom_pwinfo(char *desc
, SAMR_Q_GET_DOM_PWINFO
* q_u
,
6203 prs_struct
*ps
, int depth
)
6208 prs_debug(ps
, depth
, desc
, "samr_io_q_get_dom_pwinfo");
6214 if(!prs_uint32("ptr", ps
, depth
, &q_u
->ptr
))
6216 if (q_u
->ptr
!= 0) {
6217 if(!smb_io_unihdr("", &q_u
->hdr_srv_name
, ps
, depth
))
6219 if(!smb_io_unistr2("", &q_u
->uni_srv_name
, q_u
->hdr_srv_name
.buffer
, ps
, depth
))
6226 /*******************************************************************
6227 reads or writes a structure.
6228 ********************************************************************/
6230 BOOL
samr_io_r_get_dom_pwinfo(char *desc
, SAMR_R_GET_DOM_PWINFO
* r_u
,
6231 prs_struct
*ps
, int depth
)
6236 prs_debug(ps
, depth
, desc
, "samr_io_r_get_dom_pwinfo");
6242 if(!prs_uint16("unk_0", ps
, depth
, &r_u
->unk_0
))
6246 if(!prs_uint16("unk_1", ps
, depth
, &r_u
->unk_1
))
6251 if(!prs_uint16("unk_2", ps
, depth
, &r_u
->unk_2
))
6256 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))
6262 /*******************************************************************
6263 make a SAMR_ENC_PASSWD structure.
6264 ********************************************************************/
6266 void init_enc_passwd(SAMR_ENC_PASSWD
* pwd
, char pass
[512])
6274 memcpy(pwd
->pass
, pass
, sizeof(pwd
->pass
));
6278 /*******************************************************************
6279 reads or writes a SAMR_ENC_PASSWD structure.
6280 ********************************************************************/
6282 BOOL
samr_io_enc_passwd(char *desc
, SAMR_ENC_PASSWD
* pwd
,
6283 prs_struct
*ps
, int depth
)
6288 prs_debug(ps
, depth
, desc
, "samr_io_enc_passwd");
6294 if(!prs_uint32("ptr", ps
, depth
, &pwd
->ptr
))
6297 if (pwd
->ptr
!= 0) {
6298 if(!prs_uint8s(False
, "pwd", ps
, depth
, pwd
->pass
, sizeof(pwd
->pass
)))
6305 /*******************************************************************
6306 inits a SAMR_ENC_HASH structure.
6307 ********************************************************************/
6309 void init_enc_hash(SAMR_ENC_HASH
* hsh
, uchar hash
[16])
6317 memcpy(hsh
->hash
, hash
, sizeof(hsh
->hash
));
6321 /*******************************************************************
6322 reads or writes a SAMR_ENC_HASH structure.
6323 ********************************************************************/
6325 BOOL
samr_io_enc_hash(char *desc
, SAMR_ENC_HASH
* hsh
,
6326 prs_struct
*ps
, int depth
)
6331 prs_debug(ps
, depth
, desc
, "samr_io_enc_hash");
6337 if(!prs_uint32("ptr ", ps
, depth
, &hsh
->ptr
))
6339 if (hsh
->ptr
!= 0) {
6340 if(!prs_uint8s(False
, "hash", ps
, depth
, hsh
->hash
,sizeof(hsh
->hash
)))
6347 /*******************************************************************
6348 inits a SAMR_R_GET_DOM_PWINFO structure.
6349 ********************************************************************/
6351 void init_samr_q_chgpasswd_user(SAMR_Q_CHGPASSWD_USER
* q_u
,
6352 char *dest_host
, char *user_name
,
6353 char nt_newpass
[516],
6354 uchar nt_oldhash
[16],
6355 char lm_newpass
[516],
6356 uchar lm_oldhash
[16])
6358 int len_dest_host
= strlen(dest_host
);
6359 int len_user_name
= strlen(user_name
);
6361 DEBUG(5, ("init_samr_q_chgpasswd_user\n"));
6364 init_uni_hdr(&q_u
->hdr_dest_host
, len_dest_host
);
6365 init_unistr2(&q_u
->uni_dest_host
, dest_host
, len_dest_host
);
6366 init_uni_hdr(&q_u
->hdr_user_name
, len_user_name
);
6367 init_unistr2(&q_u
->uni_user_name
, user_name
, len_user_name
);
6369 init_enc_passwd(&q_u
->nt_newpass
, nt_newpass
);
6370 init_enc_hash(&q_u
->nt_oldhash
, nt_oldhash
);
6372 q_u
->unknown
= 0x01;
6374 init_enc_passwd(&q_u
->lm_newpass
, lm_newpass
);
6375 init_enc_hash(&q_u
->lm_oldhash
, lm_oldhash
);
6378 /*******************************************************************
6379 reads or writes a structure.
6380 ********************************************************************/
6382 BOOL
samr_io_q_chgpasswd_user(char *desc
, SAMR_Q_CHGPASSWD_USER
* q_u
,
6383 prs_struct
*ps
, int depth
)
6388 prs_debug(ps
, depth
, desc
, "samr_io_q_chgpasswd_user");
6394 if(!prs_uint32("ptr_0", ps
, depth
, &q_u
->ptr_0
))
6397 if(!smb_io_unihdr("", &q_u
->hdr_dest_host
, ps
, depth
))
6399 if(!smb_io_unistr2("", &q_u
->uni_dest_host
, q_u
->hdr_dest_host
.buffer
, ps
, depth
))
6404 if(!smb_io_unihdr("", &q_u
->hdr_user_name
, ps
, depth
))
6406 if(!smb_io_unistr2("", &q_u
->uni_user_name
, q_u
->hdr_user_name
.buffer
,ps
, depth
))
6409 if(!samr_io_enc_passwd("nt_newpass", &q_u
->nt_newpass
, ps
, depth
))
6411 if(!samr_io_enc_hash("nt_oldhash", &q_u
->nt_oldhash
, ps
, depth
))
6414 if(!prs_uint32("unknown", ps
, depth
, &q_u
->unknown
))
6417 if(!samr_io_enc_passwd("lm_newpass", &q_u
->lm_newpass
, ps
, depth
))
6419 if(!samr_io_enc_hash("lm_oldhash", &q_u
->lm_oldhash
, ps
, depth
))
6425 /*******************************************************************
6426 inits a SAMR_R_CHGPASSWD_USER structure.
6427 ********************************************************************/
6429 void init_samr_r_chgpasswd_user(SAMR_R_CHGPASSWD_USER
* r_u
, uint32 status
)
6431 DEBUG(5, ("init_r_chgpasswd_user\n"));
6433 r_u
->status
= status
;
6436 /*******************************************************************
6437 reads or writes a structure.
6438 ********************************************************************/
6440 BOOL
samr_io_r_chgpasswd_user(char *desc
, SAMR_R_CHGPASSWD_USER
* r_u
,
6441 prs_struct
*ps
, int depth
)
6446 prs_debug(ps
, depth
, desc
, "samr_io_r_chgpasswd_user");
6452 if(!prs_uint32("status", ps
, depth
, &r_u
->status
))