2 * Unix SMB/CIFS implementation.
3 * RPC Pipe client / server routines
4 * Copyright (C) Andrew Tridgell 1992-1997,
5 * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
6 * Copyright (C) Paul Ashton 1997,
7 * Copyright (C) Marc Jacobsen 1999,
8 * Copyright (C) Jean François Micouleau 1998-2001,
9 * Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002-2003.
11 * Split into interface and implementation modules by,
13 * Copyright (C) Jeremy Allison 2001.
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 * This is the interface to the SAMR code.
37 #define DBGC_CLASS DBGC_RPC_SRV
39 /*******************************************************************
41 ********************************************************************/
43 static BOOL
api_samr_close_hnd(pipes_struct
*p
)
47 prs_struct
*data
= &p
->in_data
.data
;
48 prs_struct
*rdata
= &p
->out_data
.rdata
;
53 if(!samr_io_q_close_hnd("", &q_u
, data
, 0)) {
54 DEBUG(0,("api_samr_close_hnd: unable to unmarshall SAMR_Q_CLOSE_HND.\n"));
58 r_u
.status
= _samr_close_hnd(p
, &q_u
, &r_u
);
60 /* store the response in the SMB stream */
61 if(!samr_io_r_close_hnd("", &r_u
, rdata
, 0)) {
62 DEBUG(0,("api_samr_close_hnd: unable to marshall SAMR_R_CLOSE_HND.\n"));
69 /*******************************************************************
71 ********************************************************************/
73 static BOOL
api_samr_open_domain(pipes_struct
*p
)
75 SAMR_Q_OPEN_DOMAIN q_u
;
76 SAMR_R_OPEN_DOMAIN r_u
;
78 prs_struct
*data
= &p
->in_data
.data
;
79 prs_struct
*rdata
= &p
->out_data
.rdata
;
84 if(!samr_io_q_open_domain("", &q_u
, data
, 0)) {
85 DEBUG(0,("api_samr_open_domain: unable to unmarshall SAMR_Q_OPEN_DOMAIN.\n"));
89 r_u
.status
= _samr_open_domain(p
, &q_u
, &r_u
);
91 /* store the response in the SMB stream */
92 if(!samr_io_r_open_domain("", &r_u
, rdata
, 0)) {
93 DEBUG(0,("api_samr_open_domain: unable to marshall SAMR_R_OPEN_DOMAIN.\n"));
100 /*******************************************************************
101 api_samr_get_usrdom_pwinfo
102 ********************************************************************/
104 static BOOL
api_samr_get_usrdom_pwinfo(pipes_struct
*p
)
106 SAMR_Q_GET_USRDOM_PWINFO q_u
;
107 SAMR_R_GET_USRDOM_PWINFO r_u
;
109 prs_struct
*data
= &p
->in_data
.data
;
110 prs_struct
*rdata
= &p
->out_data
.rdata
;
115 if(!samr_io_q_get_usrdom_pwinfo("", &q_u
, data
, 0)) {
116 DEBUG(0,("api_samr_get_usrdom_pwinfo: unable to unmarshall SAMR_Q_GET_USRDOM_PWINFO.\n"));
120 r_u
.status
= _samr_get_usrdom_pwinfo(p
, &q_u
, &r_u
);
122 if(!samr_io_r_get_usrdom_pwinfo("", &r_u
, rdata
, 0)) {
123 DEBUG(0,("api_samr_get_usrdom_pwinfo: unable to marshall SAMR_R_GET_USRDOM_PWINFO.\n"));
130 /*******************************************************************
132 ********************************************************************/
134 static BOOL
api_samr_set_sec_obj(pipes_struct
*p
)
136 SAMR_Q_SET_SEC_OBJ q_u
;
137 SAMR_R_SET_SEC_OBJ r_u
;
139 prs_struct
*data
= &p
->in_data
.data
;
140 prs_struct
*rdata
= &p
->out_data
.rdata
;
145 if(!samr_io_q_set_sec_obj("", &q_u
, data
, 0)) {
146 DEBUG(0,("api_samr_set_sec_obj: unable to unmarshall SAMR_Q_SET_SEC_OBJ.\n"));
150 r_u
.status
= _samr_set_sec_obj(p
, &q_u
, &r_u
);
152 if(!samr_io_r_set_sec_obj("", &r_u
, rdata
, 0)) {
153 DEBUG(0,("api_samr_set_sec_obj: unable to marshall SAMR_R_SET_SEC_OBJ.\n"));
160 /*******************************************************************
161 api_samr_query_sec_obj
162 ********************************************************************/
164 static BOOL
api_samr_query_sec_obj(pipes_struct
*p
)
166 SAMR_Q_QUERY_SEC_OBJ q_u
;
167 SAMR_R_QUERY_SEC_OBJ r_u
;
169 prs_struct
*data
= &p
->in_data
.data
;
170 prs_struct
*rdata
= &p
->out_data
.rdata
;
175 if(!samr_io_q_query_sec_obj("", &q_u
, data
, 0)) {
176 DEBUG(0,("api_samr_query_sec_obj: unable to unmarshall SAMR_Q_QUERY_SEC_OBJ.\n"));
180 r_u
.status
= _samr_query_sec_obj(p
, &q_u
, &r_u
);
182 if(!samr_io_r_query_sec_obj("", &r_u
, rdata
, 0)) {
183 DEBUG(0,("api_samr_query_sec_obj: unable to marshall SAMR_R_QUERY_SEC_OBJ.\n"));
190 /*******************************************************************
191 api_samr_enum_dom_users
192 ********************************************************************/
194 static BOOL
api_samr_enum_dom_users(pipes_struct
*p
)
196 SAMR_Q_ENUM_DOM_USERS q_u
;
197 SAMR_R_ENUM_DOM_USERS r_u
;
198 prs_struct
*data
= &p
->in_data
.data
;
199 prs_struct
*rdata
= &p
->out_data
.rdata
;
204 /* grab the samr open */
205 if(!samr_io_q_enum_dom_users("", &q_u
, data
, 0)) {
206 DEBUG(0,("api_samr_enum_dom_users: unable to unmarshall SAMR_Q_ENUM_DOM_USERS.\n"));
210 r_u
.status
= _samr_enum_dom_users(p
, &q_u
, &r_u
);
212 /* store the response in the SMB stream */
213 if(!samr_io_r_enum_dom_users("", &r_u
, rdata
, 0)) {
214 DEBUG(0,("api_samr_enum_dom_users: unable to marshall SAMR_R_ENUM_DOM_USERS.\n"));
221 /*******************************************************************
222 api_samr_enum_dom_groups
223 ********************************************************************/
225 static BOOL
api_samr_enum_dom_groups(pipes_struct
*p
)
227 SAMR_Q_ENUM_DOM_GROUPS q_u
;
228 SAMR_R_ENUM_DOM_GROUPS r_u
;
229 prs_struct
*data
= &p
->in_data
.data
;
230 prs_struct
*rdata
= &p
->out_data
.rdata
;
235 /* grab the samr open */
236 if(!samr_io_q_enum_dom_groups("", &q_u
, data
, 0)) {
237 DEBUG(0,("api_samr_enum_dom_groups: unable to unmarshall SAMR_Q_ENUM_DOM_GROUPS.\n"));
241 r_u
.status
= _samr_enum_dom_groups(p
, &q_u
, &r_u
);
243 /* store the response in the SMB stream */
244 if(!samr_io_r_enum_dom_groups("", &r_u
, rdata
, 0)) {
245 DEBUG(0,("api_samr_enum_dom_groups: unable to marshall SAMR_R_ENUM_DOM_GROUPS.\n"));
252 /*******************************************************************
253 api_samr_enum_dom_aliases
254 ********************************************************************/
256 static BOOL
api_samr_enum_dom_aliases(pipes_struct
*p
)
258 SAMR_Q_ENUM_DOM_ALIASES q_u
;
259 SAMR_R_ENUM_DOM_ALIASES r_u
;
260 prs_struct
*data
= &p
->in_data
.data
;
261 prs_struct
*rdata
= &p
->out_data
.rdata
;
266 /* grab the samr open */
267 if(!samr_io_q_enum_dom_aliases("", &q_u
, data
, 0)) {
268 DEBUG(0,("api_samr_enum_dom_aliases: unable to unmarshall SAMR_Q_ENUM_DOM_ALIASES.\n"));
272 r_u
.status
= _samr_enum_dom_aliases(p
, &q_u
, &r_u
);
274 /* store the response in the SMB stream */
275 if(!samr_io_r_enum_dom_aliases("", &r_u
, rdata
, 0)) {
276 DEBUG(0,("api_samr_enum_dom_aliases: unable to marshall SAMR_R_ENUM_DOM_ALIASES.\n"));
283 /*******************************************************************
284 api_samr_query_dispinfo
285 ********************************************************************/
287 static BOOL
api_samr_query_dispinfo(pipes_struct
*p
)
289 SAMR_Q_QUERY_DISPINFO q_u
;
290 SAMR_R_QUERY_DISPINFO r_u
;
291 prs_struct
*data
= &p
->in_data
.data
;
292 prs_struct
*rdata
= &p
->out_data
.rdata
;
297 if(!samr_io_q_query_dispinfo("", &q_u
, data
, 0)) {
298 DEBUG(0,("api_samr_query_dispinfo: unable to unmarshall SAMR_Q_QUERY_DISPINFO.\n"));
302 r_u
.status
= _samr_query_dispinfo(p
, &q_u
, &r_u
);
304 /* store the response in the SMB stream */
305 if(!samr_io_r_query_dispinfo("", &r_u
, rdata
, 0)) {
306 DEBUG(0,("api_samr_query_dispinfo: unable to marshall SAMR_R_QUERY_DISPINFO.\n"));
313 /*******************************************************************
314 api_samr_query_aliasinfo
315 ********************************************************************/
317 static BOOL
api_samr_query_aliasinfo(pipes_struct
*p
)
319 SAMR_Q_QUERY_ALIASINFO q_u
;
320 SAMR_R_QUERY_ALIASINFO r_u
;
321 prs_struct
*data
= &p
->in_data
.data
;
322 prs_struct
*rdata
= &p
->out_data
.rdata
;
327 /* grab the samr open */
328 if(!samr_io_q_query_aliasinfo("", &q_u
, data
, 0)) {
329 DEBUG(0,("api_samr_query_aliasinfo: unable to unmarshall SAMR_Q_QUERY_ALIASINFO.\n"));
333 r_u
.status
= _samr_query_aliasinfo(p
, &q_u
, &r_u
);
335 /* store the response in the SMB stream */
336 if(!samr_io_r_query_aliasinfo("", &r_u
, rdata
, 0)) {
337 DEBUG(0,("api_samr_query_aliasinfo: unable to marshall SAMR_R_QUERY_ALIASINFO.\n"));
344 /*******************************************************************
345 api_samr_lookup_names
346 ********************************************************************/
348 static BOOL
api_samr_lookup_names(pipes_struct
*p
)
350 SAMR_Q_LOOKUP_NAMES q_u
;
351 SAMR_R_LOOKUP_NAMES r_u
;
352 prs_struct
*data
= &p
->in_data
.data
;
353 prs_struct
*rdata
= &p
->out_data
.rdata
;
358 /* grab the samr lookup names */
359 if(!samr_io_q_lookup_names("", &q_u
, data
, 0)) {
360 DEBUG(0,("api_samr_lookup_names: unable to unmarshall SAMR_Q_LOOKUP_NAMES.\n"));
364 r_u
.status
= _samr_lookup_names(p
, &q_u
, &r_u
);
366 /* store the response in the SMB stream */
367 if(!samr_io_r_lookup_names("", &r_u
, rdata
, 0)) {
368 DEBUG(0,("api_samr_lookup_names: unable to marshall SAMR_R_LOOKUP_NAMES.\n"));
375 /*******************************************************************
376 api_samr_chgpasswd_user
377 ********************************************************************/
379 static BOOL
api_samr_chgpasswd_user(pipes_struct
*p
)
381 SAMR_Q_CHGPASSWD_USER q_u
;
382 SAMR_R_CHGPASSWD_USER r_u
;
383 prs_struct
*data
= &p
->in_data
.data
;
384 prs_struct
*rdata
= &p
->out_data
.rdata
;
389 /* change password request */
390 if (!samr_io_q_chgpasswd_user("", &q_u
, data
, 0)) {
391 DEBUG(0,("api_samr_chgpasswd_user: Failed to unmarshall SAMR_Q_CHGPASSWD_USER.\n"));
395 r_u
.status
= _samr_chgpasswd_user(p
, &q_u
, &r_u
);
397 /* store the response in the SMB stream */
398 if(!samr_io_r_chgpasswd_user("", &r_u
, rdata
, 0)) {
399 DEBUG(0,("api_samr_chgpasswd_user: Failed to marshall SAMR_R_CHGPASSWD_USER.\n" ));
406 /*******************************************************************
408 ********************************************************************/
410 static BOOL
api_samr_lookup_rids(pipes_struct
*p
)
412 SAMR_Q_LOOKUP_RIDS q_u
;
413 SAMR_R_LOOKUP_RIDS r_u
;
414 prs_struct
*data
= &p
->in_data
.data
;
415 prs_struct
*rdata
= &p
->out_data
.rdata
;
420 /* grab the samr lookup names */
421 if(!samr_io_q_lookup_rids("", &q_u
, data
, 0)) {
422 DEBUG(0,("api_samr_lookup_rids: unable to unmarshall SAMR_Q_LOOKUP_RIDS.\n"));
426 r_u
.status
= _samr_lookup_rids(p
, &q_u
, &r_u
);
428 /* store the response in the SMB stream */
429 if(!samr_io_r_lookup_rids("", &r_u
, rdata
, 0)) {
430 DEBUG(0,("api_samr_lookup_rids: unable to marshall SAMR_R_LOOKUP_RIDS.\n"));
437 /*******************************************************************
439 ********************************************************************/
441 static BOOL
api_samr_open_user(pipes_struct
*p
)
443 SAMR_Q_OPEN_USER q_u
;
444 SAMR_R_OPEN_USER r_u
;
445 prs_struct
*data
= &p
->in_data
.data
;
446 prs_struct
*rdata
= &p
->out_data
.rdata
;
451 if(!samr_io_q_open_user("", &q_u
, data
, 0)) {
452 DEBUG(0,("api_samr_open_user: unable to unmarshall SAMR_Q_OPEN_USER.\n"));
456 r_u
.status
= _samr_open_user(p
, &q_u
, &r_u
);
458 /* store the response in the SMB stream */
459 if(!samr_io_r_open_user("", &r_u
, rdata
, 0)) {
460 DEBUG(0,("api_samr_open_user: unable to marshall SAMR_R_OPEN_USER.\n"));
467 /*******************************************************************
468 api_samr_query_userinfo
469 ********************************************************************/
471 static BOOL
api_samr_query_userinfo(pipes_struct
*p
)
473 SAMR_Q_QUERY_USERINFO q_u
;
474 SAMR_R_QUERY_USERINFO r_u
;
475 prs_struct
*data
= &p
->in_data
.data
;
476 prs_struct
*rdata
= &p
->out_data
.rdata
;
481 if(!samr_io_q_query_userinfo("", &q_u
, data
, 0)){
482 DEBUG(0,("api_samr_query_userinfo: unable to unmarshall SAMR_Q_QUERY_USERINFO.\n"));
486 r_u
.status
= _samr_query_userinfo(p
, &q_u
, &r_u
);
488 /* store the response in the SMB stream */
489 if(!samr_io_r_query_userinfo("", &r_u
, rdata
, 0)) {
490 DEBUG(0,("api_samr_query_userinfo: unable to marshall SAMR_R_QUERY_USERINFO.\n"));
497 /*******************************************************************
498 api_samr_query_usergroups
499 ********************************************************************/
501 static BOOL
api_samr_query_usergroups(pipes_struct
*p
)
503 SAMR_Q_QUERY_USERGROUPS q_u
;
504 SAMR_R_QUERY_USERGROUPS r_u
;
505 prs_struct
*data
= &p
->in_data
.data
;
506 prs_struct
*rdata
= &p
->out_data
.rdata
;
511 if(!samr_io_q_query_usergroups("", &q_u
, data
, 0)) {
512 DEBUG(0,("api_samr_query_usergroups: unable to unmarshall SAMR_Q_QUERY_USERGROUPS.\n"));
516 r_u
.status
= _samr_query_usergroups(p
, &q_u
, &r_u
);
518 /* store the response in the SMB stream */
519 if(!samr_io_r_query_usergroups("", &r_u
, rdata
, 0)) {
520 DEBUG(0,("api_samr_query_usergroups: unable to marshall SAMR_R_QUERY_USERGROUPS.\n"));
527 /*******************************************************************
528 api_samr_query_dom_info
529 ********************************************************************/
531 static BOOL
api_samr_query_dom_info(pipes_struct
*p
)
533 SAMR_Q_QUERY_DOMAIN_INFO q_u
;
534 SAMR_R_QUERY_DOMAIN_INFO r_u
;
535 prs_struct
*data
= &p
->in_data
.data
;
536 prs_struct
*rdata
= &p
->out_data
.rdata
;
541 if(!samr_io_q_query_dom_info("", &q_u
, data
, 0)) {
542 DEBUG(0,("api_samr_query_dom_info: unable to unmarshall SAMR_Q_QUERY_DOMAIN_INFO.\n"));
546 r_u
.status
= _samr_query_dom_info(p
, &q_u
, &r_u
);
548 /* store the response in the SMB stream */
549 if(!samr_io_r_query_dom_info("", &r_u
, rdata
, 0)) {
550 DEBUG(0,("api_samr_query_dom_info: unable to marshall SAMR_R_QUERY_DOMAIN_INFO.\n"));
557 /*******************************************************************
559 ********************************************************************/
561 static BOOL
api_samr_create_user(pipes_struct
*p
)
563 prs_struct
*data
= &p
->in_data
.data
;
564 prs_struct
*rdata
= &p
->out_data
.rdata
;
566 SAMR_Q_CREATE_USER q_u
;
567 SAMR_R_CREATE_USER r_u
;
572 /* grab the samr create user */
573 if (!samr_io_q_create_user("", &q_u
, data
, 0)) {
574 DEBUG(0,("api_samr_create_user: Unable to unmarshall SAMR_Q_CREATE_USER.\n"));
578 r_u
.status
=_samr_create_user(p
, &q_u
, &r_u
);
580 /* store the response in the SMB stream */
581 if(!samr_io_r_create_user("", &r_u
, rdata
, 0)) {
582 DEBUG(0,("api_samr_create_user: Unable to marshall SAMR_R_CREATE_USER.\n"));
589 /*******************************************************************
590 api_samr_connect_anon
591 ********************************************************************/
593 static BOOL
api_samr_connect_anon(pipes_struct
*p
)
595 SAMR_Q_CONNECT_ANON q_u
;
596 SAMR_R_CONNECT_ANON r_u
;
597 prs_struct
*data
= &p
->in_data
.data
;
598 prs_struct
*rdata
= &p
->out_data
.rdata
;
603 /* grab the samr open policy */
604 if(!samr_io_q_connect_anon("", &q_u
, data
, 0)) {
605 DEBUG(0,("api_samr_connect_anon: unable to unmarshall SAMR_Q_CONNECT_ANON.\n"));
609 r_u
.status
= _samr_connect_anon(p
, &q_u
, &r_u
);
611 /* store the response in the SMB stream */
612 if(!samr_io_r_connect_anon("", &r_u
, rdata
, 0)) {
613 DEBUG(0,("api_samr_connect_anon: unable to marshall SAMR_R_CONNECT_ANON.\n"));
620 /*******************************************************************
622 ********************************************************************/
624 static BOOL
api_samr_connect(pipes_struct
*p
)
628 prs_struct
*data
= &p
->in_data
.data
;
629 prs_struct
*rdata
= &p
->out_data
.rdata
;
634 /* grab the samr open policy */
635 if(!samr_io_q_connect("", &q_u
, data
, 0)) {
636 DEBUG(0,("api_samr_connect: unable to unmarshall SAMR_Q_CONNECT.\n"));
640 r_u
.status
= _samr_connect(p
, &q_u
, &r_u
);
642 /* store the response in the SMB stream */
643 if(!samr_io_r_connect("", &r_u
, rdata
, 0)) {
644 DEBUG(0,("api_samr_connect: unable to marshall SAMR_R_CONNECT.\n"));
651 /*******************************************************************
653 ********************************************************************/
655 static BOOL
api_samr_connect4(pipes_struct
*p
)
659 prs_struct
*data
= &p
->in_data
.data
;
660 prs_struct
*rdata
= &p
->out_data
.rdata
;
665 /* grab the samr open policy */
666 if(!samr_io_q_connect4("", &q_u
, data
, 0)) {
667 DEBUG(0,("api_samr_connect4: unable to unmarshall SAMR_Q_CONNECT4.\n"));
671 r_u
.status
= _samr_connect4(p
, &q_u
, &r_u
);
673 /* store the response in the SMB stream */
674 if(!samr_io_r_connect4("", &r_u
, rdata
, 0)) {
675 DEBUG(0,("api_samr_connect4: unable to marshall SAMR_R_CONNECT4.\n"));
682 /*******************************************************************
683 api_samr_chgpasswd_user3
684 ********************************************************************/
686 static BOOL
api_samr_chgpasswd_user3(pipes_struct
*p
)
688 SAMR_Q_CHGPASSWD_USER3 q_u
;
689 SAMR_R_CHGPASSWD_USER3 r_u
;
690 prs_struct
*data
= &p
->in_data
.data
;
691 prs_struct
*rdata
= &p
->out_data
.rdata
;
696 /* change password request */
697 if (!samr_io_q_chgpasswd_user3("", &q_u
, data
, 0)) {
698 DEBUG(0,("api_samr_chgpasswd_user3: Failed to unmarshall SAMR_Q_CHGPASSWD_USER3.\n"));
702 r_u
.status
= _samr_chgpasswd_user3(p
, &q_u
, &r_u
);
704 /* store the response in the SMB stream */
705 if(!samr_io_r_chgpasswd_user3("", &r_u
, rdata
, 0)) {
706 DEBUG(0,("api_samr_chgpasswd_user3: Failed to marshall SAMR_R_CHGPASSWD_USER3.\n" ));
713 /*******************************************************************
715 ********************************************************************/
717 static BOOL
api_samr_connect5(pipes_struct
*p
)
721 prs_struct
*data
= &p
->in_data
.data
;
722 prs_struct
*rdata
= &p
->out_data
.rdata
;
727 /* grab the samr open policy */
728 if(!samr_io_q_connect5("", &q_u
, data
, 0)) {
729 DEBUG(0,("api_samr_connect5: unable to unmarshall SAMR_Q_CONNECT5.\n"));
733 r_u
.status
= _samr_connect5(p
, &q_u
, &r_u
);
735 /* store the response in the SMB stream */
736 if(!samr_io_r_connect5("", &r_u
, rdata
, 0)) {
737 DEBUG(0,("api_samr_connect5: unable to marshall SAMR_R_CONNECT5.\n"));
744 /**********************************************************************
745 api_samr_lookup_domain
746 **********************************************************************/
748 static BOOL
api_samr_lookup_domain(pipes_struct
*p
)
750 SAMR_Q_LOOKUP_DOMAIN q_u
;
751 SAMR_R_LOOKUP_DOMAIN r_u
;
752 prs_struct
*data
= &p
->in_data
.data
;
753 prs_struct
*rdata
= &p
->out_data
.rdata
;
758 if(!samr_io_q_lookup_domain("", &q_u
, data
, 0)) {
759 DEBUG(0,("api_samr_lookup_domain: Unable to unmarshall SAMR_Q_LOOKUP_DOMAIN.\n"));
763 r_u
.status
= _samr_lookup_domain(p
, &q_u
, &r_u
);
765 if(!samr_io_r_lookup_domain("", &r_u
, rdata
, 0)){
766 DEBUG(0,("api_samr_lookup_domain: Unable to marshall SAMR_R_LOOKUP_DOMAIN.\n"));
773 /**********************************************************************
774 api_samr_enum_domains
775 **********************************************************************/
777 static BOOL
api_samr_enum_domains(pipes_struct
*p
)
779 SAMR_Q_ENUM_DOMAINS q_u
;
780 SAMR_R_ENUM_DOMAINS r_u
;
781 prs_struct
*data
= &p
->in_data
.data
;
782 prs_struct
*rdata
= &p
->out_data
.rdata
;
787 if(!samr_io_q_enum_domains("", &q_u
, data
, 0)) {
788 DEBUG(0,("api_samr_enum_domains: Unable to unmarshall SAMR_Q_ENUM_DOMAINS.\n"));
792 r_u
.status
= _samr_enum_domains(p
, &q_u
, &r_u
);
794 if(!samr_io_r_enum_domains("", &r_u
, rdata
, 0)) {
795 DEBUG(0,("api_samr_enum_domains: Unable to marshall SAMR_R_ENUM_DOMAINS.\n"));
802 /*******************************************************************
804 ********************************************************************/
806 static BOOL
api_samr_open_alias(pipes_struct
*p
)
808 SAMR_Q_OPEN_ALIAS q_u
;
809 SAMR_R_OPEN_ALIAS r_u
;
810 prs_struct
*data
= &p
->in_data
.data
;
811 prs_struct
*rdata
= &p
->out_data
.rdata
;
816 /* grab the samr open policy */
817 if(!samr_io_q_open_alias("", &q_u
, data
, 0)) {
818 DEBUG(0,("api_samr_open_alias: Unable to unmarshall SAMR_Q_OPEN_ALIAS.\n"));
822 r_u
.status
=_samr_open_alias(p
, &q_u
, &r_u
);
824 /* store the response in the SMB stream */
825 if(!samr_io_r_open_alias("", &r_u
, rdata
, 0)) {
826 DEBUG(0,("api_samr_open_alias: Unable to marshall SAMR_R_OPEN_ALIAS.\n"));
833 /*******************************************************************
834 api_samr_set_userinfo
835 ********************************************************************/
837 static BOOL
api_samr_set_userinfo(pipes_struct
*p
)
839 SAMR_Q_SET_USERINFO q_u
;
840 SAMR_R_SET_USERINFO r_u
;
841 prs_struct
*data
= &p
->in_data
.data
;
842 prs_struct
*rdata
= &p
->out_data
.rdata
;
847 if (!samr_io_q_set_userinfo("", &q_u
, data
, 0)) {
848 DEBUG(0,("api_samr_set_userinfo: Unable to unmarshall SAMR_Q_SET_USERINFO.\n"));
849 /* Fix for W2K SP2 */
850 /* what is that status-code ? - gd */
851 if (q_u
.switch_value
== 0x1a) {
852 setup_fault_pdu(p
, NT_STATUS(0x1c000006));
858 r_u
.status
= _samr_set_userinfo(p
, &q_u
, &r_u
);
860 if(!samr_io_r_set_userinfo("", &r_u
, rdata
, 0)) {
861 DEBUG(0,("api_samr_set_userinfo: Unable to marshall SAMR_R_SET_USERINFO.\n"));
868 /*******************************************************************
869 api_samr_set_userinfo2
870 ********************************************************************/
872 static BOOL
api_samr_set_userinfo2(pipes_struct
*p
)
874 SAMR_Q_SET_USERINFO2 q_u
;
875 SAMR_R_SET_USERINFO2 r_u
;
877 prs_struct
*data
= &p
->in_data
.data
;
878 prs_struct
*rdata
= &p
->out_data
.rdata
;
883 if (!samr_io_q_set_userinfo2("", &q_u
, data
, 0)) {
884 DEBUG(0,("api_samr_set_userinfo2: Unable to unmarshall SAMR_Q_SET_USERINFO2.\n"));
888 r_u
.status
= _samr_set_userinfo2(p
, &q_u
, &r_u
);
890 if(!samr_io_r_set_userinfo2("", &r_u
, rdata
, 0)) {
891 DEBUG(0,("api_samr_set_userinfo2: Unable to marshall SAMR_R_SET_USERINFO2.\n"));
898 /*******************************************************************
899 api_samr_query_useraliases
900 ********************************************************************/
902 static BOOL
api_samr_query_useraliases(pipes_struct
*p
)
904 SAMR_Q_QUERY_USERALIASES q_u
;
905 SAMR_R_QUERY_USERALIASES r_u
;
907 prs_struct
*data
= &p
->in_data
.data
;
908 prs_struct
*rdata
= &p
->out_data
.rdata
;
913 if (!samr_io_q_query_useraliases("", &q_u
, data
, 0)) {
914 DEBUG(0,("api_samr_query_useraliases: Unable to unmarshall SAMR_Q_QUERY_USERALIASES.\n"));
918 r_u
.status
= _samr_query_useraliases(p
, &q_u
, &r_u
);
920 if (! samr_io_r_query_useraliases("", &r_u
, rdata
, 0)) {
921 DEBUG(0,("api_samr_query_useraliases: Unable to nmarshall SAMR_R_QUERY_USERALIASES.\n"));
928 /*******************************************************************
929 api_samr_query_aliasmem
930 ********************************************************************/
932 static BOOL
api_samr_query_aliasmem(pipes_struct
*p
)
934 SAMR_Q_QUERY_ALIASMEM q_u
;
935 SAMR_R_QUERY_ALIASMEM r_u
;
937 prs_struct
*data
= &p
->in_data
.data
;
938 prs_struct
*rdata
= &p
->out_data
.rdata
;
943 if (!samr_io_q_query_aliasmem("", &q_u
, data
, 0)) {
944 DEBUG(0,("api_samr_query_aliasmem: unable to unmarshall SAMR_Q_QUERY_ALIASMEM.\n"));
948 r_u
.status
= _samr_query_aliasmem(p
, &q_u
, &r_u
);
950 if (!samr_io_r_query_aliasmem("", &r_u
, rdata
, 0)) {
951 DEBUG(0,("api_samr_query_aliasmem: unable to marshall SAMR_R_QUERY_ALIASMEM.\n"));
958 /*******************************************************************
959 api_samr_query_groupmem
960 ********************************************************************/
962 static BOOL
api_samr_query_groupmem(pipes_struct
*p
)
964 SAMR_Q_QUERY_GROUPMEM q_u
;
965 SAMR_R_QUERY_GROUPMEM r_u
;
967 prs_struct
*data
= &p
->in_data
.data
;
968 prs_struct
*rdata
= &p
->out_data
.rdata
;
973 if (!samr_io_q_query_groupmem("", &q_u
, data
, 0)) {
974 DEBUG(0,("api_samr_query_groupmem: unable to unmarshall SAMR_Q_QUERY_GROUPMEM.\n"));
978 r_u
.status
= _samr_query_groupmem(p
, &q_u
, &r_u
);
980 if (!samr_io_r_query_groupmem("", &r_u
, rdata
, 0)) {
981 DEBUG(0,("api_samr_query_groupmem: unable to marshall SAMR_R_QUERY_GROUPMEM.\n"));
988 /*******************************************************************
989 api_samr_add_aliasmem
990 ********************************************************************/
992 static BOOL
api_samr_add_aliasmem(pipes_struct
*p
)
994 SAMR_Q_ADD_ALIASMEM q_u
;
995 SAMR_R_ADD_ALIASMEM r_u
;
997 prs_struct
*data
= &p
->in_data
.data
;
998 prs_struct
*rdata
= &p
->out_data
.rdata
;
1003 if (!samr_io_q_add_aliasmem("", &q_u
, data
, 0)) {
1004 DEBUG(0,("api_samr_add_aliasmem: unable to unmarshall SAMR_Q_ADD_ALIASMEM.\n"));
1008 r_u
.status
= _samr_add_aliasmem(p
, &q_u
, &r_u
);
1010 if (!samr_io_r_add_aliasmem("", &r_u
, rdata
, 0)) {
1011 DEBUG(0,("api_samr_add_aliasmem: unable to marshall SAMR_R_ADD_ALIASMEM.\n"));
1018 /*******************************************************************
1019 api_samr_del_aliasmem
1020 ********************************************************************/
1022 static BOOL
api_samr_del_aliasmem(pipes_struct
*p
)
1024 SAMR_Q_DEL_ALIASMEM q_u
;
1025 SAMR_R_DEL_ALIASMEM r_u
;
1027 prs_struct
*data
= &p
->in_data
.data
;
1028 prs_struct
*rdata
= &p
->out_data
.rdata
;
1033 if (!samr_io_q_del_aliasmem("", &q_u
, data
, 0)) {
1034 DEBUG(0,("api_samr_del_aliasmem: unable to unmarshall SAMR_Q_DEL_ALIASMEM.\n"));
1038 r_u
.status
= _samr_del_aliasmem(p
, &q_u
, &r_u
);
1040 if (!samr_io_r_del_aliasmem("", &r_u
, rdata
, 0)) {
1041 DEBUG(0,("api_samr_del_aliasmem: unable to marshall SAMR_R_DEL_ALIASMEM.\n"));
1048 /*******************************************************************
1049 api_samr_add_groupmem
1050 ********************************************************************/
1052 static BOOL
api_samr_add_groupmem(pipes_struct
*p
)
1054 SAMR_Q_ADD_GROUPMEM q_u
;
1055 SAMR_R_ADD_GROUPMEM r_u
;
1057 prs_struct
*data
= &p
->in_data
.data
;
1058 prs_struct
*rdata
= &p
->out_data
.rdata
;
1063 if (!samr_io_q_add_groupmem("", &q_u
, data
, 0)) {
1064 DEBUG(0,("api_samr_add_groupmem: unable to unmarshall SAMR_Q_ADD_GROUPMEM.\n"));
1068 r_u
.status
= _samr_add_groupmem(p
, &q_u
, &r_u
);
1070 if (!samr_io_r_add_groupmem("", &r_u
, rdata
, 0)) {
1071 DEBUG(0,("api_samr_add_groupmem: unable to marshall SAMR_R_ADD_GROUPMEM.\n"));
1078 /*******************************************************************
1079 api_samr_del_groupmem
1080 ********************************************************************/
1082 static BOOL
api_samr_del_groupmem(pipes_struct
*p
)
1084 SAMR_Q_DEL_GROUPMEM q_u
;
1085 SAMR_R_DEL_GROUPMEM r_u
;
1087 prs_struct
*data
= &p
->in_data
.data
;
1088 prs_struct
*rdata
= &p
->out_data
.rdata
;
1093 if (!samr_io_q_del_groupmem("", &q_u
, data
, 0)) {
1094 DEBUG(0,("api_samr_del_groupmem: unable to unmarshall SAMR_Q_DEL_GROUPMEM.\n"));
1098 r_u
.status
= _samr_del_groupmem(p
, &q_u
, &r_u
);
1100 if (!samr_io_r_del_groupmem("", &r_u
, rdata
, 0)) {
1101 DEBUG(0,("api_samr_del_groupmem: unable to marshall SAMR_R_DEL_GROUPMEM.\n"));
1108 /*******************************************************************
1109 api_samr_delete_dom_user
1110 ********************************************************************/
1112 static BOOL
api_samr_delete_dom_user(pipes_struct
*p
)
1114 SAMR_Q_DELETE_DOM_USER q_u
;
1115 SAMR_R_DELETE_DOM_USER r_u
;
1117 prs_struct
*data
= &p
->in_data
.data
;
1118 prs_struct
*rdata
= &p
->out_data
.rdata
;
1123 if (!samr_io_q_delete_dom_user("", &q_u
, data
, 0)) {
1124 DEBUG(0,("api_samr_delete_dom_user: unable to unmarshall SAMR_Q_DELETE_DOM_USER.\n"));
1128 r_u
.status
= _samr_delete_dom_user(p
, &q_u
, &r_u
);
1130 if (!samr_io_r_delete_dom_user("", &r_u
, rdata
, 0)) {
1131 DEBUG(0,("api_samr_delete_dom_user: unable to marshall SAMR_R_DELETE_DOM_USER.\n"));
1138 /*******************************************************************
1139 api_samr_delete_dom_group
1140 ********************************************************************/
1142 static BOOL
api_samr_delete_dom_group(pipes_struct
*p
)
1144 SAMR_Q_DELETE_DOM_GROUP q_u
;
1145 SAMR_R_DELETE_DOM_GROUP r_u
;
1147 prs_struct
*data
= &p
->in_data
.data
;
1148 prs_struct
*rdata
= &p
->out_data
.rdata
;
1153 if (!samr_io_q_delete_dom_group("", &q_u
, data
, 0)) {
1154 DEBUG(0,("api_samr_delete_dom_group: unable to unmarshall SAMR_Q_DELETE_DOM_GROUP.\n"));
1158 r_u
.status
= _samr_delete_dom_group(p
, &q_u
, &r_u
);
1160 if (!samr_io_r_delete_dom_group("", &r_u
, rdata
, 0)) {
1161 DEBUG(0,("api_samr_delete_dom_group: unable to marshall SAMR_R_DELETE_DOM_GROUP.\n"));
1168 /*******************************************************************
1169 api_samr_delete_dom_alias
1170 ********************************************************************/
1172 static BOOL
api_samr_delete_dom_alias(pipes_struct
*p
)
1174 SAMR_Q_DELETE_DOM_ALIAS q_u
;
1175 SAMR_R_DELETE_DOM_ALIAS r_u
;
1177 prs_struct
*data
= &p
->in_data
.data
;
1178 prs_struct
*rdata
= &p
->out_data
.rdata
;
1183 if (!samr_io_q_delete_dom_alias("", &q_u
, data
, 0)) {
1184 DEBUG(0,("api_samr_delete_dom_alias: unable to unmarshall SAMR_Q_DELETE_DOM_ALIAS.\n"));
1188 r_u
.status
= _samr_delete_dom_alias(p
, &q_u
, &r_u
);
1190 if (!samr_io_r_delete_dom_alias("", &r_u
, rdata
, 0)) {
1191 DEBUG(0,("api_samr_delete_dom_alias: unable to marshall SAMR_R_DELETE_DOM_ALIAS.\n"));
1198 /*******************************************************************
1199 api_samr_create_dom_group
1200 ********************************************************************/
1202 static BOOL
api_samr_create_dom_group(pipes_struct
*p
)
1204 SAMR_Q_CREATE_DOM_GROUP q_u
;
1205 SAMR_R_CREATE_DOM_GROUP r_u
;
1207 prs_struct
*data
= &p
->in_data
.data
;
1208 prs_struct
*rdata
= &p
->out_data
.rdata
;
1213 if (!samr_io_q_create_dom_group("", &q_u
, data
, 0)) {
1214 DEBUG(0,("api_samr_create_dom_group: unable to unmarshall SAMR_Q_CREATE_DOM_GROUP.\n"));
1218 r_u
.status
= _samr_create_dom_group(p
, &q_u
, &r_u
);
1220 if (!samr_io_r_create_dom_group("", &r_u
, rdata
, 0)) {
1221 DEBUG(0,("api_samr_create_dom_group: unable to marshall SAMR_R_CREATE_DOM_GROUP.\n"));
1228 /*******************************************************************
1229 api_samr_create_dom_alias
1230 ********************************************************************/
1232 static BOOL
api_samr_create_dom_alias(pipes_struct
*p
)
1234 SAMR_Q_CREATE_DOM_ALIAS q_u
;
1235 SAMR_R_CREATE_DOM_ALIAS r_u
;
1237 prs_struct
*data
= &p
->in_data
.data
;
1238 prs_struct
*rdata
= &p
->out_data
.rdata
;
1243 if (!samr_io_q_create_dom_alias("", &q_u
, data
, 0)) {
1244 DEBUG(0,("api_samr_create_dom_alias: unable to unmarshall SAMR_Q_CREATE_DOM_ALIAS.\n"));
1248 r_u
.status
= _samr_create_dom_alias(p
, &q_u
, &r_u
);
1250 if (!samr_io_r_create_dom_alias("", &r_u
, rdata
, 0)) {
1251 DEBUG(0,("api_samr_create_dom_alias: unable to marshall SAMR_R_CREATE_DOM_ALIAS.\n"));
1258 /*******************************************************************
1259 api_samr_query_groupinfo
1260 ********************************************************************/
1262 static BOOL
api_samr_query_groupinfo(pipes_struct
*p
)
1264 SAMR_Q_QUERY_GROUPINFO q_u
;
1265 SAMR_R_QUERY_GROUPINFO r_u
;
1267 prs_struct
*data
= &p
->in_data
.data
;
1268 prs_struct
*rdata
= &p
->out_data
.rdata
;
1273 if (!samr_io_q_query_groupinfo("", &q_u
, data
, 0)) {
1274 DEBUG(0,("api_samr_query_groupinfo: unable to unmarshall SAMR_Q_QUERY_GROUPINFO.\n"));
1278 r_u
.status
= _samr_query_groupinfo(p
, &q_u
, &r_u
);
1280 if (!samr_io_r_query_groupinfo("", &r_u
, rdata
, 0)) {
1281 DEBUG(0,("api_samr_query_groupinfo: unable to marshall SAMR_R_QUERY_GROUPINFO.\n"));
1288 /*******************************************************************
1289 api_samr_set_groupinfo
1290 ********************************************************************/
1292 static BOOL
api_samr_set_groupinfo(pipes_struct
*p
)
1294 SAMR_Q_SET_GROUPINFO q_u
;
1295 SAMR_R_SET_GROUPINFO r_u
;
1297 prs_struct
*data
= &p
->in_data
.data
;
1298 prs_struct
*rdata
= &p
->out_data
.rdata
;
1303 if (!samr_io_q_set_groupinfo("", &q_u
, data
, 0)) {
1304 DEBUG(0,("api_samr_set_groupinfo: unable to unmarshall SAMR_Q_SET_GROUPINFO.\n"));
1308 r_u
.status
= _samr_set_groupinfo(p
, &q_u
, &r_u
);
1310 if (!samr_io_r_set_groupinfo("", &r_u
, rdata
, 0)) {
1311 DEBUG(0,("api_samr_set_groupinfo: unable to marshall SAMR_R_SET_GROUPINFO.\n"));
1318 /*******************************************************************
1319 api_samr_set_aliasinfo
1320 ********************************************************************/
1322 static BOOL
api_samr_set_aliasinfo(pipes_struct
*p
)
1324 SAMR_Q_SET_ALIASINFO q_u
;
1325 SAMR_R_SET_ALIASINFO r_u
;
1327 prs_struct
*data
= &p
->in_data
.data
;
1328 prs_struct
*rdata
= &p
->out_data
.rdata
;
1333 if (!samr_io_q_set_aliasinfo("", &q_u
, data
, 0)) {
1334 DEBUG(0,("api_samr_set_aliasinfo: unable to unmarshall SAMR_Q_SET_ALIASINFO.\n"));
1338 r_u
.status
= _samr_set_aliasinfo(p
, &q_u
, &r_u
);
1340 if (!samr_io_r_set_aliasinfo("", &r_u
, rdata
, 0)) {
1341 DEBUG(0,("api_samr_set_aliasinfo: unable to marshall SAMR_R_SET_ALIASINFO.\n"));
1348 /*******************************************************************
1349 api_samr_get_dom_pwinfo
1350 ********************************************************************/
1352 static BOOL
api_samr_get_dom_pwinfo(pipes_struct
*p
)
1354 SAMR_Q_GET_DOM_PWINFO q_u
;
1355 SAMR_R_GET_DOM_PWINFO r_u
;
1357 prs_struct
*data
= &p
->in_data
.data
;
1358 prs_struct
*rdata
= &p
->out_data
.rdata
;
1363 if (!samr_io_q_get_dom_pwinfo("", &q_u
, data
, 0)) {
1364 DEBUG(0,("api_samr_get_dom_pwinfo: unable to unmarshall SAMR_Q_GET_DOM_PWINFO.\n"));
1368 r_u
.status
= _samr_get_dom_pwinfo(p
, &q_u
, &r_u
);
1370 if (!samr_io_r_get_dom_pwinfo("", &r_u
, rdata
, 0)) {
1371 DEBUG(0,("api_samr_get_dom_pwinfo: unable to marshall SAMR_R_GET_DOM_PWINFO.\n"));
1378 /*******************************************************************
1380 ********************************************************************/
1382 static BOOL
api_samr_open_group(pipes_struct
*p
)
1384 SAMR_Q_OPEN_GROUP q_u
;
1385 SAMR_R_OPEN_GROUP r_u
;
1387 prs_struct
*data
= &p
->in_data
.data
;
1388 prs_struct
*rdata
= &p
->out_data
.rdata
;
1393 if (!samr_io_q_open_group("", &q_u
, data
, 0)) {
1394 DEBUG(0,("api_samr_open_group: unable to unmarshall SAMR_Q_OPEN_GROUP.\n"));
1398 r_u
.status
= _samr_open_group(p
, &q_u
, &r_u
);
1400 if (!samr_io_r_open_group("", &r_u
, rdata
, 0)) {
1401 DEBUG(0,("api_samr_open_group: unable to marshall SAMR_R_OPEN_GROUP.\n"));
1408 /*******************************************************************
1409 api_samr_remove_sid_foreign_domain
1410 ********************************************************************/
1412 static BOOL
api_samr_remove_sid_foreign_domain(pipes_struct
*p
)
1414 SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN q_u
;
1415 SAMR_R_REMOVE_SID_FOREIGN_DOMAIN r_u
;
1417 prs_struct
*data
= &p
->in_data
.data
;
1418 prs_struct
*rdata
= &p
->out_data
.rdata
;
1423 if (!samr_io_q_remove_sid_foreign_domain("", &q_u
, data
, 0)) {
1424 DEBUG(0,("api_samr_remove_sid_foreign_domain: unable to unmarshall SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN.\n"));
1428 r_u
.status
= _samr_remove_sid_foreign_domain(p
, &q_u
, &r_u
);
1430 if (!samr_io_r_remove_sid_foreign_domain("", &r_u
, rdata
, 0)) {
1431 DEBUG(0,("api_samr_remove_sid_foreign_domain: unable to marshall SAMR_R_REMOVE_SID_FOREIGN_DOMAIN.\n"));
1438 /*******************************************************************
1439 api_samr_query_dom_info2
1440 ********************************************************************/
1442 static BOOL
api_samr_query_domain_info2(pipes_struct
*p
)
1444 SAMR_Q_QUERY_DOMAIN_INFO2 q_u
;
1445 SAMR_R_QUERY_DOMAIN_INFO2 r_u
;
1446 prs_struct
*data
= &p
->in_data
.data
;
1447 prs_struct
*rdata
= &p
->out_data
.rdata
;
1452 /* grab the samr unknown 8 command */
1453 if(!samr_io_q_query_domain_info2("", &q_u
, data
, 0)) {
1454 DEBUG(0,("api_samr_query_domain_info2: unable to unmarshall SAMR_Q_QUERY_DOMAIN_INFO2.\n"));
1458 r_u
.status
= _samr_query_domain_info2(p
, &q_u
, &r_u
);
1460 /* store the response in the SMB stream */
1461 if(!samr_io_r_samr_query_domain_info2("", &r_u
, rdata
, 0)) {
1462 DEBUG(0,("api_samr_query_domain_info2: unable to marshall SAMR_R_QUERY_DOMAIN_INFO2.\n"));
1469 /*******************************************************************
1470 api_samr_set_dom_info
1471 ********************************************************************/
1473 static BOOL
api_samr_set_dom_info(pipes_struct
*p
)
1475 SAMR_Q_SET_DOMAIN_INFO q_u
;
1476 SAMR_R_SET_DOMAIN_INFO r_u
;
1477 prs_struct
*data
= &p
->in_data
.data
;
1478 prs_struct
*rdata
= &p
->out_data
.rdata
;
1483 if(!samr_io_q_set_domain_info("", &q_u
, data
, 0)) {
1484 DEBUG(0,("api_samr_set_dom_info: unable to unmarshall SAMR_Q_SET_DOMAIN_INFO.\n"));
1488 r_u
.status
= _samr_set_dom_info(p
, &q_u
, &r_u
);
1490 /* store the response in the SMB stream */
1491 if(!samr_io_r_set_domain_info("", &r_u
, rdata
, 0)) {
1492 DEBUG(0,("api_samr_set_dom_info: unable to marshall SAMR_R_SET_DOMAIN_INFO.\n"));
1499 /*******************************************************************
1500 array of \PIPE\samr operations
1501 ********************************************************************/
1503 static struct api_struct api_samr_cmds
[] =
1505 {"SAMR_CLOSE_HND" , SAMR_CLOSE_HND
, api_samr_close_hnd
},
1506 {"SAMR_CONNECT" , SAMR_CONNECT
, api_samr_connect
},
1507 {"SAMR_CONNECT_ANON" , SAMR_CONNECT_ANON
, api_samr_connect_anon
},
1508 {"SAMR_ENUM_DOMAINS" , SAMR_ENUM_DOMAINS
, api_samr_enum_domains
},
1509 {"SAMR_ENUM_DOM_USERS" , SAMR_ENUM_DOM_USERS
, api_samr_enum_dom_users
},
1511 {"SAMR_ENUM_DOM_GROUPS" , SAMR_ENUM_DOM_GROUPS
, api_samr_enum_dom_groups
},
1512 {"SAMR_ENUM_DOM_ALIASES" , SAMR_ENUM_DOM_ALIASES
, api_samr_enum_dom_aliases
},
1513 {"SAMR_QUERY_USERALIASES" , SAMR_QUERY_USERALIASES
, api_samr_query_useraliases
},
1514 {"SAMR_QUERY_ALIASMEM" , SAMR_QUERY_ALIASMEM
, api_samr_query_aliasmem
},
1515 {"SAMR_QUERY_GROUPMEM" , SAMR_QUERY_GROUPMEM
, api_samr_query_groupmem
},
1516 {"SAMR_ADD_ALIASMEM" , SAMR_ADD_ALIASMEM
, api_samr_add_aliasmem
},
1517 {"SAMR_DEL_ALIASMEM" , SAMR_DEL_ALIASMEM
, api_samr_del_aliasmem
},
1518 {"SAMR_ADD_GROUPMEM" , SAMR_ADD_GROUPMEM
, api_samr_add_groupmem
},
1519 {"SAMR_DEL_GROUPMEM" , SAMR_DEL_GROUPMEM
, api_samr_del_groupmem
},
1521 {"SAMR_DELETE_DOM_USER" , SAMR_DELETE_DOM_USER
, api_samr_delete_dom_user
},
1522 {"SAMR_DELETE_DOM_GROUP" , SAMR_DELETE_DOM_GROUP
, api_samr_delete_dom_group
},
1523 {"SAMR_DELETE_DOM_ALIAS" , SAMR_DELETE_DOM_ALIAS
, api_samr_delete_dom_alias
},
1524 {"SAMR_CREATE_DOM_GROUP" , SAMR_CREATE_DOM_GROUP
, api_samr_create_dom_group
},
1525 {"SAMR_CREATE_DOM_ALIAS" , SAMR_CREATE_DOM_ALIAS
, api_samr_create_dom_alias
},
1526 {"SAMR_LOOKUP_NAMES" , SAMR_LOOKUP_NAMES
, api_samr_lookup_names
},
1527 {"SAMR_OPEN_USER" , SAMR_OPEN_USER
, api_samr_open_user
},
1528 {"SAMR_QUERY_USERINFO" , SAMR_QUERY_USERINFO
, api_samr_query_userinfo
},
1529 {"SAMR_SET_USERINFO" , SAMR_SET_USERINFO
, api_samr_set_userinfo
},
1530 {"SAMR_SET_USERINFO2" , SAMR_SET_USERINFO2
, api_samr_set_userinfo2
},
1532 {"SAMR_QUERY_DOMAIN_INFO" , SAMR_QUERY_DOMAIN_INFO
, api_samr_query_dom_info
},
1533 {"SAMR_QUERY_USERGROUPS" , SAMR_QUERY_USERGROUPS
, api_samr_query_usergroups
},
1534 {"SAMR_QUERY_DISPINFO" , SAMR_QUERY_DISPINFO
, api_samr_query_dispinfo
},
1535 {"SAMR_QUERY_DISPINFO3" , SAMR_QUERY_DISPINFO3
, api_samr_query_dispinfo
},
1536 {"SAMR_QUERY_DISPINFO4" , SAMR_QUERY_DISPINFO4
, api_samr_query_dispinfo
},
1538 {"SAMR_QUERY_ALIASINFO" , SAMR_QUERY_ALIASINFO
, api_samr_query_aliasinfo
},
1539 {"SAMR_QUERY_GROUPINFO" , SAMR_QUERY_GROUPINFO
, api_samr_query_groupinfo
},
1540 {"SAMR_SET_GROUPINFO" , SAMR_SET_GROUPINFO
, api_samr_set_groupinfo
},
1541 {"SAMR_SET_ALIASINFO" , SAMR_SET_ALIASINFO
, api_samr_set_aliasinfo
},
1542 {"SAMR_CREATE_USER" , SAMR_CREATE_USER
, api_samr_create_user
},
1543 {"SAMR_LOOKUP_RIDS" , SAMR_LOOKUP_RIDS
, api_samr_lookup_rids
},
1544 {"SAMR_GET_DOM_PWINFO" , SAMR_GET_DOM_PWINFO
, api_samr_get_dom_pwinfo
},
1545 {"SAMR_CHGPASSWD_USER" , SAMR_CHGPASSWD_USER
, api_samr_chgpasswd_user
},
1546 {"SAMR_OPEN_ALIAS" , SAMR_OPEN_ALIAS
, api_samr_open_alias
},
1547 {"SAMR_OPEN_GROUP" , SAMR_OPEN_GROUP
, api_samr_open_group
},
1548 {"SAMR_OPEN_DOMAIN" , SAMR_OPEN_DOMAIN
, api_samr_open_domain
},
1549 {"SAMR_REMOVE_SID_FOREIGN_DOMAIN" , SAMR_REMOVE_SID_FOREIGN_DOMAIN
, api_samr_remove_sid_foreign_domain
},
1550 {"SAMR_LOOKUP_DOMAIN" , SAMR_LOOKUP_DOMAIN
, api_samr_lookup_domain
},
1552 {"SAMR_QUERY_SEC_OBJECT" , SAMR_QUERY_SEC_OBJECT
, api_samr_query_sec_obj
},
1553 {"SAMR_SET_SEC_OBJECT" , SAMR_SET_SEC_OBJECT
, api_samr_set_sec_obj
},
1554 {"SAMR_GET_USRDOM_PWINFO" , SAMR_GET_USRDOM_PWINFO
, api_samr_get_usrdom_pwinfo
},
1555 {"SAMR_QUERY_DOMAIN_INFO2", SAMR_QUERY_DOMAIN_INFO2
, api_samr_query_domain_info2
},
1556 {"SAMR_SET_DOMAIN_INFO" , SAMR_SET_DOMAIN_INFO
, api_samr_set_dom_info
},
1557 {"SAMR_CONNECT4" , SAMR_CONNECT4
, api_samr_connect4
},
1558 {"SAMR_CHGPASSWD_USER3" , SAMR_CHGPASSWD_USER3
, api_samr_chgpasswd_user3
},
1559 {"SAMR_CONNECT5" , SAMR_CONNECT5
, api_samr_connect5
}
1562 void samr_get_pipe_fns( struct api_struct
**fns
, int *n_fns
)
1564 *fns
= api_samr_cmds
;
1565 *n_fns
= sizeof(api_samr_cmds
) / sizeof(struct api_struct
);
1569 NTSTATUS
rpc_samr_init(void)
1571 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION
, "samr", "lsass", api_samr_cmds
,
1572 sizeof(api_samr_cmds
) / sizeof(struct api_struct
));