netapi: add skeleton for NetUserGetGroups.
[Samba.git] / source3 / lib / netapi / libnetapi.c
blob4b87bbcdf484ef47d28bb1f2a9270d2519449709
1 /*
2 * Unix SMB/CIFS implementation.
3 * NetApi Support
4 * Copyright (C) Guenther Deschner 2007-2008
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #include "includes.h"
21 #include "librpc/gen_ndr/libnetapi.h"
22 #include "lib/netapi/netapi.h"
23 #include "lib/netapi/netapi_private.h"
24 #include "lib/netapi/libnetapi.h"
25 #include "librpc/gen_ndr/ndr_libnetapi.h"
27 /****************************************************************
28 NetJoinDomain
29 ****************************************************************/
31 NET_API_STATUS NetJoinDomain(const char * server /* [in] [unique] */,
32 const char * domain /* [in] [ref] */,
33 const char * account_ou /* [in] [unique] */,
34 const char * account /* [in] [unique] */,
35 const char * password /* [in] [unique] */,
36 uint32_t join_flags /* [in] */)
38 struct NetJoinDomain r;
39 struct libnetapi_ctx *ctx = NULL;
40 NET_API_STATUS status;
41 WERROR werr;
43 status = libnetapi_getctx(&ctx);
44 if (status != 0) {
45 return status;
48 /* In parameters */
49 r.in.server = server;
50 r.in.domain = domain;
51 r.in.account_ou = account_ou;
52 r.in.account = account;
53 r.in.password = password;
54 r.in.join_flags = join_flags;
56 /* Out parameters */
58 if (DEBUGLEVEL >= 10) {
59 NDR_PRINT_IN_DEBUG(NetJoinDomain, &r);
62 if (LIBNETAPI_LOCAL_SERVER(server)) {
63 werr = NetJoinDomain_l(ctx, &r);
64 } else {
65 werr = NetJoinDomain_r(ctx, &r);
68 r.out.result = W_ERROR_V(werr);
70 if (DEBUGLEVEL >= 10) {
71 NDR_PRINT_OUT_DEBUG(NetJoinDomain, &r);
74 return r.out.result;
77 /****************************************************************
78 NetUnjoinDomain
79 ****************************************************************/
81 NET_API_STATUS NetUnjoinDomain(const char * server_name /* [in] [unique] */,
82 const char * account /* [in] [unique] */,
83 const char * password /* [in] [unique] */,
84 uint32_t unjoin_flags /* [in] */)
86 struct NetUnjoinDomain r;
87 struct libnetapi_ctx *ctx = NULL;
88 NET_API_STATUS status;
89 WERROR werr;
91 status = libnetapi_getctx(&ctx);
92 if (status != 0) {
93 return status;
96 /* In parameters */
97 r.in.server_name = server_name;
98 r.in.account = account;
99 r.in.password = password;
100 r.in.unjoin_flags = unjoin_flags;
102 /* Out parameters */
104 if (DEBUGLEVEL >= 10) {
105 NDR_PRINT_IN_DEBUG(NetUnjoinDomain, &r);
108 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
109 werr = NetUnjoinDomain_l(ctx, &r);
110 } else {
111 werr = NetUnjoinDomain_r(ctx, &r);
114 r.out.result = W_ERROR_V(werr);
116 if (DEBUGLEVEL >= 10) {
117 NDR_PRINT_OUT_DEBUG(NetUnjoinDomain, &r);
120 return r.out.result;
123 /****************************************************************
124 NetGetJoinInformation
125 ****************************************************************/
127 NET_API_STATUS NetGetJoinInformation(const char * server_name /* [in] [unique] */,
128 const char * *name_buffer /* [out] [ref] */,
129 uint16_t *name_type /* [out] [ref] */)
131 struct NetGetJoinInformation r;
132 struct libnetapi_ctx *ctx = NULL;
133 NET_API_STATUS status;
134 WERROR werr;
136 status = libnetapi_getctx(&ctx);
137 if (status != 0) {
138 return status;
141 /* In parameters */
142 r.in.server_name = server_name;
144 /* Out parameters */
145 r.out.name_buffer = name_buffer;
146 r.out.name_type = name_type;
148 if (DEBUGLEVEL >= 10) {
149 NDR_PRINT_IN_DEBUG(NetGetJoinInformation, &r);
152 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
153 werr = NetGetJoinInformation_l(ctx, &r);
154 } else {
155 werr = NetGetJoinInformation_r(ctx, &r);
158 r.out.result = W_ERROR_V(werr);
160 if (DEBUGLEVEL >= 10) {
161 NDR_PRINT_OUT_DEBUG(NetGetJoinInformation, &r);
164 return r.out.result;
167 /****************************************************************
168 NetGetJoinableOUs
169 ****************************************************************/
171 NET_API_STATUS NetGetJoinableOUs(const char * server_name /* [in] [unique] */,
172 const char * domain /* [in] [ref] */,
173 const char * account /* [in] [unique] */,
174 const char * password /* [in] [unique] */,
175 uint32_t *ou_count /* [out] [ref] */,
176 const char * **ous /* [out] [ref] */)
178 struct NetGetJoinableOUs r;
179 struct libnetapi_ctx *ctx = NULL;
180 NET_API_STATUS status;
181 WERROR werr;
183 status = libnetapi_getctx(&ctx);
184 if (status != 0) {
185 return status;
188 /* In parameters */
189 r.in.server_name = server_name;
190 r.in.domain = domain;
191 r.in.account = account;
192 r.in.password = password;
194 /* Out parameters */
195 r.out.ou_count = ou_count;
196 r.out.ous = ous;
198 if (DEBUGLEVEL >= 10) {
199 NDR_PRINT_IN_DEBUG(NetGetJoinableOUs, &r);
202 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
203 werr = NetGetJoinableOUs_l(ctx, &r);
204 } else {
205 werr = NetGetJoinableOUs_r(ctx, &r);
208 r.out.result = W_ERROR_V(werr);
210 if (DEBUGLEVEL >= 10) {
211 NDR_PRINT_OUT_DEBUG(NetGetJoinableOUs, &r);
214 return r.out.result;
217 /****************************************************************
218 NetServerGetInfo
219 ****************************************************************/
221 NET_API_STATUS NetServerGetInfo(const char * server_name /* [in] [unique] */,
222 uint32_t level /* [in] */,
223 uint8_t **buffer /* [out] [ref] */)
225 struct NetServerGetInfo r;
226 struct libnetapi_ctx *ctx = NULL;
227 NET_API_STATUS status;
228 WERROR werr;
230 status = libnetapi_getctx(&ctx);
231 if (status != 0) {
232 return status;
235 /* In parameters */
236 r.in.server_name = server_name;
237 r.in.level = level;
239 /* Out parameters */
240 r.out.buffer = buffer;
242 if (DEBUGLEVEL >= 10) {
243 NDR_PRINT_IN_DEBUG(NetServerGetInfo, &r);
246 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
247 werr = NetServerGetInfo_l(ctx, &r);
248 } else {
249 werr = NetServerGetInfo_r(ctx, &r);
252 r.out.result = W_ERROR_V(werr);
254 if (DEBUGLEVEL >= 10) {
255 NDR_PRINT_OUT_DEBUG(NetServerGetInfo, &r);
258 return r.out.result;
261 /****************************************************************
262 NetServerSetInfo
263 ****************************************************************/
265 NET_API_STATUS NetServerSetInfo(const char * server_name /* [in] [unique] */,
266 uint32_t level /* [in] */,
267 uint8_t *buffer /* [in] [ref] */,
268 uint32_t *parm_error /* [out] [ref] */)
270 struct NetServerSetInfo r;
271 struct libnetapi_ctx *ctx = NULL;
272 NET_API_STATUS status;
273 WERROR werr;
275 status = libnetapi_getctx(&ctx);
276 if (status != 0) {
277 return status;
280 /* In parameters */
281 r.in.server_name = server_name;
282 r.in.level = level;
283 r.in.buffer = buffer;
285 /* Out parameters */
286 r.out.parm_error = parm_error;
288 if (DEBUGLEVEL >= 10) {
289 NDR_PRINT_IN_DEBUG(NetServerSetInfo, &r);
292 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
293 werr = NetServerSetInfo_l(ctx, &r);
294 } else {
295 werr = NetServerSetInfo_r(ctx, &r);
298 r.out.result = W_ERROR_V(werr);
300 if (DEBUGLEVEL >= 10) {
301 NDR_PRINT_OUT_DEBUG(NetServerSetInfo, &r);
304 return r.out.result;
307 /****************************************************************
308 NetGetDCName
309 ****************************************************************/
311 NET_API_STATUS NetGetDCName(const char * server_name /* [in] [unique] */,
312 const char * domain_name /* [in] [unique] */,
313 uint8_t **buffer /* [out] [ref] */)
315 struct NetGetDCName r;
316 struct libnetapi_ctx *ctx = NULL;
317 NET_API_STATUS status;
318 WERROR werr;
320 status = libnetapi_getctx(&ctx);
321 if (status != 0) {
322 return status;
325 /* In parameters */
326 r.in.server_name = server_name;
327 r.in.domain_name = domain_name;
329 /* Out parameters */
330 r.out.buffer = buffer;
332 if (DEBUGLEVEL >= 10) {
333 NDR_PRINT_IN_DEBUG(NetGetDCName, &r);
336 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
337 werr = NetGetDCName_l(ctx, &r);
338 } else {
339 werr = NetGetDCName_r(ctx, &r);
342 r.out.result = W_ERROR_V(werr);
344 if (DEBUGLEVEL >= 10) {
345 NDR_PRINT_OUT_DEBUG(NetGetDCName, &r);
348 return r.out.result;
351 /****************************************************************
352 NetGetAnyDCName
353 ****************************************************************/
355 NET_API_STATUS NetGetAnyDCName(const char * server_name /* [in] [unique] */,
356 const char * domain_name /* [in] [unique] */,
357 uint8_t **buffer /* [out] [ref] */)
359 struct NetGetAnyDCName r;
360 struct libnetapi_ctx *ctx = NULL;
361 NET_API_STATUS status;
362 WERROR werr;
364 status = libnetapi_getctx(&ctx);
365 if (status != 0) {
366 return status;
369 /* In parameters */
370 r.in.server_name = server_name;
371 r.in.domain_name = domain_name;
373 /* Out parameters */
374 r.out.buffer = buffer;
376 if (DEBUGLEVEL >= 10) {
377 NDR_PRINT_IN_DEBUG(NetGetAnyDCName, &r);
380 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
381 werr = NetGetAnyDCName_l(ctx, &r);
382 } else {
383 werr = NetGetAnyDCName_r(ctx, &r);
386 r.out.result = W_ERROR_V(werr);
388 if (DEBUGLEVEL >= 10) {
389 NDR_PRINT_OUT_DEBUG(NetGetAnyDCName, &r);
392 return r.out.result;
395 /****************************************************************
396 DsGetDcName
397 ****************************************************************/
399 NET_API_STATUS DsGetDcName(const char * server_name /* [in] [unique] */,
400 const char * domain_name /* [in] [ref] */,
401 struct GUID *domain_guid /* [in] [unique] */,
402 const char * site_name /* [in] [unique] */,
403 uint32_t flags /* [in] */,
404 struct DOMAIN_CONTROLLER_INFO **dc_info /* [out] [ref] */)
406 struct DsGetDcName r;
407 struct libnetapi_ctx *ctx = NULL;
408 NET_API_STATUS status;
409 WERROR werr;
411 status = libnetapi_getctx(&ctx);
412 if (status != 0) {
413 return status;
416 /* In parameters */
417 r.in.server_name = server_name;
418 r.in.domain_name = domain_name;
419 r.in.domain_guid = domain_guid;
420 r.in.site_name = site_name;
421 r.in.flags = flags;
423 /* Out parameters */
424 r.out.dc_info = dc_info;
426 if (DEBUGLEVEL >= 10) {
427 NDR_PRINT_IN_DEBUG(DsGetDcName, &r);
430 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
431 werr = DsGetDcName_l(ctx, &r);
432 } else {
433 werr = DsGetDcName_r(ctx, &r);
436 r.out.result = W_ERROR_V(werr);
438 if (DEBUGLEVEL >= 10) {
439 NDR_PRINT_OUT_DEBUG(DsGetDcName, &r);
442 return r.out.result;
445 /****************************************************************
446 NetUserAdd
447 ****************************************************************/
449 NET_API_STATUS NetUserAdd(const char * server_name /* [in] [unique] */,
450 uint32_t level /* [in] */,
451 uint8_t *buffer /* [in] [ref] */,
452 uint32_t *parm_error /* [out] [ref] */)
454 struct NetUserAdd r;
455 struct libnetapi_ctx *ctx = NULL;
456 NET_API_STATUS status;
457 WERROR werr;
459 status = libnetapi_getctx(&ctx);
460 if (status != 0) {
461 return status;
464 /* In parameters */
465 r.in.server_name = server_name;
466 r.in.level = level;
467 r.in.buffer = buffer;
469 /* Out parameters */
470 r.out.parm_error = parm_error;
472 if (DEBUGLEVEL >= 10) {
473 NDR_PRINT_IN_DEBUG(NetUserAdd, &r);
476 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
477 werr = NetUserAdd_l(ctx, &r);
478 } else {
479 werr = NetUserAdd_r(ctx, &r);
482 r.out.result = W_ERROR_V(werr);
484 if (DEBUGLEVEL >= 10) {
485 NDR_PRINT_OUT_DEBUG(NetUserAdd, &r);
488 return r.out.result;
491 /****************************************************************
492 NetUserDel
493 ****************************************************************/
495 NET_API_STATUS NetUserDel(const char * server_name /* [in] [unique] */,
496 const char * user_name /* [in] [ref] */)
498 struct NetUserDel r;
499 struct libnetapi_ctx *ctx = NULL;
500 NET_API_STATUS status;
501 WERROR werr;
503 status = libnetapi_getctx(&ctx);
504 if (status != 0) {
505 return status;
508 /* In parameters */
509 r.in.server_name = server_name;
510 r.in.user_name = user_name;
512 /* Out parameters */
514 if (DEBUGLEVEL >= 10) {
515 NDR_PRINT_IN_DEBUG(NetUserDel, &r);
518 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
519 werr = NetUserDel_l(ctx, &r);
520 } else {
521 werr = NetUserDel_r(ctx, &r);
524 r.out.result = W_ERROR_V(werr);
526 if (DEBUGLEVEL >= 10) {
527 NDR_PRINT_OUT_DEBUG(NetUserDel, &r);
530 return r.out.result;
533 /****************************************************************
534 NetUserEnum
535 ****************************************************************/
537 NET_API_STATUS NetUserEnum(const char * server_name /* [in] [unique] */,
538 uint32_t level /* [in] */,
539 uint32_t filter /* [in] */,
540 uint8_t **buffer /* [out] [ref] */,
541 uint32_t prefmaxlen /* [in] */,
542 uint32_t *entries_read /* [out] [ref] */,
543 uint32_t *total_entries /* [out] [ref] */,
544 uint32_t *resume_handle /* [in,out] [ref] */)
546 struct NetUserEnum r;
547 struct libnetapi_ctx *ctx = NULL;
548 NET_API_STATUS status;
549 WERROR werr;
551 status = libnetapi_getctx(&ctx);
552 if (status != 0) {
553 return status;
556 /* In parameters */
557 r.in.server_name = server_name;
558 r.in.level = level;
559 r.in.filter = filter;
560 r.in.prefmaxlen = prefmaxlen;
561 r.in.resume_handle = resume_handle;
563 /* Out parameters */
564 r.out.buffer = buffer;
565 r.out.entries_read = entries_read;
566 r.out.total_entries = total_entries;
567 r.out.resume_handle = resume_handle;
569 if (DEBUGLEVEL >= 10) {
570 NDR_PRINT_IN_DEBUG(NetUserEnum, &r);
573 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
574 werr = NetUserEnum_l(ctx, &r);
575 } else {
576 werr = NetUserEnum_r(ctx, &r);
579 r.out.result = W_ERROR_V(werr);
581 if (DEBUGLEVEL >= 10) {
582 NDR_PRINT_OUT_DEBUG(NetUserEnum, &r);
585 return r.out.result;
588 /****************************************************************
589 NetUserChangePassword
590 ****************************************************************/
592 NET_API_STATUS NetUserChangePassword(const char * domain_name /* [in] */,
593 const char * user_name /* [in] */,
594 const char * old_password /* [in] */,
595 const char * new_password /* [in] */)
597 struct NetUserChangePassword r;
598 struct libnetapi_ctx *ctx = NULL;
599 NET_API_STATUS status;
600 WERROR werr;
602 status = libnetapi_getctx(&ctx);
603 if (status != 0) {
604 return status;
607 /* In parameters */
608 r.in.domain_name = domain_name;
609 r.in.user_name = user_name;
610 r.in.old_password = old_password;
611 r.in.new_password = new_password;
613 /* Out parameters */
615 if (DEBUGLEVEL >= 10) {
616 NDR_PRINT_IN_DEBUG(NetUserChangePassword, &r);
619 if (LIBNETAPI_LOCAL_SERVER(domain_name)) {
620 werr = NetUserChangePassword_l(ctx, &r);
621 } else {
622 werr = NetUserChangePassword_r(ctx, &r);
625 r.out.result = W_ERROR_V(werr);
627 if (DEBUGLEVEL >= 10) {
628 NDR_PRINT_OUT_DEBUG(NetUserChangePassword, &r);
631 return r.out.result;
634 /****************************************************************
635 NetUserGetInfo
636 ****************************************************************/
638 NET_API_STATUS NetUserGetInfo(const char * server_name /* [in] */,
639 const char * user_name /* [in] */,
640 uint32_t level /* [in] */,
641 uint8_t **buffer /* [out] [ref] */)
643 struct NetUserGetInfo r;
644 struct libnetapi_ctx *ctx = NULL;
645 NET_API_STATUS status;
646 WERROR werr;
648 status = libnetapi_getctx(&ctx);
649 if (status != 0) {
650 return status;
653 /* In parameters */
654 r.in.server_name = server_name;
655 r.in.user_name = user_name;
656 r.in.level = level;
658 /* Out parameters */
659 r.out.buffer = buffer;
661 if (DEBUGLEVEL >= 10) {
662 NDR_PRINT_IN_DEBUG(NetUserGetInfo, &r);
665 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
666 werr = NetUserGetInfo_l(ctx, &r);
667 } else {
668 werr = NetUserGetInfo_r(ctx, &r);
671 r.out.result = W_ERROR_V(werr);
673 if (DEBUGLEVEL >= 10) {
674 NDR_PRINT_OUT_DEBUG(NetUserGetInfo, &r);
677 return r.out.result;
680 /****************************************************************
681 NetUserSetInfo
682 ****************************************************************/
684 NET_API_STATUS NetUserSetInfo(const char * server_name /* [in] */,
685 const char * user_name /* [in] */,
686 uint32_t level /* [in] */,
687 uint8_t *buffer /* [in] [ref] */,
688 uint32_t *parm_err /* [out] [ref] */)
690 struct NetUserSetInfo r;
691 struct libnetapi_ctx *ctx = NULL;
692 NET_API_STATUS status;
693 WERROR werr;
695 status = libnetapi_getctx(&ctx);
696 if (status != 0) {
697 return status;
700 /* In parameters */
701 r.in.server_name = server_name;
702 r.in.user_name = user_name;
703 r.in.level = level;
704 r.in.buffer = buffer;
706 /* Out parameters */
707 r.out.parm_err = parm_err;
709 if (DEBUGLEVEL >= 10) {
710 NDR_PRINT_IN_DEBUG(NetUserSetInfo, &r);
713 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
714 werr = NetUserSetInfo_l(ctx, &r);
715 } else {
716 werr = NetUserSetInfo_r(ctx, &r);
719 r.out.result = W_ERROR_V(werr);
721 if (DEBUGLEVEL >= 10) {
722 NDR_PRINT_OUT_DEBUG(NetUserSetInfo, &r);
725 return r.out.result;
728 /****************************************************************
729 NetUserGetGroups
730 ****************************************************************/
732 NET_API_STATUS NetUserGetGroups(const char * server_name /* [in] */,
733 const char * user_name /* [in] */,
734 uint32_t level /* [in] */,
735 uint8_t **buffer /* [out] [ref] */,
736 uint32_t prefmaxlen /* [in] */,
737 uint32_t *entries_read /* [out] [ref] */,
738 uint32_t *total_entries /* [out] [ref] */)
740 struct NetUserGetGroups r;
741 struct libnetapi_ctx *ctx = NULL;
742 NET_API_STATUS status;
743 WERROR werr;
745 status = libnetapi_getctx(&ctx);
746 if (status != 0) {
747 return status;
750 /* In parameters */
751 r.in.server_name = server_name;
752 r.in.user_name = user_name;
753 r.in.level = level;
754 r.in.prefmaxlen = prefmaxlen;
756 /* Out parameters */
757 r.out.buffer = buffer;
758 r.out.entries_read = entries_read;
759 r.out.total_entries = total_entries;
761 if (DEBUGLEVEL >= 10) {
762 NDR_PRINT_IN_DEBUG(NetUserGetGroups, &r);
765 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
766 werr = NetUserGetGroups_l(ctx, &r);
767 } else {
768 werr = NetUserGetGroups_r(ctx, &r);
771 r.out.result = W_ERROR_V(werr);
773 if (DEBUGLEVEL >= 10) {
774 NDR_PRINT_OUT_DEBUG(NetUserGetGroups, &r);
777 return r.out.result;
780 /****************************************************************
781 NetUserModalsGet
782 ****************************************************************/
784 NET_API_STATUS NetUserModalsGet(const char * server_name /* [in] */,
785 uint32_t level /* [in] */,
786 uint8_t **buffer /* [out] [ref] */)
788 struct NetUserModalsGet r;
789 struct libnetapi_ctx *ctx = NULL;
790 NET_API_STATUS status;
791 WERROR werr;
793 status = libnetapi_getctx(&ctx);
794 if (status != 0) {
795 return status;
798 /* In parameters */
799 r.in.server_name = server_name;
800 r.in.level = level;
802 /* Out parameters */
803 r.out.buffer = buffer;
805 if (DEBUGLEVEL >= 10) {
806 NDR_PRINT_IN_DEBUG(NetUserModalsGet, &r);
809 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
810 werr = NetUserModalsGet_l(ctx, &r);
811 } else {
812 werr = NetUserModalsGet_r(ctx, &r);
815 r.out.result = W_ERROR_V(werr);
817 if (DEBUGLEVEL >= 10) {
818 NDR_PRINT_OUT_DEBUG(NetUserModalsGet, &r);
821 return r.out.result;
824 /****************************************************************
825 NetUserModalsSet
826 ****************************************************************/
828 NET_API_STATUS NetUserModalsSet(const char * server_name /* [in] */,
829 uint32_t level /* [in] */,
830 uint8_t *buffer /* [in] [ref] */,
831 uint32_t *parm_err /* [out] [ref] */)
833 struct NetUserModalsSet r;
834 struct libnetapi_ctx *ctx = NULL;
835 NET_API_STATUS status;
836 WERROR werr;
838 status = libnetapi_getctx(&ctx);
839 if (status != 0) {
840 return status;
843 /* In parameters */
844 r.in.server_name = server_name;
845 r.in.level = level;
846 r.in.buffer = buffer;
848 /* Out parameters */
849 r.out.parm_err = parm_err;
851 if (DEBUGLEVEL >= 10) {
852 NDR_PRINT_IN_DEBUG(NetUserModalsSet, &r);
855 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
856 werr = NetUserModalsSet_l(ctx, &r);
857 } else {
858 werr = NetUserModalsSet_r(ctx, &r);
861 r.out.result = W_ERROR_V(werr);
863 if (DEBUGLEVEL >= 10) {
864 NDR_PRINT_OUT_DEBUG(NetUserModalsSet, &r);
867 return r.out.result;
870 /****************************************************************
871 NetQueryDisplayInformation
872 ****************************************************************/
874 NET_API_STATUS NetQueryDisplayInformation(const char * server_name /* [in] [unique] */,
875 uint32_t level /* [in] */,
876 uint32_t idx /* [in] */,
877 uint32_t entries_requested /* [in] */,
878 uint32_t prefmaxlen /* [in] */,
879 uint32_t *entries_read /* [out] [ref] */,
880 void **buffer /* [out] [noprint,ref] */)
882 struct NetQueryDisplayInformation r;
883 struct libnetapi_ctx *ctx = NULL;
884 NET_API_STATUS status;
885 WERROR werr;
887 status = libnetapi_getctx(&ctx);
888 if (status != 0) {
889 return status;
892 /* In parameters */
893 r.in.server_name = server_name;
894 r.in.level = level;
895 r.in.idx = idx;
896 r.in.entries_requested = entries_requested;
897 r.in.prefmaxlen = prefmaxlen;
899 /* Out parameters */
900 r.out.entries_read = entries_read;
901 r.out.buffer = buffer;
903 if (DEBUGLEVEL >= 10) {
904 NDR_PRINT_IN_DEBUG(NetQueryDisplayInformation, &r);
907 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
908 werr = NetQueryDisplayInformation_l(ctx, &r);
909 } else {
910 werr = NetQueryDisplayInformation_r(ctx, &r);
913 r.out.result = W_ERROR_V(werr);
915 if (DEBUGLEVEL >= 10) {
916 NDR_PRINT_OUT_DEBUG(NetQueryDisplayInformation, &r);
919 return r.out.result;
922 /****************************************************************
923 NetGroupAdd
924 ****************************************************************/
926 NET_API_STATUS NetGroupAdd(const char * server_name /* [in] */,
927 uint32_t level /* [in] */,
928 uint8_t *buffer /* [in] [ref] */,
929 uint32_t *parm_err /* [out] [ref] */)
931 struct NetGroupAdd r;
932 struct libnetapi_ctx *ctx = NULL;
933 NET_API_STATUS status;
934 WERROR werr;
936 status = libnetapi_getctx(&ctx);
937 if (status != 0) {
938 return status;
941 /* In parameters */
942 r.in.server_name = server_name;
943 r.in.level = level;
944 r.in.buffer = buffer;
946 /* Out parameters */
947 r.out.parm_err = parm_err;
949 if (DEBUGLEVEL >= 10) {
950 NDR_PRINT_IN_DEBUG(NetGroupAdd, &r);
953 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
954 werr = NetGroupAdd_l(ctx, &r);
955 } else {
956 werr = NetGroupAdd_r(ctx, &r);
959 r.out.result = W_ERROR_V(werr);
961 if (DEBUGLEVEL >= 10) {
962 NDR_PRINT_OUT_DEBUG(NetGroupAdd, &r);
965 return r.out.result;
968 /****************************************************************
969 NetGroupDel
970 ****************************************************************/
972 NET_API_STATUS NetGroupDel(const char * server_name /* [in] */,
973 const char * group_name /* [in] */)
975 struct NetGroupDel r;
976 struct libnetapi_ctx *ctx = NULL;
977 NET_API_STATUS status;
978 WERROR werr;
980 status = libnetapi_getctx(&ctx);
981 if (status != 0) {
982 return status;
985 /* In parameters */
986 r.in.server_name = server_name;
987 r.in.group_name = group_name;
989 /* Out parameters */
991 if (DEBUGLEVEL >= 10) {
992 NDR_PRINT_IN_DEBUG(NetGroupDel, &r);
995 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
996 werr = NetGroupDel_l(ctx, &r);
997 } else {
998 werr = NetGroupDel_r(ctx, &r);
1001 r.out.result = W_ERROR_V(werr);
1003 if (DEBUGLEVEL >= 10) {
1004 NDR_PRINT_OUT_DEBUG(NetGroupDel, &r);
1007 return r.out.result;
1010 /****************************************************************
1011 NetGroupEnum
1012 ****************************************************************/
1014 NET_API_STATUS NetGroupEnum(const char * server_name /* [in] */,
1015 uint32_t level /* [in] */,
1016 uint8_t **buffer /* [out] [ref] */,
1017 uint32_t prefmaxlen /* [in] */,
1018 uint32_t *entries_read /* [out] [ref] */,
1019 uint32_t *total_entries /* [out] [ref] */,
1020 uint32_t *resume_handle /* [in,out] [ref] */)
1022 struct NetGroupEnum r;
1023 struct libnetapi_ctx *ctx = NULL;
1024 NET_API_STATUS status;
1025 WERROR werr;
1027 status = libnetapi_getctx(&ctx);
1028 if (status != 0) {
1029 return status;
1032 /* In parameters */
1033 r.in.server_name = server_name;
1034 r.in.level = level;
1035 r.in.prefmaxlen = prefmaxlen;
1036 r.in.resume_handle = resume_handle;
1038 /* Out parameters */
1039 r.out.buffer = buffer;
1040 r.out.entries_read = entries_read;
1041 r.out.total_entries = total_entries;
1042 r.out.resume_handle = resume_handle;
1044 if (DEBUGLEVEL >= 10) {
1045 NDR_PRINT_IN_DEBUG(NetGroupEnum, &r);
1048 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1049 werr = NetGroupEnum_l(ctx, &r);
1050 } else {
1051 werr = NetGroupEnum_r(ctx, &r);
1054 r.out.result = W_ERROR_V(werr);
1056 if (DEBUGLEVEL >= 10) {
1057 NDR_PRINT_OUT_DEBUG(NetGroupEnum, &r);
1060 return r.out.result;
1063 /****************************************************************
1064 NetGroupSetInfo
1065 ****************************************************************/
1067 NET_API_STATUS NetGroupSetInfo(const char * server_name /* [in] */,
1068 const char * group_name /* [in] */,
1069 uint32_t level /* [in] */,
1070 uint8_t *buffer /* [in] [ref] */,
1071 uint32_t *parm_err /* [out] [ref] */)
1073 struct NetGroupSetInfo r;
1074 struct libnetapi_ctx *ctx = NULL;
1075 NET_API_STATUS status;
1076 WERROR werr;
1078 status = libnetapi_getctx(&ctx);
1079 if (status != 0) {
1080 return status;
1083 /* In parameters */
1084 r.in.server_name = server_name;
1085 r.in.group_name = group_name;
1086 r.in.level = level;
1087 r.in.buffer = buffer;
1089 /* Out parameters */
1090 r.out.parm_err = parm_err;
1092 if (DEBUGLEVEL >= 10) {
1093 NDR_PRINT_IN_DEBUG(NetGroupSetInfo, &r);
1096 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1097 werr = NetGroupSetInfo_l(ctx, &r);
1098 } else {
1099 werr = NetGroupSetInfo_r(ctx, &r);
1102 r.out.result = W_ERROR_V(werr);
1104 if (DEBUGLEVEL >= 10) {
1105 NDR_PRINT_OUT_DEBUG(NetGroupSetInfo, &r);
1108 return r.out.result;
1111 /****************************************************************
1112 NetGroupGetInfo
1113 ****************************************************************/
1115 NET_API_STATUS NetGroupGetInfo(const char * server_name /* [in] */,
1116 const char * group_name /* [in] */,
1117 uint32_t level /* [in] */,
1118 uint8_t **buffer /* [out] [ref] */)
1120 struct NetGroupGetInfo r;
1121 struct libnetapi_ctx *ctx = NULL;
1122 NET_API_STATUS status;
1123 WERROR werr;
1125 status = libnetapi_getctx(&ctx);
1126 if (status != 0) {
1127 return status;
1130 /* In parameters */
1131 r.in.server_name = server_name;
1132 r.in.group_name = group_name;
1133 r.in.level = level;
1135 /* Out parameters */
1136 r.out.buffer = buffer;
1138 if (DEBUGLEVEL >= 10) {
1139 NDR_PRINT_IN_DEBUG(NetGroupGetInfo, &r);
1142 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1143 werr = NetGroupGetInfo_l(ctx, &r);
1144 } else {
1145 werr = NetGroupGetInfo_r(ctx, &r);
1148 r.out.result = W_ERROR_V(werr);
1150 if (DEBUGLEVEL >= 10) {
1151 NDR_PRINT_OUT_DEBUG(NetGroupGetInfo, &r);
1154 return r.out.result;
1157 /****************************************************************
1158 NetGroupAddUser
1159 ****************************************************************/
1161 NET_API_STATUS NetGroupAddUser(const char * server_name /* [in] */,
1162 const char * group_name /* [in] */,
1163 const char * user_name /* [in] */)
1165 struct NetGroupAddUser r;
1166 struct libnetapi_ctx *ctx = NULL;
1167 NET_API_STATUS status;
1168 WERROR werr;
1170 status = libnetapi_getctx(&ctx);
1171 if (status != 0) {
1172 return status;
1175 /* In parameters */
1176 r.in.server_name = server_name;
1177 r.in.group_name = group_name;
1178 r.in.user_name = user_name;
1180 /* Out parameters */
1182 if (DEBUGLEVEL >= 10) {
1183 NDR_PRINT_IN_DEBUG(NetGroupAddUser, &r);
1186 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1187 werr = NetGroupAddUser_l(ctx, &r);
1188 } else {
1189 werr = NetGroupAddUser_r(ctx, &r);
1192 r.out.result = W_ERROR_V(werr);
1194 if (DEBUGLEVEL >= 10) {
1195 NDR_PRINT_OUT_DEBUG(NetGroupAddUser, &r);
1198 return r.out.result;
1201 /****************************************************************
1202 NetGroupDelUser
1203 ****************************************************************/
1205 NET_API_STATUS NetGroupDelUser(const char * server_name /* [in] */,
1206 const char * group_name /* [in] */,
1207 const char * user_name /* [in] */)
1209 struct NetGroupDelUser r;
1210 struct libnetapi_ctx *ctx = NULL;
1211 NET_API_STATUS status;
1212 WERROR werr;
1214 status = libnetapi_getctx(&ctx);
1215 if (status != 0) {
1216 return status;
1219 /* In parameters */
1220 r.in.server_name = server_name;
1221 r.in.group_name = group_name;
1222 r.in.user_name = user_name;
1224 /* Out parameters */
1226 if (DEBUGLEVEL >= 10) {
1227 NDR_PRINT_IN_DEBUG(NetGroupDelUser, &r);
1230 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1231 werr = NetGroupDelUser_l(ctx, &r);
1232 } else {
1233 werr = NetGroupDelUser_r(ctx, &r);
1236 r.out.result = W_ERROR_V(werr);
1238 if (DEBUGLEVEL >= 10) {
1239 NDR_PRINT_OUT_DEBUG(NetGroupDelUser, &r);
1242 return r.out.result;
1245 /****************************************************************
1246 NetGroupGetUsers
1247 ****************************************************************/
1249 NET_API_STATUS NetGroupGetUsers(const char * server_name /* [in] */,
1250 const char * group_name /* [in] */,
1251 uint32_t level /* [in] */,
1252 uint8_t **buffer /* [out] [ref] */,
1253 uint32_t prefmaxlen /* [in] */,
1254 uint32_t *entries_read /* [out] [ref] */,
1255 uint32_t *total_entries /* [out] [ref] */,
1256 uint32_t *resume_handle /* [in,out] [ref] */)
1258 struct NetGroupGetUsers r;
1259 struct libnetapi_ctx *ctx = NULL;
1260 NET_API_STATUS status;
1261 WERROR werr;
1263 status = libnetapi_getctx(&ctx);
1264 if (status != 0) {
1265 return status;
1268 /* In parameters */
1269 r.in.server_name = server_name;
1270 r.in.group_name = group_name;
1271 r.in.level = level;
1272 r.in.prefmaxlen = prefmaxlen;
1273 r.in.resume_handle = resume_handle;
1275 /* Out parameters */
1276 r.out.buffer = buffer;
1277 r.out.entries_read = entries_read;
1278 r.out.total_entries = total_entries;
1279 r.out.resume_handle = resume_handle;
1281 if (DEBUGLEVEL >= 10) {
1282 NDR_PRINT_IN_DEBUG(NetGroupGetUsers, &r);
1285 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1286 werr = NetGroupGetUsers_l(ctx, &r);
1287 } else {
1288 werr = NetGroupGetUsers_r(ctx, &r);
1291 r.out.result = W_ERROR_V(werr);
1293 if (DEBUGLEVEL >= 10) {
1294 NDR_PRINT_OUT_DEBUG(NetGroupGetUsers, &r);
1297 return r.out.result;
1300 /****************************************************************
1301 NetLocalGroupAdd
1302 ****************************************************************/
1304 NET_API_STATUS NetLocalGroupAdd(const char * server_name /* [in] */,
1305 uint32_t level /* [in] */,
1306 uint8_t *buffer /* [in] [ref] */,
1307 uint32_t *parm_err /* [out] [ref] */)
1309 struct NetLocalGroupAdd r;
1310 struct libnetapi_ctx *ctx = NULL;
1311 NET_API_STATUS status;
1312 WERROR werr;
1314 status = libnetapi_getctx(&ctx);
1315 if (status != 0) {
1316 return status;
1319 /* In parameters */
1320 r.in.server_name = server_name;
1321 r.in.level = level;
1322 r.in.buffer = buffer;
1324 /* Out parameters */
1325 r.out.parm_err = parm_err;
1327 if (DEBUGLEVEL >= 10) {
1328 NDR_PRINT_IN_DEBUG(NetLocalGroupAdd, &r);
1331 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1332 werr = NetLocalGroupAdd_l(ctx, &r);
1333 } else {
1334 werr = NetLocalGroupAdd_r(ctx, &r);
1337 r.out.result = W_ERROR_V(werr);
1339 if (DEBUGLEVEL >= 10) {
1340 NDR_PRINT_OUT_DEBUG(NetLocalGroupAdd, &r);
1343 return r.out.result;
1346 /****************************************************************
1347 NetLocalGroupDel
1348 ****************************************************************/
1350 NET_API_STATUS NetLocalGroupDel(const char * server_name /* [in] */,
1351 const char * group_name /* [in] */)
1353 struct NetLocalGroupDel r;
1354 struct libnetapi_ctx *ctx = NULL;
1355 NET_API_STATUS status;
1356 WERROR werr;
1358 status = libnetapi_getctx(&ctx);
1359 if (status != 0) {
1360 return status;
1363 /* In parameters */
1364 r.in.server_name = server_name;
1365 r.in.group_name = group_name;
1367 /* Out parameters */
1369 if (DEBUGLEVEL >= 10) {
1370 NDR_PRINT_IN_DEBUG(NetLocalGroupDel, &r);
1373 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1374 werr = NetLocalGroupDel_l(ctx, &r);
1375 } else {
1376 werr = NetLocalGroupDel_r(ctx, &r);
1379 r.out.result = W_ERROR_V(werr);
1381 if (DEBUGLEVEL >= 10) {
1382 NDR_PRINT_OUT_DEBUG(NetLocalGroupDel, &r);
1385 return r.out.result;
1388 /****************************************************************
1389 NetLocalGroupGetInfo
1390 ****************************************************************/
1392 NET_API_STATUS NetLocalGroupGetInfo(const char * server_name /* [in] */,
1393 const char * group_name /* [in] */,
1394 uint32_t level /* [in] */,
1395 uint8_t **buffer /* [out] [ref] */)
1397 struct NetLocalGroupGetInfo r;
1398 struct libnetapi_ctx *ctx = NULL;
1399 NET_API_STATUS status;
1400 WERROR werr;
1402 status = libnetapi_getctx(&ctx);
1403 if (status != 0) {
1404 return status;
1407 /* In parameters */
1408 r.in.server_name = server_name;
1409 r.in.group_name = group_name;
1410 r.in.level = level;
1412 /* Out parameters */
1413 r.out.buffer = buffer;
1415 if (DEBUGLEVEL >= 10) {
1416 NDR_PRINT_IN_DEBUG(NetLocalGroupGetInfo, &r);
1419 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1420 werr = NetLocalGroupGetInfo_l(ctx, &r);
1421 } else {
1422 werr = NetLocalGroupGetInfo_r(ctx, &r);
1425 r.out.result = W_ERROR_V(werr);
1427 if (DEBUGLEVEL >= 10) {
1428 NDR_PRINT_OUT_DEBUG(NetLocalGroupGetInfo, &r);
1431 return r.out.result;
1434 /****************************************************************
1435 NetLocalGroupSetInfo
1436 ****************************************************************/
1438 NET_API_STATUS NetLocalGroupSetInfo(const char * server_name /* [in] */,
1439 const char * group_name /* [in] */,
1440 uint32_t level /* [in] */,
1441 uint8_t *buffer /* [in] [ref] */,
1442 uint32_t *parm_err /* [out] [ref] */)
1444 struct NetLocalGroupSetInfo r;
1445 struct libnetapi_ctx *ctx = NULL;
1446 NET_API_STATUS status;
1447 WERROR werr;
1449 status = libnetapi_getctx(&ctx);
1450 if (status != 0) {
1451 return status;
1454 /* In parameters */
1455 r.in.server_name = server_name;
1456 r.in.group_name = group_name;
1457 r.in.level = level;
1458 r.in.buffer = buffer;
1460 /* Out parameters */
1461 r.out.parm_err = parm_err;
1463 if (DEBUGLEVEL >= 10) {
1464 NDR_PRINT_IN_DEBUG(NetLocalGroupSetInfo, &r);
1467 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1468 werr = NetLocalGroupSetInfo_l(ctx, &r);
1469 } else {
1470 werr = NetLocalGroupSetInfo_r(ctx, &r);
1473 r.out.result = W_ERROR_V(werr);
1475 if (DEBUGLEVEL >= 10) {
1476 NDR_PRINT_OUT_DEBUG(NetLocalGroupSetInfo, &r);
1479 return r.out.result;
1482 /****************************************************************
1483 NetLocalGroupEnum
1484 ****************************************************************/
1486 NET_API_STATUS NetLocalGroupEnum(const char * server_name /* [in] */,
1487 uint32_t level /* [in] */,
1488 uint8_t **buffer /* [out] [ref] */,
1489 uint32_t prefmaxlen /* [in] */,
1490 uint32_t *entries_read /* [out] [ref] */,
1491 uint32_t *total_entries /* [out] [ref] */,
1492 uint32_t *resume_handle /* [in,out] [ref] */)
1494 struct NetLocalGroupEnum r;
1495 struct libnetapi_ctx *ctx = NULL;
1496 NET_API_STATUS status;
1497 WERROR werr;
1499 status = libnetapi_getctx(&ctx);
1500 if (status != 0) {
1501 return status;
1504 /* In parameters */
1505 r.in.server_name = server_name;
1506 r.in.level = level;
1507 r.in.prefmaxlen = prefmaxlen;
1508 r.in.resume_handle = resume_handle;
1510 /* Out parameters */
1511 r.out.buffer = buffer;
1512 r.out.entries_read = entries_read;
1513 r.out.total_entries = total_entries;
1514 r.out.resume_handle = resume_handle;
1516 if (DEBUGLEVEL >= 10) {
1517 NDR_PRINT_IN_DEBUG(NetLocalGroupEnum, &r);
1520 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1521 werr = NetLocalGroupEnum_l(ctx, &r);
1522 } else {
1523 werr = NetLocalGroupEnum_r(ctx, &r);
1526 r.out.result = W_ERROR_V(werr);
1528 if (DEBUGLEVEL >= 10) {
1529 NDR_PRINT_OUT_DEBUG(NetLocalGroupEnum, &r);
1532 return r.out.result;
1535 /****************************************************************
1536 NetLocalGroupAddMembers
1537 ****************************************************************/
1539 NET_API_STATUS NetLocalGroupAddMembers(const char * server_name /* [in] */,
1540 const char * group_name /* [in] */,
1541 uint32_t level /* [in] */,
1542 uint8_t *buffer /* [in] [ref] */,
1543 uint32_t total_entries /* [in] */)
1545 struct NetLocalGroupAddMembers r;
1546 struct libnetapi_ctx *ctx = NULL;
1547 NET_API_STATUS status;
1548 WERROR werr;
1550 status = libnetapi_getctx(&ctx);
1551 if (status != 0) {
1552 return status;
1555 /* In parameters */
1556 r.in.server_name = server_name;
1557 r.in.group_name = group_name;
1558 r.in.level = level;
1559 r.in.buffer = buffer;
1560 r.in.total_entries = total_entries;
1562 /* Out parameters */
1564 if (DEBUGLEVEL >= 10) {
1565 NDR_PRINT_IN_DEBUG(NetLocalGroupAddMembers, &r);
1568 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1569 werr = NetLocalGroupAddMembers_l(ctx, &r);
1570 } else {
1571 werr = NetLocalGroupAddMembers_r(ctx, &r);
1574 r.out.result = W_ERROR_V(werr);
1576 if (DEBUGLEVEL >= 10) {
1577 NDR_PRINT_OUT_DEBUG(NetLocalGroupAddMembers, &r);
1580 return r.out.result;
1583 /****************************************************************
1584 NetLocalGroupDelMembers
1585 ****************************************************************/
1587 NET_API_STATUS NetLocalGroupDelMembers(const char * server_name /* [in] */,
1588 const char * group_name /* [in] */,
1589 uint32_t level /* [in] */,
1590 uint8_t *buffer /* [in] [ref] */,
1591 uint32_t total_entries /* [in] */)
1593 struct NetLocalGroupDelMembers r;
1594 struct libnetapi_ctx *ctx = NULL;
1595 NET_API_STATUS status;
1596 WERROR werr;
1598 status = libnetapi_getctx(&ctx);
1599 if (status != 0) {
1600 return status;
1603 /* In parameters */
1604 r.in.server_name = server_name;
1605 r.in.group_name = group_name;
1606 r.in.level = level;
1607 r.in.buffer = buffer;
1608 r.in.total_entries = total_entries;
1610 /* Out parameters */
1612 if (DEBUGLEVEL >= 10) {
1613 NDR_PRINT_IN_DEBUG(NetLocalGroupDelMembers, &r);
1616 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1617 werr = NetLocalGroupDelMembers_l(ctx, &r);
1618 } else {
1619 werr = NetLocalGroupDelMembers_r(ctx, &r);
1622 r.out.result = W_ERROR_V(werr);
1624 if (DEBUGLEVEL >= 10) {
1625 NDR_PRINT_OUT_DEBUG(NetLocalGroupDelMembers, &r);
1628 return r.out.result;
1631 /****************************************************************
1632 NetLocalGroupGetMembers
1633 ****************************************************************/
1635 NET_API_STATUS NetLocalGroupGetMembers(const char * server_name /* [in] */,
1636 const char * local_group_name /* [in] */,
1637 uint32_t level /* [in] */,
1638 uint8_t **buffer /* [out] [ref] */,
1639 uint32_t prefmaxlen /* [in] */,
1640 uint32_t *entries_read /* [out] [ref] */,
1641 uint32_t *total_entries /* [out] [ref] */,
1642 uint32_t *resume_handle /* [in,out] [ref] */)
1644 struct NetLocalGroupGetMembers r;
1645 struct libnetapi_ctx *ctx = NULL;
1646 NET_API_STATUS status;
1647 WERROR werr;
1649 status = libnetapi_getctx(&ctx);
1650 if (status != 0) {
1651 return status;
1654 /* In parameters */
1655 r.in.server_name = server_name;
1656 r.in.local_group_name = local_group_name;
1657 r.in.level = level;
1658 r.in.prefmaxlen = prefmaxlen;
1659 r.in.resume_handle = resume_handle;
1661 /* Out parameters */
1662 r.out.buffer = buffer;
1663 r.out.entries_read = entries_read;
1664 r.out.total_entries = total_entries;
1665 r.out.resume_handle = resume_handle;
1667 if (DEBUGLEVEL >= 10) {
1668 NDR_PRINT_IN_DEBUG(NetLocalGroupGetMembers, &r);
1671 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1672 werr = NetLocalGroupGetMembers_l(ctx, &r);
1673 } else {
1674 werr = NetLocalGroupGetMembers_r(ctx, &r);
1677 r.out.result = W_ERROR_V(werr);
1679 if (DEBUGLEVEL >= 10) {
1680 NDR_PRINT_OUT_DEBUG(NetLocalGroupGetMembers, &r);
1683 return r.out.result;
1686 /****************************************************************
1687 NetLocalGroupSetMembers
1688 ****************************************************************/
1690 NET_API_STATUS NetLocalGroupSetMembers(const char * server_name /* [in] */,
1691 const char * group_name /* [in] */,
1692 uint32_t level /* [in] */,
1693 uint8_t *buffer /* [in] [ref] */,
1694 uint32_t total_entries /* [in] */)
1696 struct NetLocalGroupSetMembers r;
1697 struct libnetapi_ctx *ctx = NULL;
1698 NET_API_STATUS status;
1699 WERROR werr;
1701 status = libnetapi_getctx(&ctx);
1702 if (status != 0) {
1703 return status;
1706 /* In parameters */
1707 r.in.server_name = server_name;
1708 r.in.group_name = group_name;
1709 r.in.level = level;
1710 r.in.buffer = buffer;
1711 r.in.total_entries = total_entries;
1713 /* Out parameters */
1715 if (DEBUGLEVEL >= 10) {
1716 NDR_PRINT_IN_DEBUG(NetLocalGroupSetMembers, &r);
1719 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1720 werr = NetLocalGroupSetMembers_l(ctx, &r);
1721 } else {
1722 werr = NetLocalGroupSetMembers_r(ctx, &r);
1725 r.out.result = W_ERROR_V(werr);
1727 if (DEBUGLEVEL >= 10) {
1728 NDR_PRINT_OUT_DEBUG(NetLocalGroupSetMembers, &r);
1731 return r.out.result;
1734 /****************************************************************
1735 NetRemoteTOD
1736 ****************************************************************/
1738 NET_API_STATUS NetRemoteTOD(const char * server_name /* [in] */,
1739 uint8_t **buffer /* [out] [ref] */)
1741 struct NetRemoteTOD r;
1742 struct libnetapi_ctx *ctx = NULL;
1743 NET_API_STATUS status;
1744 WERROR werr;
1746 status = libnetapi_getctx(&ctx);
1747 if (status != 0) {
1748 return status;
1751 /* In parameters */
1752 r.in.server_name = server_name;
1754 /* Out parameters */
1755 r.out.buffer = buffer;
1757 if (DEBUGLEVEL >= 10) {
1758 NDR_PRINT_IN_DEBUG(NetRemoteTOD, &r);
1761 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1762 werr = NetRemoteTOD_l(ctx, &r);
1763 } else {
1764 werr = NetRemoteTOD_r(ctx, &r);
1767 r.out.result = W_ERROR_V(werr);
1769 if (DEBUGLEVEL >= 10) {
1770 NDR_PRINT_OUT_DEBUG(NetRemoteTOD, &r);
1773 return r.out.result;