2 * Unix SMB/CIFS implementation.
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/>.
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 /****************************************************************
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;
43 status = libnetapi_getctx(&ctx);
51 r.in.account_ou = account_ou;
52 r.in.account = account;
53 r.in.password = password;
54 r.in.join_flags = join_flags;
58 if (DEBUGLEVEL >= 10) {
59 NDR_PRINT_IN_DEBUG(NetJoinDomain, &r);
62 if (LIBNETAPI_LOCAL_SERVER(server)) {
63 werr = NetJoinDomain_l(ctx, &r);
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);
77 /****************************************************************
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;
91 status = libnetapi_getctx(&ctx);
97 r.in.server_name = server_name;
98 r.in.account = account;
99 r.in.password = password;
100 r.in.unjoin_flags = unjoin_flags;
104 if (DEBUGLEVEL >= 10) {
105 NDR_PRINT_IN_DEBUG(NetUnjoinDomain, &r);
108 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
109 werr = NetUnjoinDomain_l(ctx, &r);
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);
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;
136 status = libnetapi_getctx(&ctx);
142 r.in.server_name = server_name;
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);
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);
167 /****************************************************************
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;
183 status = libnetapi_getctx(&ctx);
189 r.in.server_name = server_name;
190 r.in.domain = domain;
191 r.in.account = account;
192 r.in.password = password;
195 r.out.ou_count = ou_count;
198 if (DEBUGLEVEL >= 10) {
199 NDR_PRINT_IN_DEBUG(NetGetJoinableOUs, &r);
202 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
203 werr = NetGetJoinableOUs_l(ctx, &r);
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);
217 /****************************************************************
218 NetRenameMachineInDomain
219 ****************************************************************/
221 NET_API_STATUS NetRenameMachineInDomain(const char * server_name /* [in] */,
222 const char * new_machine_name /* [in] */,
223 const char * account /* [in] */,
224 const char * password /* [in] */,
225 uint32_t rename_options /* [in] */)
227 struct NetRenameMachineInDomain r;
228 struct libnetapi_ctx *ctx = NULL;
229 NET_API_STATUS status;
232 status = libnetapi_getctx(&ctx);
238 r.in.server_name = server_name;
239 r.in.new_machine_name = new_machine_name;
240 r.in.account = account;
241 r.in.password = password;
242 r.in.rename_options = rename_options;
246 if (DEBUGLEVEL >= 10) {
247 NDR_PRINT_IN_DEBUG(NetRenameMachineInDomain, &r);
250 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
251 werr = NetRenameMachineInDomain_l(ctx, &r);
253 werr = NetRenameMachineInDomain_r(ctx, &r);
256 r.out.result = W_ERROR_V(werr);
258 if (DEBUGLEVEL >= 10) {
259 NDR_PRINT_OUT_DEBUG(NetRenameMachineInDomain, &r);
265 /****************************************************************
267 ****************************************************************/
269 NET_API_STATUS NetServerGetInfo(const char * server_name /* [in] [unique] */,
270 uint32_t level /* [in] */,
271 uint8_t **buffer /* [out] [ref] */)
273 struct NetServerGetInfo r;
274 struct libnetapi_ctx *ctx = NULL;
275 NET_API_STATUS status;
278 status = libnetapi_getctx(&ctx);
284 r.in.server_name = server_name;
288 r.out.buffer = buffer;
290 if (DEBUGLEVEL >= 10) {
291 NDR_PRINT_IN_DEBUG(NetServerGetInfo, &r);
294 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
295 werr = NetServerGetInfo_l(ctx, &r);
297 werr = NetServerGetInfo_r(ctx, &r);
300 r.out.result = W_ERROR_V(werr);
302 if (DEBUGLEVEL >= 10) {
303 NDR_PRINT_OUT_DEBUG(NetServerGetInfo, &r);
309 /****************************************************************
311 ****************************************************************/
313 NET_API_STATUS NetServerSetInfo(const char * server_name /* [in] [unique] */,
314 uint32_t level /* [in] */,
315 uint8_t *buffer /* [in] [ref] */,
316 uint32_t *parm_error /* [out] [ref] */)
318 struct NetServerSetInfo r;
319 struct libnetapi_ctx *ctx = NULL;
320 NET_API_STATUS status;
323 status = libnetapi_getctx(&ctx);
329 r.in.server_name = server_name;
331 r.in.buffer = buffer;
334 r.out.parm_error = parm_error;
336 if (DEBUGLEVEL >= 10) {
337 NDR_PRINT_IN_DEBUG(NetServerSetInfo, &r);
340 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
341 werr = NetServerSetInfo_l(ctx, &r);
343 werr = NetServerSetInfo_r(ctx, &r);
346 r.out.result = W_ERROR_V(werr);
348 if (DEBUGLEVEL >= 10) {
349 NDR_PRINT_OUT_DEBUG(NetServerSetInfo, &r);
355 /****************************************************************
357 ****************************************************************/
359 NET_API_STATUS NetGetDCName(const char * server_name /* [in] [unique] */,
360 const char * domain_name /* [in] [unique] */,
361 uint8_t **buffer /* [out] [ref] */)
363 struct NetGetDCName r;
364 struct libnetapi_ctx *ctx = NULL;
365 NET_API_STATUS status;
368 status = libnetapi_getctx(&ctx);
374 r.in.server_name = server_name;
375 r.in.domain_name = domain_name;
378 r.out.buffer = buffer;
380 if (DEBUGLEVEL >= 10) {
381 NDR_PRINT_IN_DEBUG(NetGetDCName, &r);
384 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
385 werr = NetGetDCName_l(ctx, &r);
387 werr = NetGetDCName_r(ctx, &r);
390 r.out.result = W_ERROR_V(werr);
392 if (DEBUGLEVEL >= 10) {
393 NDR_PRINT_OUT_DEBUG(NetGetDCName, &r);
399 /****************************************************************
401 ****************************************************************/
403 NET_API_STATUS NetGetAnyDCName(const char * server_name /* [in] [unique] */,
404 const char * domain_name /* [in] [unique] */,
405 uint8_t **buffer /* [out] [ref] */)
407 struct NetGetAnyDCName r;
408 struct libnetapi_ctx *ctx = NULL;
409 NET_API_STATUS status;
412 status = libnetapi_getctx(&ctx);
418 r.in.server_name = server_name;
419 r.in.domain_name = domain_name;
422 r.out.buffer = buffer;
424 if (DEBUGLEVEL >= 10) {
425 NDR_PRINT_IN_DEBUG(NetGetAnyDCName, &r);
428 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
429 werr = NetGetAnyDCName_l(ctx, &r);
431 werr = NetGetAnyDCName_r(ctx, &r);
434 r.out.result = W_ERROR_V(werr);
436 if (DEBUGLEVEL >= 10) {
437 NDR_PRINT_OUT_DEBUG(NetGetAnyDCName, &r);
443 /****************************************************************
445 ****************************************************************/
447 NET_API_STATUS DsGetDcName(const char * server_name /* [in] [unique] */,
448 const char * domain_name /* [in] [ref] */,
449 struct GUID *domain_guid /* [in] [unique] */,
450 const char * site_name /* [in] [unique] */,
451 uint32_t flags /* [in] */,
452 struct DOMAIN_CONTROLLER_INFO **dc_info /* [out] [ref] */)
454 struct DsGetDcName r;
455 struct libnetapi_ctx *ctx = NULL;
456 NET_API_STATUS status;
459 status = libnetapi_getctx(&ctx);
465 r.in.server_name = server_name;
466 r.in.domain_name = domain_name;
467 r.in.domain_guid = domain_guid;
468 r.in.site_name = site_name;
472 r.out.dc_info = dc_info;
474 if (DEBUGLEVEL >= 10) {
475 NDR_PRINT_IN_DEBUG(DsGetDcName, &r);
478 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
479 werr = DsGetDcName_l(ctx, &r);
481 werr = DsGetDcName_r(ctx, &r);
484 r.out.result = W_ERROR_V(werr);
486 if (DEBUGLEVEL >= 10) {
487 NDR_PRINT_OUT_DEBUG(DsGetDcName, &r);
493 /****************************************************************
495 ****************************************************************/
497 NET_API_STATUS NetUserAdd(const char * server_name /* [in] [unique] */,
498 uint32_t level /* [in] */,
499 uint8_t *buffer /* [in] [ref] */,
500 uint32_t *parm_error /* [out] [ref] */)
503 struct libnetapi_ctx *ctx = NULL;
504 NET_API_STATUS status;
507 status = libnetapi_getctx(&ctx);
513 r.in.server_name = server_name;
515 r.in.buffer = buffer;
518 r.out.parm_error = parm_error;
520 if (DEBUGLEVEL >= 10) {
521 NDR_PRINT_IN_DEBUG(NetUserAdd, &r);
524 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
525 werr = NetUserAdd_l(ctx, &r);
527 werr = NetUserAdd_r(ctx, &r);
530 r.out.result = W_ERROR_V(werr);
532 if (DEBUGLEVEL >= 10) {
533 NDR_PRINT_OUT_DEBUG(NetUserAdd, &r);
539 /****************************************************************
541 ****************************************************************/
543 NET_API_STATUS NetUserDel(const char * server_name /* [in] [unique] */,
544 const char * user_name /* [in] [ref] */)
547 struct libnetapi_ctx *ctx = NULL;
548 NET_API_STATUS status;
551 status = libnetapi_getctx(&ctx);
557 r.in.server_name = server_name;
558 r.in.user_name = user_name;
562 if (DEBUGLEVEL >= 10) {
563 NDR_PRINT_IN_DEBUG(NetUserDel, &r);
566 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
567 werr = NetUserDel_l(ctx, &r);
569 werr = NetUserDel_r(ctx, &r);
572 r.out.result = W_ERROR_V(werr);
574 if (DEBUGLEVEL >= 10) {
575 NDR_PRINT_OUT_DEBUG(NetUserDel, &r);
581 /****************************************************************
583 ****************************************************************/
585 NET_API_STATUS NetUserEnum(const char * server_name /* [in] [unique] */,
586 uint32_t level /* [in] */,
587 uint32_t filter /* [in] */,
588 uint8_t **buffer /* [out] [ref] */,
589 uint32_t prefmaxlen /* [in] */,
590 uint32_t *entries_read /* [out] [ref] */,
591 uint32_t *total_entries /* [out] [ref] */,
592 uint32_t *resume_handle /* [in,out] [ref] */)
594 struct NetUserEnum r;
595 struct libnetapi_ctx *ctx = NULL;
596 NET_API_STATUS status;
599 status = libnetapi_getctx(&ctx);
605 r.in.server_name = server_name;
607 r.in.filter = filter;
608 r.in.prefmaxlen = prefmaxlen;
609 r.in.resume_handle = resume_handle;
612 r.out.buffer = buffer;
613 r.out.entries_read = entries_read;
614 r.out.total_entries = total_entries;
615 r.out.resume_handle = resume_handle;
617 if (DEBUGLEVEL >= 10) {
618 NDR_PRINT_IN_DEBUG(NetUserEnum, &r);
621 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
622 werr = NetUserEnum_l(ctx, &r);
624 werr = NetUserEnum_r(ctx, &r);
627 r.out.result = W_ERROR_V(werr);
629 if (DEBUGLEVEL >= 10) {
630 NDR_PRINT_OUT_DEBUG(NetUserEnum, &r);
636 /****************************************************************
637 NetUserChangePassword
638 ****************************************************************/
640 NET_API_STATUS NetUserChangePassword(const char * domain_name /* [in] */,
641 const char * user_name /* [in] */,
642 const char * old_password /* [in] */,
643 const char * new_password /* [in] */)
645 struct NetUserChangePassword r;
646 struct libnetapi_ctx *ctx = NULL;
647 NET_API_STATUS status;
650 status = libnetapi_getctx(&ctx);
656 r.in.domain_name = domain_name;
657 r.in.user_name = user_name;
658 r.in.old_password = old_password;
659 r.in.new_password = new_password;
663 if (DEBUGLEVEL >= 10) {
664 NDR_PRINT_IN_DEBUG(NetUserChangePassword, &r);
667 if (LIBNETAPI_LOCAL_SERVER(domain_name)) {
668 werr = NetUserChangePassword_l(ctx, &r);
670 werr = NetUserChangePassword_r(ctx, &r);
673 r.out.result = W_ERROR_V(werr);
675 if (DEBUGLEVEL >= 10) {
676 NDR_PRINT_OUT_DEBUG(NetUserChangePassword, &r);
682 /****************************************************************
684 ****************************************************************/
686 NET_API_STATUS NetUserGetInfo(const char * server_name /* [in] */,
687 const char * user_name /* [in] */,
688 uint32_t level /* [in] */,
689 uint8_t **buffer /* [out] [ref] */)
691 struct NetUserGetInfo r;
692 struct libnetapi_ctx *ctx = NULL;
693 NET_API_STATUS status;
696 status = libnetapi_getctx(&ctx);
702 r.in.server_name = server_name;
703 r.in.user_name = user_name;
707 r.out.buffer = buffer;
709 if (DEBUGLEVEL >= 10) {
710 NDR_PRINT_IN_DEBUG(NetUserGetInfo, &r);
713 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
714 werr = NetUserGetInfo_l(ctx, &r);
716 werr = NetUserGetInfo_r(ctx, &r);
719 r.out.result = W_ERROR_V(werr);
721 if (DEBUGLEVEL >= 10) {
722 NDR_PRINT_OUT_DEBUG(NetUserGetInfo, &r);
728 /****************************************************************
730 ****************************************************************/
732 NET_API_STATUS NetUserSetInfo(const char * server_name /* [in] */,
733 const char * user_name /* [in] */,
734 uint32_t level /* [in] */,
735 uint8_t *buffer /* [in] [ref] */,
736 uint32_t *parm_err /* [out] [ref] */)
738 struct NetUserSetInfo r;
739 struct libnetapi_ctx *ctx = NULL;
740 NET_API_STATUS status;
743 status = libnetapi_getctx(&ctx);
749 r.in.server_name = server_name;
750 r.in.user_name = user_name;
752 r.in.buffer = buffer;
755 r.out.parm_err = parm_err;
757 if (DEBUGLEVEL >= 10) {
758 NDR_PRINT_IN_DEBUG(NetUserSetInfo, &r);
761 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
762 werr = NetUserSetInfo_l(ctx, &r);
764 werr = NetUserSetInfo_r(ctx, &r);
767 r.out.result = W_ERROR_V(werr);
769 if (DEBUGLEVEL >= 10) {
770 NDR_PRINT_OUT_DEBUG(NetUserSetInfo, &r);
776 /****************************************************************
778 ****************************************************************/
780 NET_API_STATUS NetUserGetGroups(const char * server_name /* [in] */,
781 const char * user_name /* [in] */,
782 uint32_t level /* [in] */,
783 uint8_t **buffer /* [out] [ref] */,
784 uint32_t prefmaxlen /* [in] */,
785 uint32_t *entries_read /* [out] [ref] */,
786 uint32_t *total_entries /* [out] [ref] */)
788 struct NetUserGetGroups r;
789 struct libnetapi_ctx *ctx = NULL;
790 NET_API_STATUS status;
793 status = libnetapi_getctx(&ctx);
799 r.in.server_name = server_name;
800 r.in.user_name = user_name;
802 r.in.prefmaxlen = prefmaxlen;
805 r.out.buffer = buffer;
806 r.out.entries_read = entries_read;
807 r.out.total_entries = total_entries;
809 if (DEBUGLEVEL >= 10) {
810 NDR_PRINT_IN_DEBUG(NetUserGetGroups, &r);
813 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
814 werr = NetUserGetGroups_l(ctx, &r);
816 werr = NetUserGetGroups_r(ctx, &r);
819 r.out.result = W_ERROR_V(werr);
821 if (DEBUGLEVEL >= 10) {
822 NDR_PRINT_OUT_DEBUG(NetUserGetGroups, &r);
828 /****************************************************************
830 ****************************************************************/
832 NET_API_STATUS NetUserSetGroups(const char * server_name /* [in] */,
833 const char * user_name /* [in] */,
834 uint32_t level /* [in] */,
835 uint8_t *buffer /* [in] [ref] */,
836 uint32_t num_entries /* [in] */)
838 struct NetUserSetGroups r;
839 struct libnetapi_ctx *ctx = NULL;
840 NET_API_STATUS status;
843 status = libnetapi_getctx(&ctx);
849 r.in.server_name = server_name;
850 r.in.user_name = user_name;
852 r.in.buffer = buffer;
853 r.in.num_entries = num_entries;
857 if (DEBUGLEVEL >= 10) {
858 NDR_PRINT_IN_DEBUG(NetUserSetGroups, &r);
861 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
862 werr = NetUserSetGroups_l(ctx, &r);
864 werr = NetUserSetGroups_r(ctx, &r);
867 r.out.result = W_ERROR_V(werr);
869 if (DEBUGLEVEL >= 10) {
870 NDR_PRINT_OUT_DEBUG(NetUserSetGroups, &r);
876 /****************************************************************
877 NetUserGetLocalGroups
878 ****************************************************************/
880 NET_API_STATUS NetUserGetLocalGroups(const char * server_name /* [in] */,
881 const char * user_name /* [in] */,
882 uint32_t level /* [in] */,
883 uint32_t flags /* [in] */,
884 uint8_t **buffer /* [out] [ref] */,
885 uint32_t prefmaxlen /* [in] */,
886 uint32_t *entries_read /* [out] [ref] */,
887 uint32_t *total_entries /* [out] [ref] */)
889 struct NetUserGetLocalGroups r;
890 struct libnetapi_ctx *ctx = NULL;
891 NET_API_STATUS status;
894 status = libnetapi_getctx(&ctx);
900 r.in.server_name = server_name;
901 r.in.user_name = user_name;
904 r.in.prefmaxlen = prefmaxlen;
907 r.out.buffer = buffer;
908 r.out.entries_read = entries_read;
909 r.out.total_entries = total_entries;
911 if (DEBUGLEVEL >= 10) {
912 NDR_PRINT_IN_DEBUG(NetUserGetLocalGroups, &r);
915 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
916 werr = NetUserGetLocalGroups_l(ctx, &r);
918 werr = NetUserGetLocalGroups_r(ctx, &r);
921 r.out.result = W_ERROR_V(werr);
923 if (DEBUGLEVEL >= 10) {
924 NDR_PRINT_OUT_DEBUG(NetUserGetLocalGroups, &r);
930 /****************************************************************
932 ****************************************************************/
934 NET_API_STATUS NetUserModalsGet(const char * server_name /* [in] */,
935 uint32_t level /* [in] */,
936 uint8_t **buffer /* [out] [ref] */)
938 struct NetUserModalsGet r;
939 struct libnetapi_ctx *ctx = NULL;
940 NET_API_STATUS status;
943 status = libnetapi_getctx(&ctx);
949 r.in.server_name = server_name;
953 r.out.buffer = buffer;
955 if (DEBUGLEVEL >= 10) {
956 NDR_PRINT_IN_DEBUG(NetUserModalsGet, &r);
959 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
960 werr = NetUserModalsGet_l(ctx, &r);
962 werr = NetUserModalsGet_r(ctx, &r);
965 r.out.result = W_ERROR_V(werr);
967 if (DEBUGLEVEL >= 10) {
968 NDR_PRINT_OUT_DEBUG(NetUserModalsGet, &r);
974 /****************************************************************
976 ****************************************************************/
978 NET_API_STATUS NetUserModalsSet(const char * server_name /* [in] */,
979 uint32_t level /* [in] */,
980 uint8_t *buffer /* [in] [ref] */,
981 uint32_t *parm_err /* [out] [ref] */)
983 struct NetUserModalsSet r;
984 struct libnetapi_ctx *ctx = NULL;
985 NET_API_STATUS status;
988 status = libnetapi_getctx(&ctx);
994 r.in.server_name = server_name;
996 r.in.buffer = buffer;
999 r.out.parm_err = parm_err;
1001 if (DEBUGLEVEL >= 10) {
1002 NDR_PRINT_IN_DEBUG(NetUserModalsSet, &r);
1005 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1006 werr = NetUserModalsSet_l(ctx, &r);
1008 werr = NetUserModalsSet_r(ctx, &r);
1011 r.out.result = W_ERROR_V(werr);
1013 if (DEBUGLEVEL >= 10) {
1014 NDR_PRINT_OUT_DEBUG(NetUserModalsSet, &r);
1017 return r.out.result;
1020 /****************************************************************
1021 NetQueryDisplayInformation
1022 ****************************************************************/
1024 NET_API_STATUS NetQueryDisplayInformation(const char * server_name /* [in] [unique] */,
1025 uint32_t level /* [in] */,
1026 uint32_t idx /* [in] */,
1027 uint32_t entries_requested /* [in] */,
1028 uint32_t prefmaxlen /* [in] */,
1029 uint32_t *entries_read /* [out] [ref] */,
1030 void **buffer /* [out] [noprint,ref] */)
1032 struct NetQueryDisplayInformation r;
1033 struct libnetapi_ctx *ctx = NULL;
1034 NET_API_STATUS status;
1037 status = libnetapi_getctx(&ctx);
1043 r.in.server_name = server_name;
1046 r.in.entries_requested = entries_requested;
1047 r.in.prefmaxlen = prefmaxlen;
1049 /* Out parameters */
1050 r.out.entries_read = entries_read;
1051 r.out.buffer = buffer;
1053 if (DEBUGLEVEL >= 10) {
1054 NDR_PRINT_IN_DEBUG(NetQueryDisplayInformation, &r);
1057 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1058 werr = NetQueryDisplayInformation_l(ctx, &r);
1060 werr = NetQueryDisplayInformation_r(ctx, &r);
1063 r.out.result = W_ERROR_V(werr);
1065 if (DEBUGLEVEL >= 10) {
1066 NDR_PRINT_OUT_DEBUG(NetQueryDisplayInformation, &r);
1069 return r.out.result;
1072 /****************************************************************
1074 ****************************************************************/
1076 NET_API_STATUS NetGroupAdd(const char * server_name /* [in] */,
1077 uint32_t level /* [in] */,
1078 uint8_t *buffer /* [in] [ref] */,
1079 uint32_t *parm_err /* [out] [ref] */)
1081 struct NetGroupAdd r;
1082 struct libnetapi_ctx *ctx = NULL;
1083 NET_API_STATUS status;
1086 status = libnetapi_getctx(&ctx);
1092 r.in.server_name = server_name;
1094 r.in.buffer = buffer;
1096 /* Out parameters */
1097 r.out.parm_err = parm_err;
1099 if (DEBUGLEVEL >= 10) {
1100 NDR_PRINT_IN_DEBUG(NetGroupAdd, &r);
1103 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1104 werr = NetGroupAdd_l(ctx, &r);
1106 werr = NetGroupAdd_r(ctx, &r);
1109 r.out.result = W_ERROR_V(werr);
1111 if (DEBUGLEVEL >= 10) {
1112 NDR_PRINT_OUT_DEBUG(NetGroupAdd, &r);
1115 return r.out.result;
1118 /****************************************************************
1120 ****************************************************************/
1122 NET_API_STATUS NetGroupDel(const char * server_name /* [in] */,
1123 const char * group_name /* [in] */)
1125 struct NetGroupDel r;
1126 struct libnetapi_ctx *ctx = NULL;
1127 NET_API_STATUS status;
1130 status = libnetapi_getctx(&ctx);
1136 r.in.server_name = server_name;
1137 r.in.group_name = group_name;
1139 /* Out parameters */
1141 if (DEBUGLEVEL >= 10) {
1142 NDR_PRINT_IN_DEBUG(NetGroupDel, &r);
1145 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1146 werr = NetGroupDel_l(ctx, &r);
1148 werr = NetGroupDel_r(ctx, &r);
1151 r.out.result = W_ERROR_V(werr);
1153 if (DEBUGLEVEL >= 10) {
1154 NDR_PRINT_OUT_DEBUG(NetGroupDel, &r);
1157 return r.out.result;
1160 /****************************************************************
1162 ****************************************************************/
1164 NET_API_STATUS NetGroupEnum(const char * server_name /* [in] */,
1165 uint32_t level /* [in] */,
1166 uint8_t **buffer /* [out] [ref] */,
1167 uint32_t prefmaxlen /* [in] */,
1168 uint32_t *entries_read /* [out] [ref] */,
1169 uint32_t *total_entries /* [out] [ref] */,
1170 uint32_t *resume_handle /* [in,out] [ref] */)
1172 struct NetGroupEnum r;
1173 struct libnetapi_ctx *ctx = NULL;
1174 NET_API_STATUS status;
1177 status = libnetapi_getctx(&ctx);
1183 r.in.server_name = server_name;
1185 r.in.prefmaxlen = prefmaxlen;
1186 r.in.resume_handle = resume_handle;
1188 /* Out parameters */
1189 r.out.buffer = buffer;
1190 r.out.entries_read = entries_read;
1191 r.out.total_entries = total_entries;
1192 r.out.resume_handle = resume_handle;
1194 if (DEBUGLEVEL >= 10) {
1195 NDR_PRINT_IN_DEBUG(NetGroupEnum, &r);
1198 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1199 werr = NetGroupEnum_l(ctx, &r);
1201 werr = NetGroupEnum_r(ctx, &r);
1204 r.out.result = W_ERROR_V(werr);
1206 if (DEBUGLEVEL >= 10) {
1207 NDR_PRINT_OUT_DEBUG(NetGroupEnum, &r);
1210 return r.out.result;
1213 /****************************************************************
1215 ****************************************************************/
1217 NET_API_STATUS NetGroupSetInfo(const char * server_name /* [in] */,
1218 const char * group_name /* [in] */,
1219 uint32_t level /* [in] */,
1220 uint8_t *buffer /* [in] [ref] */,
1221 uint32_t *parm_err /* [out] [ref] */)
1223 struct NetGroupSetInfo r;
1224 struct libnetapi_ctx *ctx = NULL;
1225 NET_API_STATUS status;
1228 status = libnetapi_getctx(&ctx);
1234 r.in.server_name = server_name;
1235 r.in.group_name = group_name;
1237 r.in.buffer = buffer;
1239 /* Out parameters */
1240 r.out.parm_err = parm_err;
1242 if (DEBUGLEVEL >= 10) {
1243 NDR_PRINT_IN_DEBUG(NetGroupSetInfo, &r);
1246 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1247 werr = NetGroupSetInfo_l(ctx, &r);
1249 werr = NetGroupSetInfo_r(ctx, &r);
1252 r.out.result = W_ERROR_V(werr);
1254 if (DEBUGLEVEL >= 10) {
1255 NDR_PRINT_OUT_DEBUG(NetGroupSetInfo, &r);
1258 return r.out.result;
1261 /****************************************************************
1263 ****************************************************************/
1265 NET_API_STATUS NetGroupGetInfo(const char * server_name /* [in] */,
1266 const char * group_name /* [in] */,
1267 uint32_t level /* [in] */,
1268 uint8_t **buffer /* [out] [ref] */)
1270 struct NetGroupGetInfo r;
1271 struct libnetapi_ctx *ctx = NULL;
1272 NET_API_STATUS status;
1275 status = libnetapi_getctx(&ctx);
1281 r.in.server_name = server_name;
1282 r.in.group_name = group_name;
1285 /* Out parameters */
1286 r.out.buffer = buffer;
1288 if (DEBUGLEVEL >= 10) {
1289 NDR_PRINT_IN_DEBUG(NetGroupGetInfo, &r);
1292 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1293 werr = NetGroupGetInfo_l(ctx, &r);
1295 werr = NetGroupGetInfo_r(ctx, &r);
1298 r.out.result = W_ERROR_V(werr);
1300 if (DEBUGLEVEL >= 10) {
1301 NDR_PRINT_OUT_DEBUG(NetGroupGetInfo, &r);
1304 return r.out.result;
1307 /****************************************************************
1309 ****************************************************************/
1311 NET_API_STATUS NetGroupAddUser(const char * server_name /* [in] */,
1312 const char * group_name /* [in] */,
1313 const char * user_name /* [in] */)
1315 struct NetGroupAddUser r;
1316 struct libnetapi_ctx *ctx = NULL;
1317 NET_API_STATUS status;
1320 status = libnetapi_getctx(&ctx);
1326 r.in.server_name = server_name;
1327 r.in.group_name = group_name;
1328 r.in.user_name = user_name;
1330 /* Out parameters */
1332 if (DEBUGLEVEL >= 10) {
1333 NDR_PRINT_IN_DEBUG(NetGroupAddUser, &r);
1336 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1337 werr = NetGroupAddUser_l(ctx, &r);
1339 werr = NetGroupAddUser_r(ctx, &r);
1342 r.out.result = W_ERROR_V(werr);
1344 if (DEBUGLEVEL >= 10) {
1345 NDR_PRINT_OUT_DEBUG(NetGroupAddUser, &r);
1348 return r.out.result;
1351 /****************************************************************
1353 ****************************************************************/
1355 NET_API_STATUS NetGroupDelUser(const char * server_name /* [in] */,
1356 const char * group_name /* [in] */,
1357 const char * user_name /* [in] */)
1359 struct NetGroupDelUser r;
1360 struct libnetapi_ctx *ctx = NULL;
1361 NET_API_STATUS status;
1364 status = libnetapi_getctx(&ctx);
1370 r.in.server_name = server_name;
1371 r.in.group_name = group_name;
1372 r.in.user_name = user_name;
1374 /* Out parameters */
1376 if (DEBUGLEVEL >= 10) {
1377 NDR_PRINT_IN_DEBUG(NetGroupDelUser, &r);
1380 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1381 werr = NetGroupDelUser_l(ctx, &r);
1383 werr = NetGroupDelUser_r(ctx, &r);
1386 r.out.result = W_ERROR_V(werr);
1388 if (DEBUGLEVEL >= 10) {
1389 NDR_PRINT_OUT_DEBUG(NetGroupDelUser, &r);
1392 return r.out.result;
1395 /****************************************************************
1397 ****************************************************************/
1399 NET_API_STATUS NetGroupGetUsers(const char * server_name /* [in] */,
1400 const char * group_name /* [in] */,
1401 uint32_t level /* [in] */,
1402 uint8_t **buffer /* [out] [ref] */,
1403 uint32_t prefmaxlen /* [in] */,
1404 uint32_t *entries_read /* [out] [ref] */,
1405 uint32_t *total_entries /* [out] [ref] */,
1406 uint32_t *resume_handle /* [in,out] [ref] */)
1408 struct NetGroupGetUsers r;
1409 struct libnetapi_ctx *ctx = NULL;
1410 NET_API_STATUS status;
1413 status = libnetapi_getctx(&ctx);
1419 r.in.server_name = server_name;
1420 r.in.group_name = group_name;
1422 r.in.prefmaxlen = prefmaxlen;
1423 r.in.resume_handle = resume_handle;
1425 /* Out parameters */
1426 r.out.buffer = buffer;
1427 r.out.entries_read = entries_read;
1428 r.out.total_entries = total_entries;
1429 r.out.resume_handle = resume_handle;
1431 if (DEBUGLEVEL >= 10) {
1432 NDR_PRINT_IN_DEBUG(NetGroupGetUsers, &r);
1435 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1436 werr = NetGroupGetUsers_l(ctx, &r);
1438 werr = NetGroupGetUsers_r(ctx, &r);
1441 r.out.result = W_ERROR_V(werr);
1443 if (DEBUGLEVEL >= 10) {
1444 NDR_PRINT_OUT_DEBUG(NetGroupGetUsers, &r);
1447 return r.out.result;
1450 /****************************************************************
1452 ****************************************************************/
1454 NET_API_STATUS NetGroupSetUsers(const char * server_name /* [in] */,
1455 const char * group_name /* [in] */,
1456 uint32_t level /* [in] */,
1457 uint8_t *buffer /* [in] [ref] */,
1458 uint32_t num_entries /* [in] */)
1460 struct NetGroupSetUsers r;
1461 struct libnetapi_ctx *ctx = NULL;
1462 NET_API_STATUS status;
1465 status = libnetapi_getctx(&ctx);
1471 r.in.server_name = server_name;
1472 r.in.group_name = group_name;
1474 r.in.buffer = buffer;
1475 r.in.num_entries = num_entries;
1477 /* Out parameters */
1479 if (DEBUGLEVEL >= 10) {
1480 NDR_PRINT_IN_DEBUG(NetGroupSetUsers, &r);
1483 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1484 werr = NetGroupSetUsers_l(ctx, &r);
1486 werr = NetGroupSetUsers_r(ctx, &r);
1489 r.out.result = W_ERROR_V(werr);
1491 if (DEBUGLEVEL >= 10) {
1492 NDR_PRINT_OUT_DEBUG(NetGroupSetUsers, &r);
1495 return r.out.result;
1498 /****************************************************************
1500 ****************************************************************/
1502 NET_API_STATUS NetLocalGroupAdd(const char * server_name /* [in] */,
1503 uint32_t level /* [in] */,
1504 uint8_t *buffer /* [in] [ref] */,
1505 uint32_t *parm_err /* [out] [ref] */)
1507 struct NetLocalGroupAdd r;
1508 struct libnetapi_ctx *ctx = NULL;
1509 NET_API_STATUS status;
1512 status = libnetapi_getctx(&ctx);
1518 r.in.server_name = server_name;
1520 r.in.buffer = buffer;
1522 /* Out parameters */
1523 r.out.parm_err = parm_err;
1525 if (DEBUGLEVEL >= 10) {
1526 NDR_PRINT_IN_DEBUG(NetLocalGroupAdd, &r);
1529 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1530 werr = NetLocalGroupAdd_l(ctx, &r);
1532 werr = NetLocalGroupAdd_r(ctx, &r);
1535 r.out.result = W_ERROR_V(werr);
1537 if (DEBUGLEVEL >= 10) {
1538 NDR_PRINT_OUT_DEBUG(NetLocalGroupAdd, &r);
1541 return r.out.result;
1544 /****************************************************************
1546 ****************************************************************/
1548 NET_API_STATUS NetLocalGroupDel(const char * server_name /* [in] */,
1549 const char * group_name /* [in] */)
1551 struct NetLocalGroupDel r;
1552 struct libnetapi_ctx *ctx = NULL;
1553 NET_API_STATUS status;
1556 status = libnetapi_getctx(&ctx);
1562 r.in.server_name = server_name;
1563 r.in.group_name = group_name;
1565 /* Out parameters */
1567 if (DEBUGLEVEL >= 10) {
1568 NDR_PRINT_IN_DEBUG(NetLocalGroupDel, &r);
1571 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1572 werr = NetLocalGroupDel_l(ctx, &r);
1574 werr = NetLocalGroupDel_r(ctx, &r);
1577 r.out.result = W_ERROR_V(werr);
1579 if (DEBUGLEVEL >= 10) {
1580 NDR_PRINT_OUT_DEBUG(NetLocalGroupDel, &r);
1583 return r.out.result;
1586 /****************************************************************
1587 NetLocalGroupGetInfo
1588 ****************************************************************/
1590 NET_API_STATUS NetLocalGroupGetInfo(const char * server_name /* [in] */,
1591 const char * group_name /* [in] */,
1592 uint32_t level /* [in] */,
1593 uint8_t **buffer /* [out] [ref] */)
1595 struct NetLocalGroupGetInfo r;
1596 struct libnetapi_ctx *ctx = NULL;
1597 NET_API_STATUS status;
1600 status = libnetapi_getctx(&ctx);
1606 r.in.server_name = server_name;
1607 r.in.group_name = group_name;
1610 /* Out parameters */
1611 r.out.buffer = buffer;
1613 if (DEBUGLEVEL >= 10) {
1614 NDR_PRINT_IN_DEBUG(NetLocalGroupGetInfo, &r);
1617 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1618 werr = NetLocalGroupGetInfo_l(ctx, &r);
1620 werr = NetLocalGroupGetInfo_r(ctx, &r);
1623 r.out.result = W_ERROR_V(werr);
1625 if (DEBUGLEVEL >= 10) {
1626 NDR_PRINT_OUT_DEBUG(NetLocalGroupGetInfo, &r);
1629 return r.out.result;
1632 /****************************************************************
1633 NetLocalGroupSetInfo
1634 ****************************************************************/
1636 NET_API_STATUS NetLocalGroupSetInfo(const char * server_name /* [in] */,
1637 const char * group_name /* [in] */,
1638 uint32_t level /* [in] */,
1639 uint8_t *buffer /* [in] [ref] */,
1640 uint32_t *parm_err /* [out] [ref] */)
1642 struct NetLocalGroupSetInfo r;
1643 struct libnetapi_ctx *ctx = NULL;
1644 NET_API_STATUS status;
1647 status = libnetapi_getctx(&ctx);
1653 r.in.server_name = server_name;
1654 r.in.group_name = group_name;
1656 r.in.buffer = buffer;
1658 /* Out parameters */
1659 r.out.parm_err = parm_err;
1661 if (DEBUGLEVEL >= 10) {
1662 NDR_PRINT_IN_DEBUG(NetLocalGroupSetInfo, &r);
1665 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1666 werr = NetLocalGroupSetInfo_l(ctx, &r);
1668 werr = NetLocalGroupSetInfo_r(ctx, &r);
1671 r.out.result = W_ERROR_V(werr);
1673 if (DEBUGLEVEL >= 10) {
1674 NDR_PRINT_OUT_DEBUG(NetLocalGroupSetInfo, &r);
1677 return r.out.result;
1680 /****************************************************************
1682 ****************************************************************/
1684 NET_API_STATUS NetLocalGroupEnum(const char * server_name /* [in] */,
1685 uint32_t level /* [in] */,
1686 uint8_t **buffer /* [out] [ref] */,
1687 uint32_t prefmaxlen /* [in] */,
1688 uint32_t *entries_read /* [out] [ref] */,
1689 uint32_t *total_entries /* [out] [ref] */,
1690 uint32_t *resume_handle /* [in,out] [ref] */)
1692 struct NetLocalGroupEnum r;
1693 struct libnetapi_ctx *ctx = NULL;
1694 NET_API_STATUS status;
1697 status = libnetapi_getctx(&ctx);
1703 r.in.server_name = server_name;
1705 r.in.prefmaxlen = prefmaxlen;
1706 r.in.resume_handle = resume_handle;
1708 /* Out parameters */
1709 r.out.buffer = buffer;
1710 r.out.entries_read = entries_read;
1711 r.out.total_entries = total_entries;
1712 r.out.resume_handle = resume_handle;
1714 if (DEBUGLEVEL >= 10) {
1715 NDR_PRINT_IN_DEBUG(NetLocalGroupEnum, &r);
1718 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1719 werr = NetLocalGroupEnum_l(ctx, &r);
1721 werr = NetLocalGroupEnum_r(ctx, &r);
1724 r.out.result = W_ERROR_V(werr);
1726 if (DEBUGLEVEL >= 10) {
1727 NDR_PRINT_OUT_DEBUG(NetLocalGroupEnum, &r);
1730 return r.out.result;
1733 /****************************************************************
1734 NetLocalGroupAddMembers
1735 ****************************************************************/
1737 NET_API_STATUS NetLocalGroupAddMembers(const char * server_name /* [in] */,
1738 const char * group_name /* [in] */,
1739 uint32_t level /* [in] */,
1740 uint8_t *buffer /* [in] [ref] */,
1741 uint32_t total_entries /* [in] */)
1743 struct NetLocalGroupAddMembers r;
1744 struct libnetapi_ctx *ctx = NULL;
1745 NET_API_STATUS status;
1748 status = libnetapi_getctx(&ctx);
1754 r.in.server_name = server_name;
1755 r.in.group_name = group_name;
1757 r.in.buffer = buffer;
1758 r.in.total_entries = total_entries;
1760 /* Out parameters */
1762 if (DEBUGLEVEL >= 10) {
1763 NDR_PRINT_IN_DEBUG(NetLocalGroupAddMembers, &r);
1766 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1767 werr = NetLocalGroupAddMembers_l(ctx, &r);
1769 werr = NetLocalGroupAddMembers_r(ctx, &r);
1772 r.out.result = W_ERROR_V(werr);
1774 if (DEBUGLEVEL >= 10) {
1775 NDR_PRINT_OUT_DEBUG(NetLocalGroupAddMembers, &r);
1778 return r.out.result;
1781 /****************************************************************
1782 NetLocalGroupDelMembers
1783 ****************************************************************/
1785 NET_API_STATUS NetLocalGroupDelMembers(const char * server_name /* [in] */,
1786 const char * group_name /* [in] */,
1787 uint32_t level /* [in] */,
1788 uint8_t *buffer /* [in] [ref] */,
1789 uint32_t total_entries /* [in] */)
1791 struct NetLocalGroupDelMembers r;
1792 struct libnetapi_ctx *ctx = NULL;
1793 NET_API_STATUS status;
1796 status = libnetapi_getctx(&ctx);
1802 r.in.server_name = server_name;
1803 r.in.group_name = group_name;
1805 r.in.buffer = buffer;
1806 r.in.total_entries = total_entries;
1808 /* Out parameters */
1810 if (DEBUGLEVEL >= 10) {
1811 NDR_PRINT_IN_DEBUG(NetLocalGroupDelMembers, &r);
1814 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1815 werr = NetLocalGroupDelMembers_l(ctx, &r);
1817 werr = NetLocalGroupDelMembers_r(ctx, &r);
1820 r.out.result = W_ERROR_V(werr);
1822 if (DEBUGLEVEL >= 10) {
1823 NDR_PRINT_OUT_DEBUG(NetLocalGroupDelMembers, &r);
1826 return r.out.result;
1829 /****************************************************************
1830 NetLocalGroupGetMembers
1831 ****************************************************************/
1833 NET_API_STATUS NetLocalGroupGetMembers(const char * server_name /* [in] */,
1834 const char * local_group_name /* [in] */,
1835 uint32_t level /* [in] */,
1836 uint8_t **buffer /* [out] [ref] */,
1837 uint32_t prefmaxlen /* [in] */,
1838 uint32_t *entries_read /* [out] [ref] */,
1839 uint32_t *total_entries /* [out] [ref] */,
1840 uint32_t *resume_handle /* [in,out] [ref] */)
1842 struct NetLocalGroupGetMembers r;
1843 struct libnetapi_ctx *ctx = NULL;
1844 NET_API_STATUS status;
1847 status = libnetapi_getctx(&ctx);
1853 r.in.server_name = server_name;
1854 r.in.local_group_name = local_group_name;
1856 r.in.prefmaxlen = prefmaxlen;
1857 r.in.resume_handle = resume_handle;
1859 /* Out parameters */
1860 r.out.buffer = buffer;
1861 r.out.entries_read = entries_read;
1862 r.out.total_entries = total_entries;
1863 r.out.resume_handle = resume_handle;
1865 if (DEBUGLEVEL >= 10) {
1866 NDR_PRINT_IN_DEBUG(NetLocalGroupGetMembers, &r);
1869 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1870 werr = NetLocalGroupGetMembers_l(ctx, &r);
1872 werr = NetLocalGroupGetMembers_r(ctx, &r);
1875 r.out.result = W_ERROR_V(werr);
1877 if (DEBUGLEVEL >= 10) {
1878 NDR_PRINT_OUT_DEBUG(NetLocalGroupGetMembers, &r);
1881 return r.out.result;
1884 /****************************************************************
1885 NetLocalGroupSetMembers
1886 ****************************************************************/
1888 NET_API_STATUS NetLocalGroupSetMembers(const char * server_name /* [in] */,
1889 const char * group_name /* [in] */,
1890 uint32_t level /* [in] */,
1891 uint8_t *buffer /* [in] [ref] */,
1892 uint32_t total_entries /* [in] */)
1894 struct NetLocalGroupSetMembers r;
1895 struct libnetapi_ctx *ctx = NULL;
1896 NET_API_STATUS status;
1899 status = libnetapi_getctx(&ctx);
1905 r.in.server_name = server_name;
1906 r.in.group_name = group_name;
1908 r.in.buffer = buffer;
1909 r.in.total_entries = total_entries;
1911 /* Out parameters */
1913 if (DEBUGLEVEL >= 10) {
1914 NDR_PRINT_IN_DEBUG(NetLocalGroupSetMembers, &r);
1917 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1918 werr = NetLocalGroupSetMembers_l(ctx, &r);
1920 werr = NetLocalGroupSetMembers_r(ctx, &r);
1923 r.out.result = W_ERROR_V(werr);
1925 if (DEBUGLEVEL >= 10) {
1926 NDR_PRINT_OUT_DEBUG(NetLocalGroupSetMembers, &r);
1929 return r.out.result;
1932 /****************************************************************
1934 ****************************************************************/
1936 NET_API_STATUS NetRemoteTOD(const char * server_name /* [in] */,
1937 uint8_t **buffer /* [out] [ref] */)
1939 struct NetRemoteTOD r;
1940 struct libnetapi_ctx *ctx = NULL;
1941 NET_API_STATUS status;
1944 status = libnetapi_getctx(&ctx);
1950 r.in.server_name = server_name;
1952 /* Out parameters */
1953 r.out.buffer = buffer;
1955 if (DEBUGLEVEL >= 10) {
1956 NDR_PRINT_IN_DEBUG(NetRemoteTOD, &r);
1959 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1960 werr = NetRemoteTOD_l(ctx, &r);
1962 werr = NetRemoteTOD_r(ctx, &r);
1965 r.out.result = W_ERROR_V(werr);
1967 if (DEBUGLEVEL >= 10) {
1968 NDR_PRINT_OUT_DEBUG(NetRemoteTOD, &r);
1971 return r.out.result;
1974 /****************************************************************
1976 ****************************************************************/
1978 NET_API_STATUS NetShareAdd(const char * server_name /* [in] */,
1979 uint32_t level /* [in] */,
1980 uint8_t *buffer /* [in] [ref] */,
1981 uint32_t *parm_err /* [out] [ref] */)
1983 struct NetShareAdd r;
1984 struct libnetapi_ctx *ctx = NULL;
1985 NET_API_STATUS status;
1988 status = libnetapi_getctx(&ctx);
1994 r.in.server_name = server_name;
1996 r.in.buffer = buffer;
1998 /* Out parameters */
1999 r.out.parm_err = parm_err;
2001 if (DEBUGLEVEL >= 10) {
2002 NDR_PRINT_IN_DEBUG(NetShareAdd, &r);
2005 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
2006 werr = NetShareAdd_l(ctx, &r);
2008 werr = NetShareAdd_r(ctx, &r);
2011 r.out.result = W_ERROR_V(werr);
2013 if (DEBUGLEVEL >= 10) {
2014 NDR_PRINT_OUT_DEBUG(NetShareAdd, &r);
2017 return r.out.result;
2020 /****************************************************************
2022 ****************************************************************/
2024 NET_API_STATUS NetShareDel(const char * server_name /* [in] */,
2025 const char * net_name /* [in] */,
2026 uint32_t reserved /* [in] */)
2028 struct NetShareDel r;
2029 struct libnetapi_ctx *ctx = NULL;
2030 NET_API_STATUS status;
2033 status = libnetapi_getctx(&ctx);
2039 r.in.server_name = server_name;
2040 r.in.net_name = net_name;
2041 r.in.reserved = reserved;
2043 /* Out parameters */
2045 if (DEBUGLEVEL >= 10) {
2046 NDR_PRINT_IN_DEBUG(NetShareDel, &r);
2049 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
2050 werr = NetShareDel_l(ctx, &r);
2052 werr = NetShareDel_r(ctx, &r);
2055 r.out.result = W_ERROR_V(werr);
2057 if (DEBUGLEVEL >= 10) {
2058 NDR_PRINT_OUT_DEBUG(NetShareDel, &r);
2061 return r.out.result;
2064 /****************************************************************
2066 ****************************************************************/
2068 NET_API_STATUS NetShareEnum(const char * server_name /* [in] */,
2069 uint32_t level /* [in] */,
2070 uint8_t **buffer /* [out] [ref] */,
2071 uint32_t prefmaxlen /* [in] */,
2072 uint32_t *entries_read /* [out] [ref] */,
2073 uint32_t *total_entries /* [out] [ref] */,
2074 uint32_t *resume_handle /* [in,out] [ref] */)
2076 struct NetShareEnum r;
2077 struct libnetapi_ctx *ctx = NULL;
2078 NET_API_STATUS status;
2081 status = libnetapi_getctx(&ctx);
2087 r.in.server_name = server_name;
2089 r.in.prefmaxlen = prefmaxlen;
2090 r.in.resume_handle = resume_handle;
2092 /* Out parameters */
2093 r.out.buffer = buffer;
2094 r.out.entries_read = entries_read;
2095 r.out.total_entries = total_entries;
2096 r.out.resume_handle = resume_handle;
2098 if (DEBUGLEVEL >= 10) {
2099 NDR_PRINT_IN_DEBUG(NetShareEnum, &r);
2102 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
2103 werr = NetShareEnum_l(ctx, &r);
2105 werr = NetShareEnum_r(ctx, &r);
2108 r.out.result = W_ERROR_V(werr);
2110 if (DEBUGLEVEL >= 10) {
2111 NDR_PRINT_OUT_DEBUG(NetShareEnum, &r);
2114 return r.out.result;
2117 /****************************************************************
2119 ****************************************************************/
2121 NET_API_STATUS NetShareGetInfo(const char * server_name /* [in] */,
2122 const char * net_name /* [in] */,
2123 uint32_t level /* [in] */,
2124 uint8_t **buffer /* [out] [ref] */)
2126 struct NetShareGetInfo r;
2127 struct libnetapi_ctx *ctx = NULL;
2128 NET_API_STATUS status;
2131 status = libnetapi_getctx(&ctx);
2137 r.in.server_name = server_name;
2138 r.in.net_name = net_name;
2141 /* Out parameters */
2142 r.out.buffer = buffer;
2144 if (DEBUGLEVEL >= 10) {
2145 NDR_PRINT_IN_DEBUG(NetShareGetInfo, &r);
2148 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
2149 werr = NetShareGetInfo_l(ctx, &r);
2151 werr = NetShareGetInfo_r(ctx, &r);
2154 r.out.result = W_ERROR_V(werr);
2156 if (DEBUGLEVEL >= 10) {
2157 NDR_PRINT_OUT_DEBUG(NetShareGetInfo, &r);
2160 return r.out.result;
2163 /****************************************************************
2165 ****************************************************************/
2167 NET_API_STATUS NetShareSetInfo(const char * server_name /* [in] */,
2168 const char * net_name /* [in] */,
2169 uint32_t level /* [in] */,
2170 uint8_t *buffer /* [in] [ref] */,
2171 uint32_t *parm_err /* [out] [ref] */)
2173 struct NetShareSetInfo r;
2174 struct libnetapi_ctx *ctx = NULL;
2175 NET_API_STATUS status;
2178 status = libnetapi_getctx(&ctx);
2184 r.in.server_name = server_name;
2185 r.in.net_name = net_name;
2187 r.in.buffer = buffer;
2189 /* Out parameters */
2190 r.out.parm_err = parm_err;
2192 if (DEBUGLEVEL >= 10) {
2193 NDR_PRINT_IN_DEBUG(NetShareSetInfo, &r);
2196 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
2197 werr = NetShareSetInfo_l(ctx, &r);
2199 werr = NetShareSetInfo_r(ctx, &r);
2202 r.out.result = W_ERROR_V(werr);
2204 if (DEBUGLEVEL >= 10) {
2205 NDR_PRINT_OUT_DEBUG(NetShareSetInfo, &r);
2208 return r.out.result;