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 /****************************************************************
878 ****************************************************************/
880 NET_API_STATUS NetUserModalsGet(const char * server_name /* [in] */,
881 uint32_t level /* [in] */,
882 uint8_t **buffer /* [out] [ref] */)
884 struct NetUserModalsGet r;
885 struct libnetapi_ctx *ctx = NULL;
886 NET_API_STATUS status;
889 status = libnetapi_getctx(&ctx);
895 r.in.server_name = server_name;
899 r.out.buffer = buffer;
901 if (DEBUGLEVEL >= 10) {
902 NDR_PRINT_IN_DEBUG(NetUserModalsGet, &r);
905 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
906 werr = NetUserModalsGet_l(ctx, &r);
908 werr = NetUserModalsGet_r(ctx, &r);
911 r.out.result = W_ERROR_V(werr);
913 if (DEBUGLEVEL >= 10) {
914 NDR_PRINT_OUT_DEBUG(NetUserModalsGet, &r);
920 /****************************************************************
922 ****************************************************************/
924 NET_API_STATUS NetUserModalsSet(const char * server_name /* [in] */,
925 uint32_t level /* [in] */,
926 uint8_t *buffer /* [in] [ref] */,
927 uint32_t *parm_err /* [out] [ref] */)
929 struct NetUserModalsSet r;
930 struct libnetapi_ctx *ctx = NULL;
931 NET_API_STATUS status;
934 status = libnetapi_getctx(&ctx);
940 r.in.server_name = server_name;
942 r.in.buffer = buffer;
945 r.out.parm_err = parm_err;
947 if (DEBUGLEVEL >= 10) {
948 NDR_PRINT_IN_DEBUG(NetUserModalsSet, &r);
951 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
952 werr = NetUserModalsSet_l(ctx, &r);
954 werr = NetUserModalsSet_r(ctx, &r);
957 r.out.result = W_ERROR_V(werr);
959 if (DEBUGLEVEL >= 10) {
960 NDR_PRINT_OUT_DEBUG(NetUserModalsSet, &r);
966 /****************************************************************
967 NetQueryDisplayInformation
968 ****************************************************************/
970 NET_API_STATUS NetQueryDisplayInformation(const char * server_name /* [in] [unique] */,
971 uint32_t level /* [in] */,
972 uint32_t idx /* [in] */,
973 uint32_t entries_requested /* [in] */,
974 uint32_t prefmaxlen /* [in] */,
975 uint32_t *entries_read /* [out] [ref] */,
976 void **buffer /* [out] [noprint,ref] */)
978 struct NetQueryDisplayInformation r;
979 struct libnetapi_ctx *ctx = NULL;
980 NET_API_STATUS status;
983 status = libnetapi_getctx(&ctx);
989 r.in.server_name = server_name;
992 r.in.entries_requested = entries_requested;
993 r.in.prefmaxlen = prefmaxlen;
996 r.out.entries_read = entries_read;
997 r.out.buffer = buffer;
999 if (DEBUGLEVEL >= 10) {
1000 NDR_PRINT_IN_DEBUG(NetQueryDisplayInformation, &r);
1003 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1004 werr = NetQueryDisplayInformation_l(ctx, &r);
1006 werr = NetQueryDisplayInformation_r(ctx, &r);
1009 r.out.result = W_ERROR_V(werr);
1011 if (DEBUGLEVEL >= 10) {
1012 NDR_PRINT_OUT_DEBUG(NetQueryDisplayInformation, &r);
1015 return r.out.result;
1018 /****************************************************************
1020 ****************************************************************/
1022 NET_API_STATUS NetGroupAdd(const char * server_name /* [in] */,
1023 uint32_t level /* [in] */,
1024 uint8_t *buffer /* [in] [ref] */,
1025 uint32_t *parm_err /* [out] [ref] */)
1027 struct NetGroupAdd r;
1028 struct libnetapi_ctx *ctx = NULL;
1029 NET_API_STATUS status;
1032 status = libnetapi_getctx(&ctx);
1038 r.in.server_name = server_name;
1040 r.in.buffer = buffer;
1042 /* Out parameters */
1043 r.out.parm_err = parm_err;
1045 if (DEBUGLEVEL >= 10) {
1046 NDR_PRINT_IN_DEBUG(NetGroupAdd, &r);
1049 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1050 werr = NetGroupAdd_l(ctx, &r);
1052 werr = NetGroupAdd_r(ctx, &r);
1055 r.out.result = W_ERROR_V(werr);
1057 if (DEBUGLEVEL >= 10) {
1058 NDR_PRINT_OUT_DEBUG(NetGroupAdd, &r);
1061 return r.out.result;
1064 /****************************************************************
1066 ****************************************************************/
1068 NET_API_STATUS NetGroupDel(const char * server_name /* [in] */,
1069 const char * group_name /* [in] */)
1071 struct NetGroupDel r;
1072 struct libnetapi_ctx *ctx = NULL;
1073 NET_API_STATUS status;
1076 status = libnetapi_getctx(&ctx);
1082 r.in.server_name = server_name;
1083 r.in.group_name = group_name;
1085 /* Out parameters */
1087 if (DEBUGLEVEL >= 10) {
1088 NDR_PRINT_IN_DEBUG(NetGroupDel, &r);
1091 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1092 werr = NetGroupDel_l(ctx, &r);
1094 werr = NetGroupDel_r(ctx, &r);
1097 r.out.result = W_ERROR_V(werr);
1099 if (DEBUGLEVEL >= 10) {
1100 NDR_PRINT_OUT_DEBUG(NetGroupDel, &r);
1103 return r.out.result;
1106 /****************************************************************
1108 ****************************************************************/
1110 NET_API_STATUS NetGroupEnum(const char * server_name /* [in] */,
1111 uint32_t level /* [in] */,
1112 uint8_t **buffer /* [out] [ref] */,
1113 uint32_t prefmaxlen /* [in] */,
1114 uint32_t *entries_read /* [out] [ref] */,
1115 uint32_t *total_entries /* [out] [ref] */,
1116 uint32_t *resume_handle /* [in,out] [ref] */)
1118 struct NetGroupEnum r;
1119 struct libnetapi_ctx *ctx = NULL;
1120 NET_API_STATUS status;
1123 status = libnetapi_getctx(&ctx);
1129 r.in.server_name = server_name;
1131 r.in.prefmaxlen = prefmaxlen;
1132 r.in.resume_handle = resume_handle;
1134 /* Out parameters */
1135 r.out.buffer = buffer;
1136 r.out.entries_read = entries_read;
1137 r.out.total_entries = total_entries;
1138 r.out.resume_handle = resume_handle;
1140 if (DEBUGLEVEL >= 10) {
1141 NDR_PRINT_IN_DEBUG(NetGroupEnum, &r);
1144 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1145 werr = NetGroupEnum_l(ctx, &r);
1147 werr = NetGroupEnum_r(ctx, &r);
1150 r.out.result = W_ERROR_V(werr);
1152 if (DEBUGLEVEL >= 10) {
1153 NDR_PRINT_OUT_DEBUG(NetGroupEnum, &r);
1156 return r.out.result;
1159 /****************************************************************
1161 ****************************************************************/
1163 NET_API_STATUS NetGroupSetInfo(const char * server_name /* [in] */,
1164 const char * group_name /* [in] */,
1165 uint32_t level /* [in] */,
1166 uint8_t *buffer /* [in] [ref] */,
1167 uint32_t *parm_err /* [out] [ref] */)
1169 struct NetGroupSetInfo r;
1170 struct libnetapi_ctx *ctx = NULL;
1171 NET_API_STATUS status;
1174 status = libnetapi_getctx(&ctx);
1180 r.in.server_name = server_name;
1181 r.in.group_name = group_name;
1183 r.in.buffer = buffer;
1185 /* Out parameters */
1186 r.out.parm_err = parm_err;
1188 if (DEBUGLEVEL >= 10) {
1189 NDR_PRINT_IN_DEBUG(NetGroupSetInfo, &r);
1192 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1193 werr = NetGroupSetInfo_l(ctx, &r);
1195 werr = NetGroupSetInfo_r(ctx, &r);
1198 r.out.result = W_ERROR_V(werr);
1200 if (DEBUGLEVEL >= 10) {
1201 NDR_PRINT_OUT_DEBUG(NetGroupSetInfo, &r);
1204 return r.out.result;
1207 /****************************************************************
1209 ****************************************************************/
1211 NET_API_STATUS NetGroupGetInfo(const char * server_name /* [in] */,
1212 const char * group_name /* [in] */,
1213 uint32_t level /* [in] */,
1214 uint8_t **buffer /* [out] [ref] */)
1216 struct NetGroupGetInfo r;
1217 struct libnetapi_ctx *ctx = NULL;
1218 NET_API_STATUS status;
1221 status = libnetapi_getctx(&ctx);
1227 r.in.server_name = server_name;
1228 r.in.group_name = group_name;
1231 /* Out parameters */
1232 r.out.buffer = buffer;
1234 if (DEBUGLEVEL >= 10) {
1235 NDR_PRINT_IN_DEBUG(NetGroupGetInfo, &r);
1238 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1239 werr = NetGroupGetInfo_l(ctx, &r);
1241 werr = NetGroupGetInfo_r(ctx, &r);
1244 r.out.result = W_ERROR_V(werr);
1246 if (DEBUGLEVEL >= 10) {
1247 NDR_PRINT_OUT_DEBUG(NetGroupGetInfo, &r);
1250 return r.out.result;
1253 /****************************************************************
1255 ****************************************************************/
1257 NET_API_STATUS NetGroupAddUser(const char * server_name /* [in] */,
1258 const char * group_name /* [in] */,
1259 const char * user_name /* [in] */)
1261 struct NetGroupAddUser r;
1262 struct libnetapi_ctx *ctx = NULL;
1263 NET_API_STATUS status;
1266 status = libnetapi_getctx(&ctx);
1272 r.in.server_name = server_name;
1273 r.in.group_name = group_name;
1274 r.in.user_name = user_name;
1276 /* Out parameters */
1278 if (DEBUGLEVEL >= 10) {
1279 NDR_PRINT_IN_DEBUG(NetGroupAddUser, &r);
1282 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1283 werr = NetGroupAddUser_l(ctx, &r);
1285 werr = NetGroupAddUser_r(ctx, &r);
1288 r.out.result = W_ERROR_V(werr);
1290 if (DEBUGLEVEL >= 10) {
1291 NDR_PRINT_OUT_DEBUG(NetGroupAddUser, &r);
1294 return r.out.result;
1297 /****************************************************************
1299 ****************************************************************/
1301 NET_API_STATUS NetGroupDelUser(const char * server_name /* [in] */,
1302 const char * group_name /* [in] */,
1303 const char * user_name /* [in] */)
1305 struct NetGroupDelUser r;
1306 struct libnetapi_ctx *ctx = NULL;
1307 NET_API_STATUS status;
1310 status = libnetapi_getctx(&ctx);
1316 r.in.server_name = server_name;
1317 r.in.group_name = group_name;
1318 r.in.user_name = user_name;
1320 /* Out parameters */
1322 if (DEBUGLEVEL >= 10) {
1323 NDR_PRINT_IN_DEBUG(NetGroupDelUser, &r);
1326 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1327 werr = NetGroupDelUser_l(ctx, &r);
1329 werr = NetGroupDelUser_r(ctx, &r);
1332 r.out.result = W_ERROR_V(werr);
1334 if (DEBUGLEVEL >= 10) {
1335 NDR_PRINT_OUT_DEBUG(NetGroupDelUser, &r);
1338 return r.out.result;
1341 /****************************************************************
1343 ****************************************************************/
1345 NET_API_STATUS NetGroupGetUsers(const char * server_name /* [in] */,
1346 const char * group_name /* [in] */,
1347 uint32_t level /* [in] */,
1348 uint8_t **buffer /* [out] [ref] */,
1349 uint32_t prefmaxlen /* [in] */,
1350 uint32_t *entries_read /* [out] [ref] */,
1351 uint32_t *total_entries /* [out] [ref] */,
1352 uint32_t *resume_handle /* [in,out] [ref] */)
1354 struct NetGroupGetUsers r;
1355 struct libnetapi_ctx *ctx = NULL;
1356 NET_API_STATUS status;
1359 status = libnetapi_getctx(&ctx);
1365 r.in.server_name = server_name;
1366 r.in.group_name = group_name;
1368 r.in.prefmaxlen = prefmaxlen;
1369 r.in.resume_handle = resume_handle;
1371 /* Out parameters */
1372 r.out.buffer = buffer;
1373 r.out.entries_read = entries_read;
1374 r.out.total_entries = total_entries;
1375 r.out.resume_handle = resume_handle;
1377 if (DEBUGLEVEL >= 10) {
1378 NDR_PRINT_IN_DEBUG(NetGroupGetUsers, &r);
1381 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1382 werr = NetGroupGetUsers_l(ctx, &r);
1384 werr = NetGroupGetUsers_r(ctx, &r);
1387 r.out.result = W_ERROR_V(werr);
1389 if (DEBUGLEVEL >= 10) {
1390 NDR_PRINT_OUT_DEBUG(NetGroupGetUsers, &r);
1393 return r.out.result;
1396 /****************************************************************
1398 ****************************************************************/
1400 NET_API_STATUS NetLocalGroupAdd(const char * server_name /* [in] */,
1401 uint32_t level /* [in] */,
1402 uint8_t *buffer /* [in] [ref] */,
1403 uint32_t *parm_err /* [out] [ref] */)
1405 struct NetLocalGroupAdd r;
1406 struct libnetapi_ctx *ctx = NULL;
1407 NET_API_STATUS status;
1410 status = libnetapi_getctx(&ctx);
1416 r.in.server_name = server_name;
1418 r.in.buffer = buffer;
1420 /* Out parameters */
1421 r.out.parm_err = parm_err;
1423 if (DEBUGLEVEL >= 10) {
1424 NDR_PRINT_IN_DEBUG(NetLocalGroupAdd, &r);
1427 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1428 werr = NetLocalGroupAdd_l(ctx, &r);
1430 werr = NetLocalGroupAdd_r(ctx, &r);
1433 r.out.result = W_ERROR_V(werr);
1435 if (DEBUGLEVEL >= 10) {
1436 NDR_PRINT_OUT_DEBUG(NetLocalGroupAdd, &r);
1439 return r.out.result;
1442 /****************************************************************
1444 ****************************************************************/
1446 NET_API_STATUS NetLocalGroupDel(const char * server_name /* [in] */,
1447 const char * group_name /* [in] */)
1449 struct NetLocalGroupDel r;
1450 struct libnetapi_ctx *ctx = NULL;
1451 NET_API_STATUS status;
1454 status = libnetapi_getctx(&ctx);
1460 r.in.server_name = server_name;
1461 r.in.group_name = group_name;
1463 /* Out parameters */
1465 if (DEBUGLEVEL >= 10) {
1466 NDR_PRINT_IN_DEBUG(NetLocalGroupDel, &r);
1469 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1470 werr = NetLocalGroupDel_l(ctx, &r);
1472 werr = NetLocalGroupDel_r(ctx, &r);
1475 r.out.result = W_ERROR_V(werr);
1477 if (DEBUGLEVEL >= 10) {
1478 NDR_PRINT_OUT_DEBUG(NetLocalGroupDel, &r);
1481 return r.out.result;
1484 /****************************************************************
1485 NetLocalGroupGetInfo
1486 ****************************************************************/
1488 NET_API_STATUS NetLocalGroupGetInfo(const char * server_name /* [in] */,
1489 const char * group_name /* [in] */,
1490 uint32_t level /* [in] */,
1491 uint8_t **buffer /* [out] [ref] */)
1493 struct NetLocalGroupGetInfo r;
1494 struct libnetapi_ctx *ctx = NULL;
1495 NET_API_STATUS status;
1498 status = libnetapi_getctx(&ctx);
1504 r.in.server_name = server_name;
1505 r.in.group_name = group_name;
1508 /* Out parameters */
1509 r.out.buffer = buffer;
1511 if (DEBUGLEVEL >= 10) {
1512 NDR_PRINT_IN_DEBUG(NetLocalGroupGetInfo, &r);
1515 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1516 werr = NetLocalGroupGetInfo_l(ctx, &r);
1518 werr = NetLocalGroupGetInfo_r(ctx, &r);
1521 r.out.result = W_ERROR_V(werr);
1523 if (DEBUGLEVEL >= 10) {
1524 NDR_PRINT_OUT_DEBUG(NetLocalGroupGetInfo, &r);
1527 return r.out.result;
1530 /****************************************************************
1531 NetLocalGroupSetInfo
1532 ****************************************************************/
1534 NET_API_STATUS NetLocalGroupSetInfo(const char * server_name /* [in] */,
1535 const char * group_name /* [in] */,
1536 uint32_t level /* [in] */,
1537 uint8_t *buffer /* [in] [ref] */,
1538 uint32_t *parm_err /* [out] [ref] */)
1540 struct NetLocalGroupSetInfo r;
1541 struct libnetapi_ctx *ctx = NULL;
1542 NET_API_STATUS status;
1545 status = libnetapi_getctx(&ctx);
1551 r.in.server_name = server_name;
1552 r.in.group_name = group_name;
1554 r.in.buffer = buffer;
1556 /* Out parameters */
1557 r.out.parm_err = parm_err;
1559 if (DEBUGLEVEL >= 10) {
1560 NDR_PRINT_IN_DEBUG(NetLocalGroupSetInfo, &r);
1563 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1564 werr = NetLocalGroupSetInfo_l(ctx, &r);
1566 werr = NetLocalGroupSetInfo_r(ctx, &r);
1569 r.out.result = W_ERROR_V(werr);
1571 if (DEBUGLEVEL >= 10) {
1572 NDR_PRINT_OUT_DEBUG(NetLocalGroupSetInfo, &r);
1575 return r.out.result;
1578 /****************************************************************
1580 ****************************************************************/
1582 NET_API_STATUS NetLocalGroupEnum(const char * server_name /* [in] */,
1583 uint32_t level /* [in] */,
1584 uint8_t **buffer /* [out] [ref] */,
1585 uint32_t prefmaxlen /* [in] */,
1586 uint32_t *entries_read /* [out] [ref] */,
1587 uint32_t *total_entries /* [out] [ref] */,
1588 uint32_t *resume_handle /* [in,out] [ref] */)
1590 struct NetLocalGroupEnum r;
1591 struct libnetapi_ctx *ctx = NULL;
1592 NET_API_STATUS status;
1595 status = libnetapi_getctx(&ctx);
1601 r.in.server_name = server_name;
1603 r.in.prefmaxlen = prefmaxlen;
1604 r.in.resume_handle = resume_handle;
1606 /* Out parameters */
1607 r.out.buffer = buffer;
1608 r.out.entries_read = entries_read;
1609 r.out.total_entries = total_entries;
1610 r.out.resume_handle = resume_handle;
1612 if (DEBUGLEVEL >= 10) {
1613 NDR_PRINT_IN_DEBUG(NetLocalGroupEnum, &r);
1616 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1617 werr = NetLocalGroupEnum_l(ctx, &r);
1619 werr = NetLocalGroupEnum_r(ctx, &r);
1622 r.out.result = W_ERROR_V(werr);
1624 if (DEBUGLEVEL >= 10) {
1625 NDR_PRINT_OUT_DEBUG(NetLocalGroupEnum, &r);
1628 return r.out.result;
1631 /****************************************************************
1632 NetLocalGroupAddMembers
1633 ****************************************************************/
1635 NET_API_STATUS NetLocalGroupAddMembers(const char * server_name /* [in] */,
1636 const char * group_name /* [in] */,
1637 uint32_t level /* [in] */,
1638 uint8_t *buffer /* [in] [ref] */,
1639 uint32_t total_entries /* [in] */)
1641 struct NetLocalGroupAddMembers r;
1642 struct libnetapi_ctx *ctx = NULL;
1643 NET_API_STATUS status;
1646 status = libnetapi_getctx(&ctx);
1652 r.in.server_name = server_name;
1653 r.in.group_name = group_name;
1655 r.in.buffer = buffer;
1656 r.in.total_entries = total_entries;
1658 /* Out parameters */
1660 if (DEBUGLEVEL >= 10) {
1661 NDR_PRINT_IN_DEBUG(NetLocalGroupAddMembers, &r);
1664 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1665 werr = NetLocalGroupAddMembers_l(ctx, &r);
1667 werr = NetLocalGroupAddMembers_r(ctx, &r);
1670 r.out.result = W_ERROR_V(werr);
1672 if (DEBUGLEVEL >= 10) {
1673 NDR_PRINT_OUT_DEBUG(NetLocalGroupAddMembers, &r);
1676 return r.out.result;
1679 /****************************************************************
1680 NetLocalGroupDelMembers
1681 ****************************************************************/
1683 NET_API_STATUS NetLocalGroupDelMembers(const char * server_name /* [in] */,
1684 const char * group_name /* [in] */,
1685 uint32_t level /* [in] */,
1686 uint8_t *buffer /* [in] [ref] */,
1687 uint32_t total_entries /* [in] */)
1689 struct NetLocalGroupDelMembers r;
1690 struct libnetapi_ctx *ctx = NULL;
1691 NET_API_STATUS status;
1694 status = libnetapi_getctx(&ctx);
1700 r.in.server_name = server_name;
1701 r.in.group_name = group_name;
1703 r.in.buffer = buffer;
1704 r.in.total_entries = total_entries;
1706 /* Out parameters */
1708 if (DEBUGLEVEL >= 10) {
1709 NDR_PRINT_IN_DEBUG(NetLocalGroupDelMembers, &r);
1712 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1713 werr = NetLocalGroupDelMembers_l(ctx, &r);
1715 werr = NetLocalGroupDelMembers_r(ctx, &r);
1718 r.out.result = W_ERROR_V(werr);
1720 if (DEBUGLEVEL >= 10) {
1721 NDR_PRINT_OUT_DEBUG(NetLocalGroupDelMembers, &r);
1724 return r.out.result;
1727 /****************************************************************
1728 NetLocalGroupGetMembers
1729 ****************************************************************/
1731 NET_API_STATUS NetLocalGroupGetMembers(const char * server_name /* [in] */,
1732 const char * local_group_name /* [in] */,
1733 uint32_t level /* [in] */,
1734 uint8_t **buffer /* [out] [ref] */,
1735 uint32_t prefmaxlen /* [in] */,
1736 uint32_t *entries_read /* [out] [ref] */,
1737 uint32_t *total_entries /* [out] [ref] */,
1738 uint32_t *resume_handle /* [in,out] [ref] */)
1740 struct NetLocalGroupGetMembers r;
1741 struct libnetapi_ctx *ctx = NULL;
1742 NET_API_STATUS status;
1745 status = libnetapi_getctx(&ctx);
1751 r.in.server_name = server_name;
1752 r.in.local_group_name = local_group_name;
1754 r.in.prefmaxlen = prefmaxlen;
1755 r.in.resume_handle = resume_handle;
1757 /* Out parameters */
1758 r.out.buffer = buffer;
1759 r.out.entries_read = entries_read;
1760 r.out.total_entries = total_entries;
1761 r.out.resume_handle = resume_handle;
1763 if (DEBUGLEVEL >= 10) {
1764 NDR_PRINT_IN_DEBUG(NetLocalGroupGetMembers, &r);
1767 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1768 werr = NetLocalGroupGetMembers_l(ctx, &r);
1770 werr = NetLocalGroupGetMembers_r(ctx, &r);
1773 r.out.result = W_ERROR_V(werr);
1775 if (DEBUGLEVEL >= 10) {
1776 NDR_PRINT_OUT_DEBUG(NetLocalGroupGetMembers, &r);
1779 return r.out.result;
1782 /****************************************************************
1783 NetLocalGroupSetMembers
1784 ****************************************************************/
1786 NET_API_STATUS NetLocalGroupSetMembers(const char * server_name /* [in] */,
1787 const char * group_name /* [in] */,
1788 uint32_t level /* [in] */,
1789 uint8_t *buffer /* [in] [ref] */,
1790 uint32_t total_entries /* [in] */)
1792 struct NetLocalGroupSetMembers r;
1793 struct libnetapi_ctx *ctx = NULL;
1794 NET_API_STATUS status;
1797 status = libnetapi_getctx(&ctx);
1803 r.in.server_name = server_name;
1804 r.in.group_name = group_name;
1806 r.in.buffer = buffer;
1807 r.in.total_entries = total_entries;
1809 /* Out parameters */
1811 if (DEBUGLEVEL >= 10) {
1812 NDR_PRINT_IN_DEBUG(NetLocalGroupSetMembers, &r);
1815 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1816 werr = NetLocalGroupSetMembers_l(ctx, &r);
1818 werr = NetLocalGroupSetMembers_r(ctx, &r);
1821 r.out.result = W_ERROR_V(werr);
1823 if (DEBUGLEVEL >= 10) {
1824 NDR_PRINT_OUT_DEBUG(NetLocalGroupSetMembers, &r);
1827 return r.out.result;
1830 /****************************************************************
1832 ****************************************************************/
1834 NET_API_STATUS NetRemoteTOD(const char * server_name /* [in] */,
1835 uint8_t **buffer /* [out] [ref] */)
1837 struct NetRemoteTOD r;
1838 struct libnetapi_ctx *ctx = NULL;
1839 NET_API_STATUS status;
1842 status = libnetapi_getctx(&ctx);
1848 r.in.server_name = server_name;
1850 /* Out parameters */
1851 r.out.buffer = buffer;
1853 if (DEBUGLEVEL >= 10) {
1854 NDR_PRINT_IN_DEBUG(NetRemoteTOD, &r);
1857 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1858 werr = NetRemoteTOD_l(ctx, &r);
1860 werr = NetRemoteTOD_r(ctx, &r);
1863 r.out.result = W_ERROR_V(werr);
1865 if (DEBUGLEVEL >= 10) {
1866 NDR_PRINT_OUT_DEBUG(NetRemoteTOD, &r);
1869 return r.out.result;
1872 /****************************************************************
1874 ****************************************************************/
1876 NET_API_STATUS NetShareAdd(const char * server_name /* [in] */,
1877 uint32_t level /* [in] */,
1878 uint8_t *buffer /* [in] [ref] */,
1879 uint32_t *parm_err /* [out] [ref] */)
1881 struct NetShareAdd r;
1882 struct libnetapi_ctx *ctx = NULL;
1883 NET_API_STATUS status;
1886 status = libnetapi_getctx(&ctx);
1892 r.in.server_name = server_name;
1894 r.in.buffer = buffer;
1896 /* Out parameters */
1897 r.out.parm_err = parm_err;
1899 if (DEBUGLEVEL >= 10) {
1900 NDR_PRINT_IN_DEBUG(NetShareAdd, &r);
1903 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1904 werr = NetShareAdd_l(ctx, &r);
1906 werr = NetShareAdd_r(ctx, &r);
1909 r.out.result = W_ERROR_V(werr);
1911 if (DEBUGLEVEL >= 10) {
1912 NDR_PRINT_OUT_DEBUG(NetShareAdd, &r);
1915 return r.out.result;
1918 /****************************************************************
1920 ****************************************************************/
1922 NET_API_STATUS NetShareDel(const char * server_name /* [in] */,
1923 const char * net_name /* [in] */,
1924 uint32_t reserved /* [in] */)
1926 struct NetShareDel r;
1927 struct libnetapi_ctx *ctx = NULL;
1928 NET_API_STATUS status;
1931 status = libnetapi_getctx(&ctx);
1937 r.in.server_name = server_name;
1938 r.in.net_name = net_name;
1939 r.in.reserved = reserved;
1941 /* Out parameters */
1943 if (DEBUGLEVEL >= 10) {
1944 NDR_PRINT_IN_DEBUG(NetShareDel, &r);
1947 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
1948 werr = NetShareDel_l(ctx, &r);
1950 werr = NetShareDel_r(ctx, &r);
1953 r.out.result = W_ERROR_V(werr);
1955 if (DEBUGLEVEL >= 10) {
1956 NDR_PRINT_OUT_DEBUG(NetShareDel, &r);
1959 return r.out.result;
1962 /****************************************************************
1964 ****************************************************************/
1966 NET_API_STATUS NetShareEnum(const char * server_name /* [in] */,
1967 uint32_t level /* [in] */,
1968 uint8_t **buffer /* [out] [ref] */,
1969 uint32_t prefmaxlen /* [in] */,
1970 uint32_t *entries_read /* [out] [ref] */,
1971 uint32_t *total_entries /* [out] [ref] */,
1972 uint32_t *resume_handle /* [in,out] [ref] */)
1974 struct NetShareEnum r;
1975 struct libnetapi_ctx *ctx = NULL;
1976 NET_API_STATUS status;
1979 status = libnetapi_getctx(&ctx);
1985 r.in.server_name = server_name;
1987 r.in.prefmaxlen = prefmaxlen;
1988 r.in.resume_handle = resume_handle;
1990 /* Out parameters */
1991 r.out.buffer = buffer;
1992 r.out.entries_read = entries_read;
1993 r.out.total_entries = total_entries;
1994 r.out.resume_handle = resume_handle;
1996 if (DEBUGLEVEL >= 10) {
1997 NDR_PRINT_IN_DEBUG(NetShareEnum, &r);
2000 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
2001 werr = NetShareEnum_l(ctx, &r);
2003 werr = NetShareEnum_r(ctx, &r);
2006 r.out.result = W_ERROR_V(werr);
2008 if (DEBUGLEVEL >= 10) {
2009 NDR_PRINT_OUT_DEBUG(NetShareEnum, &r);
2012 return r.out.result;
2015 /****************************************************************
2017 ****************************************************************/
2019 NET_API_STATUS NetShareGetInfo(const char * server_name /* [in] */,
2020 const char * net_name /* [in] */,
2021 uint32_t level /* [in] */,
2022 uint8_t **buffer /* [out] [ref] */)
2024 struct NetShareGetInfo r;
2025 struct libnetapi_ctx *ctx = NULL;
2026 NET_API_STATUS status;
2029 status = libnetapi_getctx(&ctx);
2035 r.in.server_name = server_name;
2036 r.in.net_name = net_name;
2039 /* Out parameters */
2040 r.out.buffer = buffer;
2042 if (DEBUGLEVEL >= 10) {
2043 NDR_PRINT_IN_DEBUG(NetShareGetInfo, &r);
2046 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
2047 werr = NetShareGetInfo_l(ctx, &r);
2049 werr = NetShareGetInfo_r(ctx, &r);
2052 r.out.result = W_ERROR_V(werr);
2054 if (DEBUGLEVEL >= 10) {
2055 NDR_PRINT_OUT_DEBUG(NetShareGetInfo, &r);
2058 return r.out.result;
2061 /****************************************************************
2063 ****************************************************************/
2065 NET_API_STATUS NetShareSetInfo(const char * server_name /* [in] */,
2066 const char * net_name /* [in] */,
2067 uint32_t level /* [in] */,
2068 uint8_t *buffer /* [in] [ref] */,
2069 uint32_t *parm_err /* [out] [ref] */)
2071 struct NetShareSetInfo r;
2072 struct libnetapi_ctx *ctx = NULL;
2073 NET_API_STATUS status;
2076 status = libnetapi_getctx(&ctx);
2082 r.in.server_name = server_name;
2083 r.in.net_name = net_name;
2085 r.in.buffer = buffer;
2087 /* Out parameters */
2088 r.out.parm_err = parm_err;
2090 if (DEBUGLEVEL >= 10) {
2091 NDR_PRINT_IN_DEBUG(NetShareSetInfo, &r);
2094 if (LIBNETAPI_LOCAL_SERVER(server_name)) {
2095 werr = NetShareSetInfo_l(ctx, &r);
2097 werr = NetShareSetInfo_r(ctx, &r);
2100 r.out.result = W_ERROR_V(werr);
2102 if (DEBUGLEVEL >= 10) {
2103 NDR_PRINT_OUT_DEBUG(NetShareSetInfo, &r);
2106 return r.out.result;