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 3 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, see <http://www.gnu.org/licenses/>.
30 * This is the interface to the SAMR code.
36 #define DBGC_CLASS DBGC_RPC_SRV
38 /*******************************************************************
40 ********************************************************************/
42 static bool api_samr_close_hnd(pipes_struct
*p
)
46 prs_struct
*data
= &p
->in_data
.data
;
47 prs_struct
*rdata
= &p
->out_data
.rdata
;
52 if(!samr_io_q_close_hnd("", &q_u
, data
, 0)) {
53 DEBUG(0,("api_samr_close_hnd: unable to unmarshall SAMR_Q_CLOSE_HND.\n"));
57 r_u
.status
= _samr_close_hnd(p
, &q_u
, &r_u
);
59 /* store the response in the SMB stream */
60 if(!samr_io_r_close_hnd("", &r_u
, rdata
, 0)) {
61 DEBUG(0,("api_samr_close_hnd: unable to marshall SAMR_R_CLOSE_HND.\n"));
68 /*******************************************************************
70 ********************************************************************/
72 static bool api_samr_open_domain(pipes_struct
*p
)
74 SAMR_Q_OPEN_DOMAIN q_u
;
75 SAMR_R_OPEN_DOMAIN r_u
;
77 prs_struct
*data
= &p
->in_data
.data
;
78 prs_struct
*rdata
= &p
->out_data
.rdata
;
83 if(!samr_io_q_open_domain("", &q_u
, data
, 0)) {
84 DEBUG(0,("api_samr_open_domain: unable to unmarshall SAMR_Q_OPEN_DOMAIN.\n"));
88 r_u
.status
= _samr_open_domain(p
, &q_u
, &r_u
);
90 /* store the response in the SMB stream */
91 if(!samr_io_r_open_domain("", &r_u
, rdata
, 0)) {
92 DEBUG(0,("api_samr_open_domain: unable to marshall SAMR_R_OPEN_DOMAIN.\n"));
99 /*******************************************************************
100 api_samr_get_usrdom_pwinfo
101 ********************************************************************/
103 static bool api_samr_get_usrdom_pwinfo(pipes_struct
*p
)
105 SAMR_Q_GET_USRDOM_PWINFO q_u
;
106 SAMR_R_GET_USRDOM_PWINFO r_u
;
108 prs_struct
*data
= &p
->in_data
.data
;
109 prs_struct
*rdata
= &p
->out_data
.rdata
;
114 if(!samr_io_q_get_usrdom_pwinfo("", &q_u
, data
, 0)) {
115 DEBUG(0,("api_samr_get_usrdom_pwinfo: unable to unmarshall SAMR_Q_GET_USRDOM_PWINFO.\n"));
119 r_u
.status
= _samr_get_usrdom_pwinfo(p
, &q_u
, &r_u
);
121 if(!samr_io_r_get_usrdom_pwinfo("", &r_u
, rdata
, 0)) {
122 DEBUG(0,("api_samr_get_usrdom_pwinfo: unable to marshall SAMR_R_GET_USRDOM_PWINFO.\n"));
129 /*******************************************************************
131 ********************************************************************/
133 static bool api_samr_set_sec_obj(pipes_struct
*p
)
135 SAMR_Q_SET_SEC_OBJ q_u
;
136 SAMR_R_SET_SEC_OBJ r_u
;
138 prs_struct
*data
= &p
->in_data
.data
;
139 prs_struct
*rdata
= &p
->out_data
.rdata
;
144 if(!samr_io_q_set_sec_obj("", &q_u
, data
, 0)) {
145 DEBUG(0,("api_samr_set_sec_obj: unable to unmarshall SAMR_Q_SET_SEC_OBJ.\n"));
149 r_u
.status
= _samr_set_sec_obj(p
, &q_u
, &r_u
);
151 if(!samr_io_r_set_sec_obj("", &r_u
, rdata
, 0)) {
152 DEBUG(0,("api_samr_set_sec_obj: unable to marshall SAMR_R_SET_SEC_OBJ.\n"));
159 /*******************************************************************
160 api_samr_query_sec_obj
161 ********************************************************************/
163 static bool api_samr_query_sec_obj(pipes_struct
*p
)
165 SAMR_Q_QUERY_SEC_OBJ q_u
;
166 SAMR_R_QUERY_SEC_OBJ r_u
;
168 prs_struct
*data
= &p
->in_data
.data
;
169 prs_struct
*rdata
= &p
->out_data
.rdata
;
174 if(!samr_io_q_query_sec_obj("", &q_u
, data
, 0)) {
175 DEBUG(0,("api_samr_query_sec_obj: unable to unmarshall SAMR_Q_QUERY_SEC_OBJ.\n"));
179 r_u
.status
= _samr_query_sec_obj(p
, &q_u
, &r_u
);
181 if(!samr_io_r_query_sec_obj("", &r_u
, rdata
, 0)) {
182 DEBUG(0,("api_samr_query_sec_obj: unable to marshall SAMR_R_QUERY_SEC_OBJ.\n"));
189 /*******************************************************************
190 api_samr_enum_dom_users
191 ********************************************************************/
193 static bool api_samr_enum_dom_users(pipes_struct
*p
)
195 SAMR_Q_ENUM_DOM_USERS q_u
;
196 SAMR_R_ENUM_DOM_USERS r_u
;
197 prs_struct
*data
= &p
->in_data
.data
;
198 prs_struct
*rdata
= &p
->out_data
.rdata
;
203 /* grab the samr open */
204 if(!samr_io_q_enum_dom_users("", &q_u
, data
, 0)) {
205 DEBUG(0,("api_samr_enum_dom_users: unable to unmarshall SAMR_Q_ENUM_DOM_USERS.\n"));
209 r_u
.status
= _samr_enum_dom_users(p
, &q_u
, &r_u
);
211 /* store the response in the SMB stream */
212 if(!samr_io_r_enum_dom_users("", &r_u
, rdata
, 0)) {
213 DEBUG(0,("api_samr_enum_dom_users: unable to marshall SAMR_R_ENUM_DOM_USERS.\n"));
220 /*******************************************************************
221 api_samr_enum_dom_groups
222 ********************************************************************/
224 static bool api_samr_enum_dom_groups(pipes_struct
*p
)
226 SAMR_Q_ENUM_DOM_GROUPS q_u
;
227 SAMR_R_ENUM_DOM_GROUPS r_u
;
228 prs_struct
*data
= &p
->in_data
.data
;
229 prs_struct
*rdata
= &p
->out_data
.rdata
;
234 /* grab the samr open */
235 if(!samr_io_q_enum_dom_groups("", &q_u
, data
, 0)) {
236 DEBUG(0,("api_samr_enum_dom_groups: unable to unmarshall SAMR_Q_ENUM_DOM_GROUPS.\n"));
240 r_u
.status
= _samr_enum_dom_groups(p
, &q_u
, &r_u
);
242 /* store the response in the SMB stream */
243 if(!samr_io_r_enum_dom_groups("", &r_u
, rdata
, 0)) {
244 DEBUG(0,("api_samr_enum_dom_groups: unable to marshall SAMR_R_ENUM_DOM_GROUPS.\n"));
251 /*******************************************************************
252 api_samr_enum_dom_aliases
253 ********************************************************************/
255 static bool api_samr_enum_dom_aliases(pipes_struct
*p
)
257 SAMR_Q_ENUM_DOM_ALIASES q_u
;
258 SAMR_R_ENUM_DOM_ALIASES r_u
;
259 prs_struct
*data
= &p
->in_data
.data
;
260 prs_struct
*rdata
= &p
->out_data
.rdata
;
265 /* grab the samr open */
266 if(!samr_io_q_enum_dom_aliases("", &q_u
, data
, 0)) {
267 DEBUG(0,("api_samr_enum_dom_aliases: unable to unmarshall SAMR_Q_ENUM_DOM_ALIASES.\n"));
271 r_u
.status
= _samr_enum_dom_aliases(p
, &q_u
, &r_u
);
273 /* store the response in the SMB stream */
274 if(!samr_io_r_enum_dom_aliases("", &r_u
, rdata
, 0)) {
275 DEBUG(0,("api_samr_enum_dom_aliases: unable to marshall SAMR_R_ENUM_DOM_ALIASES.\n"));
282 /*******************************************************************
283 api_samr_query_dispinfo
284 ********************************************************************/
286 static bool api_samr_query_dispinfo(pipes_struct
*p
)
288 SAMR_Q_QUERY_DISPINFO q_u
;
289 SAMR_R_QUERY_DISPINFO r_u
;
290 prs_struct
*data
= &p
->in_data
.data
;
291 prs_struct
*rdata
= &p
->out_data
.rdata
;
296 if(!samr_io_q_query_dispinfo("", &q_u
, data
, 0)) {
297 DEBUG(0,("api_samr_query_dispinfo: unable to unmarshall SAMR_Q_QUERY_DISPINFO.\n"));
301 r_u
.status
= _samr_query_dispinfo(p
, &q_u
, &r_u
);
303 /* store the response in the SMB stream */
304 if(!samr_io_r_query_dispinfo("", &r_u
, rdata
, 0)) {
305 DEBUG(0,("api_samr_query_dispinfo: unable to marshall SAMR_R_QUERY_DISPINFO.\n"));
312 /*******************************************************************
313 api_samr_query_aliasinfo
314 ********************************************************************/
316 static bool api_samr_query_aliasinfo(pipes_struct
*p
)
318 SAMR_Q_QUERY_ALIASINFO q_u
;
319 SAMR_R_QUERY_ALIASINFO r_u
;
320 prs_struct
*data
= &p
->in_data
.data
;
321 prs_struct
*rdata
= &p
->out_data
.rdata
;
326 /* grab the samr open */
327 if(!samr_io_q_query_aliasinfo("", &q_u
, data
, 0)) {
328 DEBUG(0,("api_samr_query_aliasinfo: unable to unmarshall SAMR_Q_QUERY_ALIASINFO.\n"));
332 r_u
.status
= _samr_query_aliasinfo(p
, &q_u
, &r_u
);
334 /* store the response in the SMB stream */
335 if(!samr_io_r_query_aliasinfo("", &r_u
, rdata
, 0)) {
336 DEBUG(0,("api_samr_query_aliasinfo: unable to marshall SAMR_R_QUERY_ALIASINFO.\n"));
343 /*******************************************************************
344 api_samr_lookup_names
345 ********************************************************************/
347 static bool api_samr_lookup_names(pipes_struct
*p
)
349 SAMR_Q_LOOKUP_NAMES q_u
;
350 SAMR_R_LOOKUP_NAMES r_u
;
351 prs_struct
*data
= &p
->in_data
.data
;
352 prs_struct
*rdata
= &p
->out_data
.rdata
;
357 /* grab the samr lookup names */
358 if(!samr_io_q_lookup_names("", &q_u
, data
, 0)) {
359 DEBUG(0,("api_samr_lookup_names: unable to unmarshall SAMR_Q_LOOKUP_NAMES.\n"));
363 r_u
.status
= _samr_lookup_names(p
, &q_u
, &r_u
);
365 /* store the response in the SMB stream */
366 if(!samr_io_r_lookup_names("", &r_u
, rdata
, 0)) {
367 DEBUG(0,("api_samr_lookup_names: unable to marshall SAMR_R_LOOKUP_NAMES.\n"));
374 /*******************************************************************
375 api_samr_chgpasswd_user
376 ********************************************************************/
378 static bool api_samr_chgpasswd_user(pipes_struct
*p
)
380 SAMR_Q_CHGPASSWD_USER q_u
;
381 SAMR_R_CHGPASSWD_USER r_u
;
382 prs_struct
*data
= &p
->in_data
.data
;
383 prs_struct
*rdata
= &p
->out_data
.rdata
;
388 /* change password request */
389 if (!samr_io_q_chgpasswd_user("", &q_u
, data
, 0)) {
390 DEBUG(0,("api_samr_chgpasswd_user: Failed to unmarshall SAMR_Q_CHGPASSWD_USER.\n"));
394 r_u
.status
= _samr_chgpasswd_user(p
, &q_u
, &r_u
);
396 /* store the response in the SMB stream */
397 if(!samr_io_r_chgpasswd_user("", &r_u
, rdata
, 0)) {
398 DEBUG(0,("api_samr_chgpasswd_user: Failed to marshall SAMR_R_CHGPASSWD_USER.\n" ));
405 /*******************************************************************
407 ********************************************************************/
409 static bool api_samr_lookup_rids(pipes_struct
*p
)
411 SAMR_Q_LOOKUP_RIDS q_u
;
412 SAMR_R_LOOKUP_RIDS r_u
;
413 prs_struct
*data
= &p
->in_data
.data
;
414 prs_struct
*rdata
= &p
->out_data
.rdata
;
419 /* grab the samr lookup names */
420 if(!samr_io_q_lookup_rids("", &q_u
, data
, 0)) {
421 DEBUG(0,("api_samr_lookup_rids: unable to unmarshall SAMR_Q_LOOKUP_RIDS.\n"));
425 r_u
.status
= _samr_lookup_rids(p
, &q_u
, &r_u
);
427 /* store the response in the SMB stream */
428 if(!samr_io_r_lookup_rids("", &r_u
, rdata
, 0)) {
429 DEBUG(0,("api_samr_lookup_rids: unable to marshall SAMR_R_LOOKUP_RIDS.\n"));
436 /*******************************************************************
438 ********************************************************************/
440 static bool api_samr_open_user(pipes_struct
*p
)
442 SAMR_Q_OPEN_USER q_u
;
443 SAMR_R_OPEN_USER r_u
;
444 prs_struct
*data
= &p
->in_data
.data
;
445 prs_struct
*rdata
= &p
->out_data
.rdata
;
450 if(!samr_io_q_open_user("", &q_u
, data
, 0)) {
451 DEBUG(0,("api_samr_open_user: unable to unmarshall SAMR_Q_OPEN_USER.\n"));
455 r_u
.status
= _samr_open_user(p
, &q_u
, &r_u
);
457 /* store the response in the SMB stream */
458 if(!samr_io_r_open_user("", &r_u
, rdata
, 0)) {
459 DEBUG(0,("api_samr_open_user: unable to marshall SAMR_R_OPEN_USER.\n"));
466 /*******************************************************************
467 api_samr_query_userinfo
468 ********************************************************************/
470 static bool api_samr_query_userinfo(pipes_struct
*p
)
472 SAMR_Q_QUERY_USERINFO q_u
;
473 SAMR_R_QUERY_USERINFO r_u
;
474 prs_struct
*data
= &p
->in_data
.data
;
475 prs_struct
*rdata
= &p
->out_data
.rdata
;
480 if(!samr_io_q_query_userinfo("", &q_u
, data
, 0)){
481 DEBUG(0,("api_samr_query_userinfo: unable to unmarshall SAMR_Q_QUERY_USERINFO.\n"));
485 r_u
.status
= _samr_query_userinfo(p
, &q_u
, &r_u
);
487 /* store the response in the SMB stream */
488 if(!samr_io_r_query_userinfo("", &r_u
, rdata
, 0)) {
489 DEBUG(0,("api_samr_query_userinfo: unable to marshall SAMR_R_QUERY_USERINFO.\n"));
496 /*******************************************************************
497 api_samr_query_usergroups
498 ********************************************************************/
500 static bool api_samr_query_usergroups(pipes_struct
*p
)
502 SAMR_Q_QUERY_USERGROUPS q_u
;
503 SAMR_R_QUERY_USERGROUPS r_u
;
504 prs_struct
*data
= &p
->in_data
.data
;
505 prs_struct
*rdata
= &p
->out_data
.rdata
;
510 if(!samr_io_q_query_usergroups("", &q_u
, data
, 0)) {
511 DEBUG(0,("api_samr_query_usergroups: unable to unmarshall SAMR_Q_QUERY_USERGROUPS.\n"));
515 r_u
.status
= _samr_query_usergroups(p
, &q_u
, &r_u
);
517 /* store the response in the SMB stream */
518 if(!samr_io_r_query_usergroups("", &r_u
, rdata
, 0)) {
519 DEBUG(0,("api_samr_query_usergroups: unable to marshall SAMR_R_QUERY_USERGROUPS.\n"));
526 /*******************************************************************
527 api_samr_query_domain_info
528 ********************************************************************/
530 static bool api_samr_query_domain_info(pipes_struct
*p
)
532 SAMR_Q_QUERY_DOMAIN_INFO q_u
;
533 SAMR_R_QUERY_DOMAIN_INFO r_u
;
534 prs_struct
*data
= &p
->in_data
.data
;
535 prs_struct
*rdata
= &p
->out_data
.rdata
;
540 if(!samr_io_q_query_domain_info("", &q_u
, data
, 0)) {
541 DEBUG(0,("api_samr_query_domain_info: unable to unmarshall SAMR_Q_QUERY_DOMAIN_INFO.\n"));
545 r_u
.status
= _samr_query_domain_info(p
, &q_u
, &r_u
);
547 /* store the response in the SMB stream */
548 if(!samr_io_r_query_domain_info("", &r_u
, rdata
, 0)) {
549 DEBUG(0,("api_samr_query_domain_info: unable to marshall SAMR_R_QUERY_DOMAIN_INFO.\n"));
556 /*******************************************************************
558 ********************************************************************/
560 static bool api_samr_create_user(pipes_struct
*p
)
562 prs_struct
*data
= &p
->in_data
.data
;
563 prs_struct
*rdata
= &p
->out_data
.rdata
;
565 SAMR_Q_CREATE_USER q_u
;
566 SAMR_R_CREATE_USER r_u
;
571 /* grab the samr create user */
572 if (!samr_io_q_create_user("", &q_u
, data
, 0)) {
573 DEBUG(0,("api_samr_create_user: Unable to unmarshall SAMR_Q_CREATE_USER.\n"));
577 r_u
.status
=_samr_create_user(p
, &q_u
, &r_u
);
579 /* store the response in the SMB stream */
580 if(!samr_io_r_create_user("", &r_u
, rdata
, 0)) {
581 DEBUG(0,("api_samr_create_user: Unable to marshall SAMR_R_CREATE_USER.\n"));
588 /*******************************************************************
589 api_samr_connect_anon
590 ********************************************************************/
592 static bool api_samr_connect_anon(pipes_struct
*p
)
594 SAMR_Q_CONNECT_ANON q_u
;
595 SAMR_R_CONNECT_ANON r_u
;
596 prs_struct
*data
= &p
->in_data
.data
;
597 prs_struct
*rdata
= &p
->out_data
.rdata
;
602 /* grab the samr open policy */
603 if(!samr_io_q_connect_anon("", &q_u
, data
, 0)) {
604 DEBUG(0,("api_samr_connect_anon: unable to unmarshall SAMR_Q_CONNECT_ANON.\n"));
608 r_u
.status
= _samr_connect_anon(p
, &q_u
, &r_u
);
610 /* store the response in the SMB stream */
611 if(!samr_io_r_connect_anon("", &r_u
, rdata
, 0)) {
612 DEBUG(0,("api_samr_connect_anon: unable to marshall SAMR_R_CONNECT_ANON.\n"));
619 /*******************************************************************
621 ********************************************************************/
623 static bool api_samr_connect(pipes_struct
*p
)
627 prs_struct
*data
= &p
->in_data
.data
;
628 prs_struct
*rdata
= &p
->out_data
.rdata
;
633 /* grab the samr open policy */
634 if(!samr_io_q_connect("", &q_u
, data
, 0)) {
635 DEBUG(0,("api_samr_connect: unable to unmarshall SAMR_Q_CONNECT.\n"));
639 r_u
.status
= _samr_connect(p
, &q_u
, &r_u
);
641 /* store the response in the SMB stream */
642 if(!samr_io_r_connect("", &r_u
, rdata
, 0)) {
643 DEBUG(0,("api_samr_connect: unable to marshall SAMR_R_CONNECT.\n"));
650 /*******************************************************************
652 ********************************************************************/
654 static bool api_samr_connect4(pipes_struct
*p
)
658 prs_struct
*data
= &p
->in_data
.data
;
659 prs_struct
*rdata
= &p
->out_data
.rdata
;
664 /* grab the samr open policy */
665 if(!samr_io_q_connect4("", &q_u
, data
, 0)) {
666 DEBUG(0,("api_samr_connect4: unable to unmarshall SAMR_Q_CONNECT4.\n"));
670 r_u
.status
= _samr_connect4(p
, &q_u
, &r_u
);
672 /* store the response in the SMB stream */
673 if(!samr_io_r_connect4("", &r_u
, rdata
, 0)) {
674 DEBUG(0,("api_samr_connect4: unable to marshall SAMR_R_CONNECT4.\n"));
681 /*******************************************************************
682 api_samr_chgpasswd_user3
683 ********************************************************************/
685 static bool api_samr_chgpasswd_user3(pipes_struct
*p
)
687 SAMR_Q_CHGPASSWD_USER3 q_u
;
688 SAMR_R_CHGPASSWD_USER3 r_u
;
689 prs_struct
*data
= &p
->in_data
.data
;
690 prs_struct
*rdata
= &p
->out_data
.rdata
;
695 /* change password request */
696 if (!samr_io_q_chgpasswd_user3("", &q_u
, data
, 0)) {
697 DEBUG(0,("api_samr_chgpasswd_user3: Failed to unmarshall SAMR_Q_CHGPASSWD_USER3.\n"));
701 r_u
.status
= _samr_chgpasswd_user3(p
, &q_u
, &r_u
);
703 /* store the response in the SMB stream */
704 if(!samr_io_r_chgpasswd_user3("", &r_u
, rdata
, 0)) {
705 DEBUG(0,("api_samr_chgpasswd_user3: Failed to marshall SAMR_R_CHGPASSWD_USER3.\n" ));
712 /*******************************************************************
714 ********************************************************************/
716 static bool api_samr_connect5(pipes_struct
*p
)
720 prs_struct
*data
= &p
->in_data
.data
;
721 prs_struct
*rdata
= &p
->out_data
.rdata
;
726 /* grab the samr open policy */
727 if(!samr_io_q_connect5("", &q_u
, data
, 0)) {
728 DEBUG(0,("api_samr_connect5: unable to unmarshall SAMR_Q_CONNECT5.\n"));
732 r_u
.status
= _samr_connect5(p
, &q_u
, &r_u
);
734 /* store the response in the SMB stream */
735 if(!samr_io_r_connect5("", &r_u
, rdata
, 0)) {
736 DEBUG(0,("api_samr_connect5: unable to marshall SAMR_R_CONNECT5.\n"));
743 /**********************************************************************
744 api_samr_lookup_domain
745 **********************************************************************/
747 static bool api_samr_lookup_domain(pipes_struct
*p
)
749 SAMR_Q_LOOKUP_DOMAIN q_u
;
750 SAMR_R_LOOKUP_DOMAIN r_u
;
751 prs_struct
*data
= &p
->in_data
.data
;
752 prs_struct
*rdata
= &p
->out_data
.rdata
;
757 if(!samr_io_q_lookup_domain("", &q_u
, data
, 0)) {
758 DEBUG(0,("api_samr_lookup_domain: Unable to unmarshall SAMR_Q_LOOKUP_DOMAIN.\n"));
762 r_u
.status
= _samr_lookup_domain(p
, &q_u
, &r_u
);
764 if(!samr_io_r_lookup_domain("", &r_u
, rdata
, 0)){
765 DEBUG(0,("api_samr_lookup_domain: Unable to marshall SAMR_R_LOOKUP_DOMAIN.\n"));
772 /**********************************************************************
773 api_samr_enum_domains
774 **********************************************************************/
776 static bool api_samr_enum_domains(pipes_struct
*p
)
778 SAMR_Q_ENUM_DOMAINS q_u
;
779 SAMR_R_ENUM_DOMAINS r_u
;
780 prs_struct
*data
= &p
->in_data
.data
;
781 prs_struct
*rdata
= &p
->out_data
.rdata
;
786 if(!samr_io_q_enum_domains("", &q_u
, data
, 0)) {
787 DEBUG(0,("api_samr_enum_domains: Unable to unmarshall SAMR_Q_ENUM_DOMAINS.\n"));
791 r_u
.status
= _samr_enum_domains(p
, &q_u
, &r_u
);
793 if(!samr_io_r_enum_domains("", &r_u
, rdata
, 0)) {
794 DEBUG(0,("api_samr_enum_domains: Unable to marshall SAMR_R_ENUM_DOMAINS.\n"));
801 /*******************************************************************
803 ********************************************************************/
805 static bool api_samr_open_alias(pipes_struct
*p
)
807 SAMR_Q_OPEN_ALIAS q_u
;
808 SAMR_R_OPEN_ALIAS r_u
;
809 prs_struct
*data
= &p
->in_data
.data
;
810 prs_struct
*rdata
= &p
->out_data
.rdata
;
815 /* grab the samr open policy */
816 if(!samr_io_q_open_alias("", &q_u
, data
, 0)) {
817 DEBUG(0,("api_samr_open_alias: Unable to unmarshall SAMR_Q_OPEN_ALIAS.\n"));
821 r_u
.status
=_samr_open_alias(p
, &q_u
, &r_u
);
823 /* store the response in the SMB stream */
824 if(!samr_io_r_open_alias("", &r_u
, rdata
, 0)) {
825 DEBUG(0,("api_samr_open_alias: Unable to marshall SAMR_R_OPEN_ALIAS.\n"));
832 /*******************************************************************
833 api_samr_set_userinfo
834 ********************************************************************/
836 static bool api_samr_set_userinfo(pipes_struct
*p
)
838 SAMR_Q_SET_USERINFO q_u
;
839 SAMR_R_SET_USERINFO r_u
;
840 prs_struct
*data
= &p
->in_data
.data
;
841 prs_struct
*rdata
= &p
->out_data
.rdata
;
846 if (!samr_io_q_set_userinfo("", &q_u
, data
, 0)) {
847 DEBUG(0,("api_samr_set_userinfo: Unable to unmarshall SAMR_Q_SET_USERINFO.\n"));
848 /* Fix for W2K SP2 */
849 /* what is that status-code ? - gd */
850 if (q_u
.switch_value
== 0x1a) {
851 setup_fault_pdu(p
, NT_STATUS(DCERPC_FAULT_INVALID_TAG
));
857 r_u
.status
= _samr_set_userinfo(p
, &q_u
, &r_u
);
859 if(!samr_io_r_set_userinfo("", &r_u
, rdata
, 0)) {
860 DEBUG(0,("api_samr_set_userinfo: Unable to marshall SAMR_R_SET_USERINFO.\n"));
867 /*******************************************************************
868 api_samr_set_userinfo2
869 ********************************************************************/
871 static bool api_samr_set_userinfo2(pipes_struct
*p
)
873 SAMR_Q_SET_USERINFO2 q_u
;
874 SAMR_R_SET_USERINFO2 r_u
;
876 prs_struct
*data
= &p
->in_data
.data
;
877 prs_struct
*rdata
= &p
->out_data
.rdata
;
882 if (!samr_io_q_set_userinfo2("", &q_u
, data
, 0)) {
883 DEBUG(0,("api_samr_set_userinfo2: Unable to unmarshall SAMR_Q_SET_USERINFO2.\n"));
887 r_u
.status
= _samr_set_userinfo2(p
, &q_u
, &r_u
);
889 if(!samr_io_r_set_userinfo2("", &r_u
, rdata
, 0)) {
890 DEBUG(0,("api_samr_set_userinfo2: Unable to marshall SAMR_R_SET_USERINFO2.\n"));
897 /*******************************************************************
898 api_samr_query_useraliases
899 ********************************************************************/
901 static bool api_samr_query_useraliases(pipes_struct
*p
)
903 SAMR_Q_QUERY_USERALIASES q_u
;
904 SAMR_R_QUERY_USERALIASES r_u
;
906 prs_struct
*data
= &p
->in_data
.data
;
907 prs_struct
*rdata
= &p
->out_data
.rdata
;
912 if (!samr_io_q_query_useraliases("", &q_u
, data
, 0)) {
913 DEBUG(0,("api_samr_query_useraliases: Unable to unmarshall SAMR_Q_QUERY_USERALIASES.\n"));
917 r_u
.status
= _samr_query_useraliases(p
, &q_u
, &r_u
);
919 if (! samr_io_r_query_useraliases("", &r_u
, rdata
, 0)) {
920 DEBUG(0,("api_samr_query_useraliases: Unable to nmarshall SAMR_R_QUERY_USERALIASES.\n"));
927 /*******************************************************************
928 api_samr_query_aliasmem
929 ********************************************************************/
931 static bool api_samr_query_aliasmem(pipes_struct
*p
)
933 SAMR_Q_QUERY_ALIASMEM q_u
;
934 SAMR_R_QUERY_ALIASMEM r_u
;
936 prs_struct
*data
= &p
->in_data
.data
;
937 prs_struct
*rdata
= &p
->out_data
.rdata
;
942 if (!samr_io_q_query_aliasmem("", &q_u
, data
, 0)) {
943 DEBUG(0,("api_samr_query_aliasmem: unable to unmarshall SAMR_Q_QUERY_ALIASMEM.\n"));
947 r_u
.status
= _samr_query_aliasmem(p
, &q_u
, &r_u
);
949 if (!samr_io_r_query_aliasmem("", &r_u
, rdata
, 0)) {
950 DEBUG(0,("api_samr_query_aliasmem: unable to marshall SAMR_R_QUERY_ALIASMEM.\n"));
957 /*******************************************************************
958 api_samr_query_groupmem
959 ********************************************************************/
961 static bool api_samr_query_groupmem(pipes_struct
*p
)
963 SAMR_Q_QUERY_GROUPMEM q_u
;
964 SAMR_R_QUERY_GROUPMEM r_u
;
966 prs_struct
*data
= &p
->in_data
.data
;
967 prs_struct
*rdata
= &p
->out_data
.rdata
;
972 if (!samr_io_q_query_groupmem("", &q_u
, data
, 0)) {
973 DEBUG(0,("api_samr_query_groupmem: unable to unmarshall SAMR_Q_QUERY_GROUPMEM.\n"));
977 r_u
.status
= _samr_query_groupmem(p
, &q_u
, &r_u
);
979 if (!samr_io_r_query_groupmem("", &r_u
, rdata
, 0)) {
980 DEBUG(0,("api_samr_query_groupmem: unable to marshall SAMR_R_QUERY_GROUPMEM.\n"));
987 /*******************************************************************
988 api_samr_add_aliasmem
989 ********************************************************************/
991 static bool api_samr_add_aliasmem(pipes_struct
*p
)
993 SAMR_Q_ADD_ALIASMEM q_u
;
994 SAMR_R_ADD_ALIASMEM r_u
;
996 prs_struct
*data
= &p
->in_data
.data
;
997 prs_struct
*rdata
= &p
->out_data
.rdata
;
1002 if (!samr_io_q_add_aliasmem("", &q_u
, data
, 0)) {
1003 DEBUG(0,("api_samr_add_aliasmem: unable to unmarshall SAMR_Q_ADD_ALIASMEM.\n"));
1007 r_u
.status
= _samr_add_aliasmem(p
, &q_u
, &r_u
);
1009 if (!samr_io_r_add_aliasmem("", &r_u
, rdata
, 0)) {
1010 DEBUG(0,("api_samr_add_aliasmem: unable to marshall SAMR_R_ADD_ALIASMEM.\n"));
1017 /*******************************************************************
1018 api_samr_del_aliasmem
1019 ********************************************************************/
1021 static bool api_samr_del_aliasmem(pipes_struct
*p
)
1023 SAMR_Q_DEL_ALIASMEM q_u
;
1024 SAMR_R_DEL_ALIASMEM r_u
;
1026 prs_struct
*data
= &p
->in_data
.data
;
1027 prs_struct
*rdata
= &p
->out_data
.rdata
;
1032 if (!samr_io_q_del_aliasmem("", &q_u
, data
, 0)) {
1033 DEBUG(0,("api_samr_del_aliasmem: unable to unmarshall SAMR_Q_DEL_ALIASMEM.\n"));
1037 r_u
.status
= _samr_del_aliasmem(p
, &q_u
, &r_u
);
1039 if (!samr_io_r_del_aliasmem("", &r_u
, rdata
, 0)) {
1040 DEBUG(0,("api_samr_del_aliasmem: unable to marshall SAMR_R_DEL_ALIASMEM.\n"));
1047 /*******************************************************************
1048 api_samr_add_groupmem
1049 ********************************************************************/
1051 static bool api_samr_add_groupmem(pipes_struct
*p
)
1053 SAMR_Q_ADD_GROUPMEM q_u
;
1054 SAMR_R_ADD_GROUPMEM r_u
;
1056 prs_struct
*data
= &p
->in_data
.data
;
1057 prs_struct
*rdata
= &p
->out_data
.rdata
;
1062 if (!samr_io_q_add_groupmem("", &q_u
, data
, 0)) {
1063 DEBUG(0,("api_samr_add_groupmem: unable to unmarshall SAMR_Q_ADD_GROUPMEM.\n"));
1067 r_u
.status
= _samr_add_groupmem(p
, &q_u
, &r_u
);
1069 if (!samr_io_r_add_groupmem("", &r_u
, rdata
, 0)) {
1070 DEBUG(0,("api_samr_add_groupmem: unable to marshall SAMR_R_ADD_GROUPMEM.\n"));
1077 /*******************************************************************
1078 api_samr_del_groupmem
1079 ********************************************************************/
1081 static bool api_samr_del_groupmem(pipes_struct
*p
)
1083 SAMR_Q_DEL_GROUPMEM q_u
;
1084 SAMR_R_DEL_GROUPMEM r_u
;
1086 prs_struct
*data
= &p
->in_data
.data
;
1087 prs_struct
*rdata
= &p
->out_data
.rdata
;
1092 if (!samr_io_q_del_groupmem("", &q_u
, data
, 0)) {
1093 DEBUG(0,("api_samr_del_groupmem: unable to unmarshall SAMR_Q_DEL_GROUPMEM.\n"));
1097 r_u
.status
= _samr_del_groupmem(p
, &q_u
, &r_u
);
1099 if (!samr_io_r_del_groupmem("", &r_u
, rdata
, 0)) {
1100 DEBUG(0,("api_samr_del_groupmem: unable to marshall SAMR_R_DEL_GROUPMEM.\n"));
1107 /*******************************************************************
1108 api_samr_delete_dom_user
1109 ********************************************************************/
1111 static bool api_samr_delete_dom_user(pipes_struct
*p
)
1113 SAMR_Q_DELETE_DOM_USER q_u
;
1114 SAMR_R_DELETE_DOM_USER r_u
;
1116 prs_struct
*data
= &p
->in_data
.data
;
1117 prs_struct
*rdata
= &p
->out_data
.rdata
;
1122 if (!samr_io_q_delete_dom_user("", &q_u
, data
, 0)) {
1123 DEBUG(0,("api_samr_delete_dom_user: unable to unmarshall SAMR_Q_DELETE_DOM_USER.\n"));
1127 r_u
.status
= _samr_delete_dom_user(p
, &q_u
, &r_u
);
1129 if (!samr_io_r_delete_dom_user("", &r_u
, rdata
, 0)) {
1130 DEBUG(0,("api_samr_delete_dom_user: unable to marshall SAMR_R_DELETE_DOM_USER.\n"));
1137 /*******************************************************************
1138 api_samr_delete_dom_group
1139 ********************************************************************/
1141 static bool api_samr_delete_dom_group(pipes_struct
*p
)
1143 SAMR_Q_DELETE_DOM_GROUP q_u
;
1144 SAMR_R_DELETE_DOM_GROUP r_u
;
1146 prs_struct
*data
= &p
->in_data
.data
;
1147 prs_struct
*rdata
= &p
->out_data
.rdata
;
1152 if (!samr_io_q_delete_dom_group("", &q_u
, data
, 0)) {
1153 DEBUG(0,("api_samr_delete_dom_group: unable to unmarshall SAMR_Q_DELETE_DOM_GROUP.\n"));
1157 r_u
.status
= _samr_delete_dom_group(p
, &q_u
, &r_u
);
1159 if (!samr_io_r_delete_dom_group("", &r_u
, rdata
, 0)) {
1160 DEBUG(0,("api_samr_delete_dom_group: unable to marshall SAMR_R_DELETE_DOM_GROUP.\n"));
1167 /*******************************************************************
1168 api_samr_delete_dom_alias
1169 ********************************************************************/
1171 static bool api_samr_delete_dom_alias(pipes_struct
*p
)
1173 SAMR_Q_DELETE_DOM_ALIAS q_u
;
1174 SAMR_R_DELETE_DOM_ALIAS r_u
;
1176 prs_struct
*data
= &p
->in_data
.data
;
1177 prs_struct
*rdata
= &p
->out_data
.rdata
;
1182 if (!samr_io_q_delete_dom_alias("", &q_u
, data
, 0)) {
1183 DEBUG(0,("api_samr_delete_dom_alias: unable to unmarshall SAMR_Q_DELETE_DOM_ALIAS.\n"));
1187 r_u
.status
= _samr_delete_dom_alias(p
, &q_u
, &r_u
);
1189 if (!samr_io_r_delete_dom_alias("", &r_u
, rdata
, 0)) {
1190 DEBUG(0,("api_samr_delete_dom_alias: unable to marshall SAMR_R_DELETE_DOM_ALIAS.\n"));
1197 /*******************************************************************
1198 api_samr_create_dom_group
1199 ********************************************************************/
1201 static bool api_samr_create_dom_group(pipes_struct
*p
)
1203 SAMR_Q_CREATE_DOM_GROUP q_u
;
1204 SAMR_R_CREATE_DOM_GROUP r_u
;
1206 prs_struct
*data
= &p
->in_data
.data
;
1207 prs_struct
*rdata
= &p
->out_data
.rdata
;
1212 if (!samr_io_q_create_dom_group("", &q_u
, data
, 0)) {
1213 DEBUG(0,("api_samr_create_dom_group: unable to unmarshall SAMR_Q_CREATE_DOM_GROUP.\n"));
1217 r_u
.status
= _samr_create_dom_group(p
, &q_u
, &r_u
);
1219 if (!samr_io_r_create_dom_group("", &r_u
, rdata
, 0)) {
1220 DEBUG(0,("api_samr_create_dom_group: unable to marshall SAMR_R_CREATE_DOM_GROUP.\n"));
1227 /*******************************************************************
1228 api_samr_create_dom_alias
1229 ********************************************************************/
1231 static bool api_samr_create_dom_alias(pipes_struct
*p
)
1233 SAMR_Q_CREATE_DOM_ALIAS q_u
;
1234 SAMR_R_CREATE_DOM_ALIAS r_u
;
1236 prs_struct
*data
= &p
->in_data
.data
;
1237 prs_struct
*rdata
= &p
->out_data
.rdata
;
1242 if (!samr_io_q_create_dom_alias("", &q_u
, data
, 0)) {
1243 DEBUG(0,("api_samr_create_dom_alias: unable to unmarshall SAMR_Q_CREATE_DOM_ALIAS.\n"));
1247 r_u
.status
= _samr_create_dom_alias(p
, &q_u
, &r_u
);
1249 if (!samr_io_r_create_dom_alias("", &r_u
, rdata
, 0)) {
1250 DEBUG(0,("api_samr_create_dom_alias: unable to marshall SAMR_R_CREATE_DOM_ALIAS.\n"));
1257 /*******************************************************************
1258 api_samr_query_groupinfo
1259 ********************************************************************/
1261 static bool api_samr_query_groupinfo(pipes_struct
*p
)
1263 SAMR_Q_QUERY_GROUPINFO q_u
;
1264 SAMR_R_QUERY_GROUPINFO r_u
;
1266 prs_struct
*data
= &p
->in_data
.data
;
1267 prs_struct
*rdata
= &p
->out_data
.rdata
;
1272 if (!samr_io_q_query_groupinfo("", &q_u
, data
, 0)) {
1273 DEBUG(0,("api_samr_query_groupinfo: unable to unmarshall SAMR_Q_QUERY_GROUPINFO.\n"));
1277 r_u
.status
= _samr_query_groupinfo(p
, &q_u
, &r_u
);
1279 if (!samr_io_r_query_groupinfo("", &r_u
, rdata
, 0)) {
1280 DEBUG(0,("api_samr_query_groupinfo: unable to marshall SAMR_R_QUERY_GROUPINFO.\n"));
1287 /*******************************************************************
1288 api_samr_set_groupinfo
1289 ********************************************************************/
1291 static bool api_samr_set_groupinfo(pipes_struct
*p
)
1293 SAMR_Q_SET_GROUPINFO q_u
;
1294 SAMR_R_SET_GROUPINFO r_u
;
1296 prs_struct
*data
= &p
->in_data
.data
;
1297 prs_struct
*rdata
= &p
->out_data
.rdata
;
1302 if (!samr_io_q_set_groupinfo("", &q_u
, data
, 0)) {
1303 DEBUG(0,("api_samr_set_groupinfo: unable to unmarshall SAMR_Q_SET_GROUPINFO.\n"));
1307 r_u
.status
= _samr_set_groupinfo(p
, &q_u
, &r_u
);
1309 if (!samr_io_r_set_groupinfo("", &r_u
, rdata
, 0)) {
1310 DEBUG(0,("api_samr_set_groupinfo: unable to marshall SAMR_R_SET_GROUPINFO.\n"));
1317 /*******************************************************************
1318 api_samr_set_aliasinfo
1319 ********************************************************************/
1321 static bool api_samr_set_aliasinfo(pipes_struct
*p
)
1323 SAMR_Q_SET_ALIASINFO q_u
;
1324 SAMR_R_SET_ALIASINFO r_u
;
1326 prs_struct
*data
= &p
->in_data
.data
;
1327 prs_struct
*rdata
= &p
->out_data
.rdata
;
1332 if (!samr_io_q_set_aliasinfo("", &q_u
, data
, 0)) {
1333 DEBUG(0,("api_samr_set_aliasinfo: unable to unmarshall SAMR_Q_SET_ALIASINFO.\n"));
1337 r_u
.status
= _samr_set_aliasinfo(p
, &q_u
, &r_u
);
1339 if (!samr_io_r_set_aliasinfo("", &r_u
, rdata
, 0)) {
1340 DEBUG(0,("api_samr_set_aliasinfo: unable to marshall SAMR_R_SET_ALIASINFO.\n"));
1347 /*******************************************************************
1348 api_samr_get_dom_pwinfo
1349 ********************************************************************/
1351 static bool api_samr_get_dom_pwinfo(pipes_struct
*p
)
1353 SAMR_Q_GET_DOM_PWINFO q_u
;
1354 SAMR_R_GET_DOM_PWINFO r_u
;
1356 prs_struct
*data
= &p
->in_data
.data
;
1357 prs_struct
*rdata
= &p
->out_data
.rdata
;
1362 if (!samr_io_q_get_dom_pwinfo("", &q_u
, data
, 0)) {
1363 DEBUG(0,("api_samr_get_dom_pwinfo: unable to unmarshall SAMR_Q_GET_DOM_PWINFO.\n"));
1367 r_u
.status
= _samr_get_dom_pwinfo(p
, &q_u
, &r_u
);
1369 if (!samr_io_r_get_dom_pwinfo("", &r_u
, rdata
, 0)) {
1370 DEBUG(0,("api_samr_get_dom_pwinfo: unable to marshall SAMR_R_GET_DOM_PWINFO.\n"));
1377 /*******************************************************************
1379 ********************************************************************/
1381 static bool api_samr_open_group(pipes_struct
*p
)
1383 SAMR_Q_OPEN_GROUP q_u
;
1384 SAMR_R_OPEN_GROUP r_u
;
1386 prs_struct
*data
= &p
->in_data
.data
;
1387 prs_struct
*rdata
= &p
->out_data
.rdata
;
1392 if (!samr_io_q_open_group("", &q_u
, data
, 0)) {
1393 DEBUG(0,("api_samr_open_group: unable to unmarshall SAMR_Q_OPEN_GROUP.\n"));
1397 r_u
.status
= _samr_open_group(p
, &q_u
, &r_u
);
1399 if (!samr_io_r_open_group("", &r_u
, rdata
, 0)) {
1400 DEBUG(0,("api_samr_open_group: unable to marshall SAMR_R_OPEN_GROUP.\n"));
1407 /*******************************************************************
1408 api_samr_remove_sid_foreign_domain
1409 ********************************************************************/
1411 static bool api_samr_remove_sid_foreign_domain(pipes_struct
*p
)
1413 SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN q_u
;
1414 SAMR_R_REMOVE_SID_FOREIGN_DOMAIN r_u
;
1416 prs_struct
*data
= &p
->in_data
.data
;
1417 prs_struct
*rdata
= &p
->out_data
.rdata
;
1422 if (!samr_io_q_remove_sid_foreign_domain("", &q_u
, data
, 0)) {
1423 DEBUG(0,("api_samr_remove_sid_foreign_domain: unable to unmarshall SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN.\n"));
1427 r_u
.status
= _samr_remove_sid_foreign_domain(p
, &q_u
, &r_u
);
1429 if (!samr_io_r_remove_sid_foreign_domain("", &r_u
, rdata
, 0)) {
1430 DEBUG(0,("api_samr_remove_sid_foreign_domain: unable to marshall SAMR_R_REMOVE_SID_FOREIGN_DOMAIN.\n"));
1437 /*******************************************************************
1438 api_samr_query_dom_info2
1439 ********************************************************************/
1441 static bool api_samr_query_domain_info2(pipes_struct
*p
)
1443 SAMR_Q_QUERY_DOMAIN_INFO2 q_u
;
1444 SAMR_R_QUERY_DOMAIN_INFO2 r_u
;
1445 prs_struct
*data
= &p
->in_data
.data
;
1446 prs_struct
*rdata
= &p
->out_data
.rdata
;
1451 if(!samr_io_q_query_domain_info2("", &q_u
, data
, 0)) {
1452 DEBUG(0,("api_samr_query_domain_info2: unable to unmarshall SAMR_Q_QUERY_DOMAIN_INFO2.\n"));
1456 r_u
.status
= _samr_query_domain_info2(p
, &q_u
, &r_u
);
1458 /* store the response in the SMB stream */
1459 if(!samr_io_r_query_domain_info2("", &r_u
, rdata
, 0)) {
1460 DEBUG(0,("api_samr_query_domain_info2: unable to marshall SAMR_R_QUERY_DOMAIN_INFO2.\n"));
1467 /*******************************************************************
1468 api_samr_set_dom_info
1469 ********************************************************************/
1471 static bool api_samr_set_dom_info(pipes_struct
*p
)
1473 SAMR_Q_SET_DOMAIN_INFO q_u
;
1474 SAMR_R_SET_DOMAIN_INFO r_u
;
1475 prs_struct
*data
= &p
->in_data
.data
;
1476 prs_struct
*rdata
= &p
->out_data
.rdata
;
1481 if(!samr_io_q_set_domain_info("", &q_u
, data
, 0)) {
1482 DEBUG(0,("api_samr_set_dom_info: unable to unmarshall SAMR_Q_SET_DOMAIN_INFO.\n"));
1486 r_u
.status
= _samr_set_dom_info(p
, &q_u
, &r_u
);
1488 /* store the response in the SMB stream */
1489 if(!samr_io_r_set_domain_info("", &r_u
, rdata
, 0)) {
1490 DEBUG(0,("api_samr_set_dom_info: unable to marshall SAMR_R_SET_DOMAIN_INFO.\n"));
1497 /*******************************************************************
1498 array of \PIPE\samr operations
1499 ********************************************************************/
1501 static struct api_struct api_samr_cmds
[] =
1503 {"SAMR_CLOSE_HND" , SAMR_CLOSE_HND
, api_samr_close_hnd
},
1504 {"SAMR_CONNECT" , SAMR_CONNECT
, api_samr_connect
},
1505 {"SAMR_CONNECT_ANON" , SAMR_CONNECT_ANON
, api_samr_connect_anon
},
1506 {"SAMR_ENUM_DOMAINS" , SAMR_ENUM_DOMAINS
, api_samr_enum_domains
},
1507 {"SAMR_ENUM_DOM_USERS" , SAMR_ENUM_DOM_USERS
, api_samr_enum_dom_users
},
1509 {"SAMR_ENUM_DOM_GROUPS" , SAMR_ENUM_DOM_GROUPS
, api_samr_enum_dom_groups
},
1510 {"SAMR_ENUM_DOM_ALIASES" , SAMR_ENUM_DOM_ALIASES
, api_samr_enum_dom_aliases
},
1511 {"SAMR_QUERY_USERALIASES" , SAMR_QUERY_USERALIASES
, api_samr_query_useraliases
},
1512 {"SAMR_QUERY_ALIASMEM" , SAMR_QUERY_ALIASMEM
, api_samr_query_aliasmem
},
1513 {"SAMR_QUERY_GROUPMEM" , SAMR_QUERY_GROUPMEM
, api_samr_query_groupmem
},
1514 {"SAMR_ADD_ALIASMEM" , SAMR_ADD_ALIASMEM
, api_samr_add_aliasmem
},
1515 {"SAMR_DEL_ALIASMEM" , SAMR_DEL_ALIASMEM
, api_samr_del_aliasmem
},
1516 {"SAMR_ADD_GROUPMEM" , SAMR_ADD_GROUPMEM
, api_samr_add_groupmem
},
1517 {"SAMR_DEL_GROUPMEM" , SAMR_DEL_GROUPMEM
, api_samr_del_groupmem
},
1519 {"SAMR_DELETE_DOM_USER" , SAMR_DELETE_DOM_USER
, api_samr_delete_dom_user
},
1520 {"SAMR_DELETE_DOM_GROUP" , SAMR_DELETE_DOM_GROUP
, api_samr_delete_dom_group
},
1521 {"SAMR_DELETE_DOM_ALIAS" , SAMR_DELETE_DOM_ALIAS
, api_samr_delete_dom_alias
},
1522 {"SAMR_CREATE_DOM_GROUP" , SAMR_CREATE_DOM_GROUP
, api_samr_create_dom_group
},
1523 {"SAMR_CREATE_DOM_ALIAS" , SAMR_CREATE_DOM_ALIAS
, api_samr_create_dom_alias
},
1524 {"SAMR_LOOKUP_NAMES" , SAMR_LOOKUP_NAMES
, api_samr_lookup_names
},
1525 {"SAMR_OPEN_USER" , SAMR_OPEN_USER
, api_samr_open_user
},
1526 {"SAMR_QUERY_USERINFO" , SAMR_QUERY_USERINFO
, api_samr_query_userinfo
},
1527 {"SAMR_SET_USERINFO" , SAMR_SET_USERINFO
, api_samr_set_userinfo
},
1528 {"SAMR_SET_USERINFO2" , SAMR_SET_USERINFO2
, api_samr_set_userinfo2
},
1530 {"SAMR_QUERY_DOMAIN_INFO" , SAMR_QUERY_DOMAIN_INFO
, api_samr_query_domain_info
},
1531 {"SAMR_QUERY_USERGROUPS" , SAMR_QUERY_USERGROUPS
, api_samr_query_usergroups
},
1532 {"SAMR_QUERY_DISPINFO" , SAMR_QUERY_DISPINFO
, api_samr_query_dispinfo
},
1533 {"SAMR_QUERY_DISPINFO3" , SAMR_QUERY_DISPINFO3
, api_samr_query_dispinfo
},
1534 {"SAMR_QUERY_DISPINFO4" , SAMR_QUERY_DISPINFO4
, api_samr_query_dispinfo
},
1536 {"SAMR_QUERY_ALIASINFO" , SAMR_QUERY_ALIASINFO
, api_samr_query_aliasinfo
},
1537 {"SAMR_QUERY_GROUPINFO" , SAMR_QUERY_GROUPINFO
, api_samr_query_groupinfo
},
1538 {"SAMR_SET_GROUPINFO" , SAMR_SET_GROUPINFO
, api_samr_set_groupinfo
},
1539 {"SAMR_SET_ALIASINFO" , SAMR_SET_ALIASINFO
, api_samr_set_aliasinfo
},
1540 {"SAMR_CREATE_USER" , SAMR_CREATE_USER
, api_samr_create_user
},
1541 {"SAMR_LOOKUP_RIDS" , SAMR_LOOKUP_RIDS
, api_samr_lookup_rids
},
1542 {"SAMR_GET_DOM_PWINFO" , SAMR_GET_DOM_PWINFO
, api_samr_get_dom_pwinfo
},
1543 {"SAMR_CHGPASSWD_USER" , SAMR_CHGPASSWD_USER
, api_samr_chgpasswd_user
},
1544 {"SAMR_OPEN_ALIAS" , SAMR_OPEN_ALIAS
, api_samr_open_alias
},
1545 {"SAMR_OPEN_GROUP" , SAMR_OPEN_GROUP
, api_samr_open_group
},
1546 {"SAMR_OPEN_DOMAIN" , SAMR_OPEN_DOMAIN
, api_samr_open_domain
},
1547 {"SAMR_REMOVE_SID_FOREIGN_DOMAIN" , SAMR_REMOVE_SID_FOREIGN_DOMAIN
, api_samr_remove_sid_foreign_domain
},
1548 {"SAMR_LOOKUP_DOMAIN" , SAMR_LOOKUP_DOMAIN
, api_samr_lookup_domain
},
1550 {"SAMR_QUERY_SEC_OBJECT" , SAMR_QUERY_SEC_OBJECT
, api_samr_query_sec_obj
},
1551 {"SAMR_SET_SEC_OBJECT" , SAMR_SET_SEC_OBJECT
, api_samr_set_sec_obj
},
1552 {"SAMR_GET_USRDOM_PWINFO" , SAMR_GET_USRDOM_PWINFO
, api_samr_get_usrdom_pwinfo
},
1553 {"SAMR_QUERY_DOMAIN_INFO2", SAMR_QUERY_DOMAIN_INFO2
, api_samr_query_domain_info2
},
1554 {"SAMR_SET_DOMAIN_INFO" , SAMR_SET_DOMAIN_INFO
, api_samr_set_dom_info
},
1555 {"SAMR_CONNECT4" , SAMR_CONNECT4
, api_samr_connect4
},
1556 {"SAMR_CHGPASSWD_USER3" , SAMR_CHGPASSWD_USER3
, api_samr_chgpasswd_user3
},
1557 {"SAMR_CONNECT5" , SAMR_CONNECT5
, api_samr_connect5
}
1560 void samr_get_pipe_fns( struct api_struct
**fns
, int *n_fns
)
1562 *fns
= api_samr_cmds
;
1563 *n_fns
= sizeof(api_samr_cmds
) / sizeof(struct api_struct
);
1567 NTSTATUS
rpc_samr_init(void)
1569 return rpc_pipe_register_commands(SMB_RPC_INTERFACE_VERSION
, "samr", "lsass", api_samr_cmds
,
1570 sizeof(api_samr_cmds
) / sizeof(struct api_struct
));