netapi: add NetFileClose to public header.
[Samba/gebeck_regimport.git] / source3 / lib / netapi / netapi.h
bloba95ea50a86fe04ade92edc1a4cc4ace027265d0f
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 #ifndef __LIB_NETAPI_H__
21 #define __LIB_NETAPI_H__
23 #ifdef __cplusplus
24 extern "C" {
25 #endif /* __cplusplus */
27 /****************************************************************
28 NET_API_STATUS
29 ****************************************************************/
30 typedef enum {
31 NET_API_STATUS_SUCCESS = 0
32 } NET_API_STATUS;
34 #define ERROR_MORE_DATA ( 234L )
36 #define ENCRYPTED_PWLEN ( 16 )
38 /****************************************************************
39 ****************************************************************/
41 #ifndef _HEADER_misc
43 struct GUID {
44 uint32_t time_low;
45 uint16_t time_mid;
46 uint16_t time_hi_and_version;
47 uint8_t clock_seq[2];
48 uint8_t node[6];
51 #endif /* _HEADER_misc */
53 #ifndef _HEADER_libnetapi
55 #ifndef MAXSUBAUTHS
56 #define MAXSUBAUTHS 15 /* max sub authorities in a SID */
57 #endif
59 struct domsid {
60 uint8_t sid_rev_num;
61 uint8_t num_auths;
62 uint8_t id_auth[6];
63 uint32_t sub_auths[MAXSUBAUTHS];
66 struct DOMAIN_CONTROLLER_INFO {
67 const char * domain_controller_name;
68 const char * domain_controller_address;
69 uint32_t domain_controller_address_type;
70 struct GUID domain_guid;
71 const char * domain_name;
72 const char * dns_forest_name;
73 uint32_t flags;
74 const char * dc_site_name;
75 const char * client_site_name;
78 /* bitmap NetJoinFlags */
79 #define NETSETUP_JOIN_DOMAIN ( 0x00000001 )
80 #define NETSETUP_ACCT_CREATE ( 0x00000002 )
81 #define NETSETUP_ACCT_DELETE ( 0x00000004 )
82 #define NETSETUP_WIN9X_UPGRADE ( 0x00000010 )
83 #define NETSETUP_DOMAIN_JOIN_IF_JOINED ( 0x00000020 )
84 #define NETSETUP_JOIN_UNSECURE ( 0x00000040 )
85 #define NETSETUP_MACHINE_PWD_PASSED ( 0x00000080 )
86 #define NETSETUP_DEFER_SPN_SET ( 0x00000100 )
87 #define NETSETUP_JOIN_DC_ACCOUNT ( 0x00000200 )
88 #define NETSETUP_JOIN_WITH_NEW_NAME ( 0x00000400 )
89 #define NETSETUP_INSTALL_INVOCATION ( 0x00040000 )
90 #define NETSETUP_IGNORE_UNSUPPORTED_FLAGS ( 0x10000000 )
92 #define FILTER_TEMP_DUPLICATE_ACCOUNT ( 0x0001 )
93 #define FILTER_NORMAL_ACCOUNT ( 0x0002 )
94 #define FILTER_INTERDOMAIN_TRUST_ACCOUNT ( 0x0008 )
95 #define FILTER_WORKSTATION_TRUST_ACCOUNT ( 0x0010 )
96 #define FILTER_SERVER_TRUST_ACCOUNT ( 0x0020 )
98 #define TIMEQ_FOREVER ( (uint32_t)-1L )
100 enum NETSETUP_JOIN_STATUS {
101 NetSetupUnknownStatus=0,
102 NetSetupUnjoined=1,
103 NetSetupWorkgroupName=2,
104 NetSetupDomainName=3
107 struct SERVER_INFO_100 {
108 uint32_t sv100_platform_id;
109 const char * sv100_name;
112 struct SERVER_INFO_101 {
113 uint32_t sv101_platform_id;
114 const char * sv101_name;
115 uint32_t sv101_version_major;
116 uint32_t sv101_version_minor;
117 uint32_t sv101_type;
118 const char * sv101_comment;
121 struct SERVER_INFO_102 {
122 uint32_t sv102_platform_id;
123 const char * sv102_name;
124 uint32_t sv102_version_major;
125 uint32_t sv102_version_minor;
126 uint32_t sv102_type;
127 const char * sv102_comment;
128 uint32_t sv102_users;
129 uint32_t sv102_disc;
130 uint8_t sv102_hidden;
131 uint32_t sv102_announce;
132 uint32_t sv102_anndelta;
133 uint32_t sv102_licenses;
134 const char * sv102_userpath;
138 struct SERVER_INFO_1005 {
139 const char * sv1005_comment;
142 struct USER_INFO_0 {
143 const char * usri0_name;
146 #define USER_PRIV_GUEST ( 0 )
147 #define USER_PRIV_USER ( 1 )
148 #define USER_PRIV_ADMIN ( 2 )
150 struct USER_INFO_1 {
151 const char * usri1_name;
152 const char * usri1_password;
153 uint32_t usri1_password_age;
154 uint32_t usri1_priv;
155 const char * usri1_home_dir;
156 const char * usri1_comment;
157 uint32_t usri1_flags;
158 const char * usri1_script_path;
161 #define AF_OP_PRINT ( 0x1 )
162 #define AF_OP_COMM ( 0x2 )
163 #define AF_OP_SERVER ( 0x4 )
164 #define AF_OP_ACCOUNTS ( 0x8 )
166 struct USER_INFO_2 {
167 const char * usri2_name;
168 const char * usri2_password;
169 uint32_t usri2_password_age;
170 uint32_t usri2_priv;
171 const char * usri2_home_dir;
172 const char * usri2_comment;
173 uint32_t usri2_flags;
174 const char * usri2_script_path;
175 uint32_t usri2_auth_flags;
176 const char * usri2_full_name;
177 const char * usri2_usr_comment;
178 const char * usri2_parms;
179 const char * usri2_workstations;
180 uint32_t usri2_last_logon;
181 uint32_t usri2_last_logoff;
182 uint32_t usri2_acct_expires;
183 uint32_t usri2_max_storage;
184 uint32_t usri2_units_per_week;
185 uint8_t *usri2_logon_hours;/* [unique] */
186 uint32_t usri2_bad_pw_count;
187 uint32_t usri2_num_logons;
188 const char * usri2_logon_server;
189 uint32_t usri2_country_code;
190 uint32_t usri2_code_page;
193 struct USER_INFO_3 {
194 const char * usri3_name;
195 uint32_t usri3_password_age;
196 uint32_t usri3_priv;
197 const char * usri3_home_dir;
198 const char * usri3_comment;
199 uint32_t usri3_flags;
200 const char * usri3_script_path;
201 uint32_t usri3_auth_flags;
202 const char * usri3_full_name;
203 const char * usri3_usr_comment;
204 const char * usri3_parms;
205 const char * usri3_workstations;
206 uint32_t usri3_last_logon;
207 uint32_t usri3_last_logoff;
208 uint32_t usri3_acct_expires;
209 uint32_t usri3_max_storage;
210 uint32_t usri3_units_per_week;
211 uint8_t *usri3_logon_hours;/* [unique] */
212 uint32_t usri3_bad_pw_count;
213 uint32_t usri3_num_logons;
214 const char * usri3_logon_server;
215 uint32_t usri3_country_code;
216 uint32_t usri3_code_page;
217 uint32_t usri3_user_id;
218 uint32_t usri3_primary_group_id;
219 const char * usri3_profile;
220 const char * usri3_home_dir_drive;
221 uint32_t usri3_password_expired;
224 struct USER_INFO_4 {
225 const char * usri4_name;
226 const char * usri4_password;
227 uint32_t usri4_password_age;
228 uint32_t usri4_priv;
229 const char * usri4_home_dir;
230 const char * usri4_comment;
231 uint32_t usri4_flags;
232 const char * usri4_script_path;
233 uint32_t usri4_auth_flags;
234 const char * usri4_full_name;
235 const char * usri4_usr_comment;
236 const char * usri4_parms;
237 const char * usri4_workstations;
238 uint32_t usri4_last_logon;
239 uint32_t usri4_last_logoff;
240 uint32_t usri4_acct_expires;
241 uint32_t usri4_max_storage;
242 uint32_t usri4_units_per_week;
243 uint8_t *usri4_logon_hours;/* [unique] */
244 uint32_t usri4_bad_pw_count;
245 uint32_t usri4_num_logons;
246 const char * usri4_logon_server;
247 uint32_t usri4_country_code;
248 uint32_t usri4_code_page;
249 struct domsid *usri4_user_sid;/* [unique] */
250 uint32_t usri4_primary_group_id;
251 const char * usri4_profile;
252 const char * usri4_home_dir_drive;
253 uint32_t usri4_password_expired;
256 struct USER_INFO_10 {
257 const char * usri10_name;
258 const char * usri10_comment;
259 const char * usri10_usr_comment;
260 const char * usri10_full_name;
263 struct USER_INFO_11 {
264 const char * usri11_name;
265 const char * usri11_comment;
266 const char * usri11_usr_comment;
267 const char * usri11_full_name;
268 uint32_t usri11_priv;
269 uint32_t usri11_auth_flags;
270 uint32_t usri11_password_age;
271 const char * usri11_home_dir;
272 const char * usri11_parms;
273 uint32_t usri11_last_logon;
274 uint32_t usri11_last_logoff;
275 uint32_t usri11_bad_pw_count;
276 uint32_t usri11_num_logons;
277 const char * usri11_logon_server;
278 uint32_t usri11_country_code;
279 const char * usri11_workstations;
280 uint32_t usri11_max_storage;
281 uint32_t usri11_units_per_week;
282 uint8_t *usri11_logon_hours;/* [unique] */
283 uint32_t usri11_code_page;
286 struct USER_INFO_20 {
287 const char * usri20_name;
288 const char * usri20_full_name;
289 const char * usri20_comment;
290 uint32_t usri20_flags;
291 uint32_t usri20_user_id;
294 struct USER_INFO_21 {
295 uint8_t *usri21_password;
298 struct USER_INFO_22 {
299 const char * usri22_name;
300 uint8_t *usri22_password;
301 uint32_t usri22_password_age;
302 uint32_t usri22_priv;
303 const char * usri22_home_dir;
304 const char * usri22_comment;
305 uint32_t usri22_flags;
306 uint32_t usri22_script_path;
307 uint32_t usri22_auth_flags;
308 const char * usri22_full_name;
309 const char * usri22_usr_comment;
310 const char * usri22_parms;
311 const char * usri22_workstations;
312 uint32_t usri22_last_logon;
313 uint32_t usri22_last_logoff;
314 uint32_t usri22_acct_expires;
315 uint32_t usri22_max_storage;
316 uint32_t usri22_units_per_week;
317 uint8_t *usri22_logon_hours;/* [unique] */
318 uint32_t usri22_bad_pw_count;
319 uint32_t usri22_num_logons;
320 const char * usri22_logon_server;
321 uint32_t usri22_country_code;
322 uint32_t usri22_code_page;
325 struct USER_INFO_23 {
326 const char * usri23_name;
327 const char * usri23_full_name;
328 const char * usri23_comment;
329 uint32_t usri23_flags;
330 struct domsid *usri23_user_sid;/* [unique] */
333 struct USER_INFO_1003 {
334 const char * usri1003_password;
337 struct USER_INFO_1005 {
338 uint32_t usri1005_priv;
341 struct USER_INFO_1006 {
342 const char * usri1006_home_dir;
345 struct USER_INFO_1007 {
346 const char * usri1007_comment;
349 struct USER_INFO_1008 {
350 uint32_t usri1008_flags;
353 struct USER_INFO_1009 {
354 const char * usri1009_script_path;
357 struct USER_INFO_1010 {
358 uint32_t usri1010_auth_flags;
361 struct USER_INFO_1011 {
362 const char * usri1011_full_name;
365 struct USER_INFO_1012 {
366 const char * usri1012_usr_comment;
369 struct USER_INFO_1013 {
370 const char * usri1013_parms;
373 struct USER_INFO_1014 {
374 const char * usri1014_workstations;
377 struct USER_INFO_1017 {
378 uint32_t usri1017_acct_expires;
381 struct USER_INFO_1018 {
382 uint32_t usri1018_max_storage;
385 struct USER_INFO_1020 {
386 uint32_t usri1020_units_per_week;
387 uint8_t *usri1020_logon_hours;/* [unique] */
390 struct USER_INFO_1023 {
391 const char * usri1023_logon_server;
394 struct USER_INFO_1024 {
395 uint32_t usri1024_country_code;
398 struct USER_INFO_1025 {
399 uint32_t usri1025_code_page;
402 struct USER_INFO_1051 {
403 uint32_t usri1051_primary_group_id;
406 struct USER_INFO_1052 {
407 const char * usri1052_profile;
410 struct USER_INFO_1053 {
411 const char * usri1053_home_dir_drive;
414 struct USER_MODALS_INFO_0 {
415 uint32_t usrmod0_min_passwd_len;
416 uint32_t usrmod0_max_passwd_age;
417 uint32_t usrmod0_min_passwd_age;
418 uint32_t usrmod0_force_logoff;
419 uint32_t usrmod0_password_hist_len;
422 struct USER_MODALS_INFO_1 {
423 uint32_t usrmod1_role;
424 const char * usrmod1_primary;
427 struct USER_MODALS_INFO_2 {
428 const char * usrmod2_domain_name;
429 struct domsid *usrmod2_domain_id;/* [unique] */
432 struct USER_MODALS_INFO_3 {
433 uint32_t usrmod3_lockout_duration;
434 uint32_t usrmod3_lockout_observation_window;
435 uint32_t usrmod3_lockout_threshold;
438 struct USER_MODALS_INFO_1001 {
439 uint32_t usrmod1001_min_passwd_len;
442 struct USER_MODALS_INFO_1002 {
443 uint32_t usrmod1002_max_passwd_age;
446 struct USER_MODALS_INFO_1003 {
447 uint32_t usrmod1003_min_passwd_age;
450 struct USER_MODALS_INFO_1004 {
451 uint32_t usrmod1004_force_logoff;
454 struct USER_MODALS_INFO_1005 {
455 uint32_t usrmod1005_password_hist_len;
458 struct USER_MODALS_INFO_1006 {
459 uint32_t usrmod1006_role;
462 struct USER_MODALS_INFO_1007 {
463 const char * usrmod1007_primary;
466 struct NET_DISPLAY_USER {
467 const char * usri1_name;
468 const char * usri1_comment;
469 uint32_t usri1_flags;
470 const char * usri1_full_name;
471 uint32_t usri1_user_id;
472 uint32_t usri1_next_index;
475 struct NET_DISPLAY_MACHINE {
476 const char * usri2_name;
477 const char * usri2_comment;
478 uint32_t usri2_flags;
479 uint32_t usri2_user_id;
480 uint32_t usri2_next_index;
483 struct NET_DISPLAY_GROUP {
484 const char * grpi3_name;
485 const char * grpi3_comment;
486 uint32_t grpi3_group_id;
487 uint32_t grpi3_attributes;
488 uint32_t grpi3_next_index;
491 struct GROUP_INFO_0 {
492 const char * grpi0_name;
495 struct GROUP_INFO_1 {
496 const char * grpi1_name;
497 const char * grpi1_comment;
500 struct GROUP_INFO_2 {
501 const char * grpi2_name;
502 const char * grpi2_comment;
503 uint32_t grpi2_group_id;
504 uint32_t grpi2_attributes;
507 struct GROUP_INFO_3 {
508 const char * grpi3_name;
509 const char * grpi3_comment;
510 struct domsid * grpi3_group_sid;
511 uint32_t grpi3_attributes;
514 struct GROUP_INFO_1002 {
515 const char * grpi1002_comment;
518 struct GROUP_INFO_1005 {
519 uint32_t grpi1005_attributes;
522 struct GROUP_USERS_INFO_0 {
523 const char * grui0_name;
526 struct GROUP_USERS_INFO_1 {
527 const char * grui1_name;
528 uint32_t grui1_attributes;
531 struct LOCALGROUP_INFO_0 {
532 const char * lgrpi0_name;
535 struct LOCALGROUP_INFO_1 {
536 const char * lgrpi1_name;
537 const char * lgrpi1_comment;
540 struct LOCALGROUP_INFO_1002 {
541 const char * lgrpi1002_comment;
544 enum SID_NAME_USE {
545 SidTypeUser=1,
546 SidTypeGroup=2,
547 SidTypeDomain=3,
548 SidTypeAlias=4,
549 SidTypeWellKnownGroup=5,
550 SidTypeDeletedAccount=6,
551 SidTypeInvalid=7,
552 SidTypeUnknown=8,
553 SidTypeComputer=9,
554 SidTypeLabel=10
557 struct LOCALGROUP_MEMBERS_INFO_0 {
558 struct domsid *lgrmi0_sid;/* [unique] */
561 struct LOCALGROUP_MEMBERS_INFO_1 {
562 struct domsid *lgrmi1_sid;/* [unique] */
563 enum SID_NAME_USE lgrmi1_sidusage;
564 const char * lgrmi1_name;
567 struct LOCALGROUP_MEMBERS_INFO_2 {
568 struct domsid *lgrmi2_sid;/* [unique] */
569 enum SID_NAME_USE lgrmi2_sidusage;
570 const char * lgrmi2_domainandname;
573 struct LOCALGROUP_MEMBERS_INFO_3 {
574 const char * lgrmi3_domainandname;
577 struct LOCALGROUP_USERS_INFO_0 {
578 const char * lgrui0_name;
581 struct TIME_OF_DAY_INFO {
582 uint32_t tod_elapsedt;
583 uint32_t tod_msecs;
584 uint32_t tod_hours;
585 uint32_t tod_mins;
586 uint32_t tod_secs;
587 uint32_t tod_hunds;
588 int32_t tod_timezone;
589 uint32_t tod_tinterval;
590 uint32_t tod_day;
591 uint32_t tod_month;
592 uint32_t tod_year;
593 uint32_t tod_weekday;
596 struct SHARE_INFO_0 {
597 const char * shi0_netname;
600 struct SHARE_INFO_1 {
601 const char * shi1_netname;
602 uint32_t shi1_type;
603 const char * shi1_remark;
606 struct SHARE_INFO_2 {
607 const char * shi2_netname;
608 uint32_t shi2_type;
609 const char * shi2_remark;
610 uint32_t shi2_permissions;
611 uint32_t shi2_max_uses;
612 uint32_t shi2_current_uses;
613 const char * shi2_path;
614 const char * shi2_passwd;
617 struct SHARE_INFO_501 {
618 const char * shi501_netname;
619 uint32_t shi501_type;
620 const char * shi501_remark;
621 uint32_t shi501_flags;
624 struct SHARE_INFO_1004 {
625 const char * shi1004_remark;
628 struct SHARE_INFO_1005 {
629 uint32_t shi1005_flags;
632 struct SHARE_INFO_1006 {
633 uint32_t shi1006_max_uses;
636 #endif /* _HEADER_libnetapi */
638 /****************************************************************
639 ****************************************************************/
641 struct libnetapi_ctx {
642 char *debuglevel;
643 char *error_string;
644 char *username;
645 char *workgroup;
646 char *password;
647 char *krb5_cc_env;
648 int use_kerberos;
649 int disable_policy_handle_cache;
651 void *private_data;
654 /****************************************************************
655 ****************************************************************/
657 NET_API_STATUS libnetapi_init(struct libnetapi_ctx **ctx);
659 /****************************************************************
660 ****************************************************************/
662 NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx);
664 /****************************************************************
665 ****************************************************************/
667 NET_API_STATUS libnetapi_getctx(struct libnetapi_ctx **ctx);
669 /****************************************************************
670 ****************************************************************/
672 NET_API_STATUS libnetapi_set_debuglevel(struct libnetapi_ctx *ctx,
673 const char *debuglevel);
675 /****************************************************************
676 ****************************************************************/
678 NET_API_STATUS libnetapi_set_username(struct libnetapi_ctx *ctx,
679 const char *username);
681 /****************************************************************
682 ****************************************************************/
684 NET_API_STATUS libnetapi_set_password(struct libnetapi_ctx *ctx,
685 const char *password);
687 /****************************************************************
688 ****************************************************************/
690 NET_API_STATUS libnetapi_set_workgroup(struct libnetapi_ctx *ctx,
691 const char *workgroup);
693 /****************************************************************
694 ****************************************************************/
696 NET_API_STATUS libnetapi_set_use_kerberos(struct libnetapi_ctx *ctx);
698 /****************************************************************
699 ****************************************************************/
701 const char *libnetapi_errstr(NET_API_STATUS status);
703 /****************************************************************
704 ****************************************************************/
706 const char *libnetapi_get_error_string(struct libnetapi_ctx *ctx,
707 NET_API_STATUS status);
709 /****************************************************************
710 NetApiBufferAllocate
711 ****************************************************************/
713 NET_API_STATUS NetApiBufferAllocate(uint32_t byte_count,
714 void **buffer);
716 /****************************************************************
717 NetApiBufferFree
718 ****************************************************************/
720 NET_API_STATUS NetApiBufferFree(void *buffer);
722 /************************************************************//**
724 * ConvertSidToStringSid
726 * @brief Convert a domain sid into a string
728 * @param[in] sid A pointer to a sid structure
729 * @param[in,out] sid_string A pointer that holds a pointer to a sid string. Caller
730 * needs to free with free(3)
731 * @return bool
732 ***************************************************************/
734 int ConvertSidToStringSid(const struct domsid *sid,
735 char **sid_string);
737 /************************************************************//**
739 * ConvertStringSidToSid
741 * @brief Convert a string into a domain sid
743 * @param[in] sid_string A pointer to a sid string.
744 * @param[in,out] sid A pointer that holds a pointer to a sid structure.
745 * Caller needs to free with free(3)
746 * @return bool
747 ***************************************************************/
749 int ConvertStringSidToSid(const char *sid_string,
750 struct domsid **sid);
752 /************************************************************//**
754 * NetJoinDomain
756 * @brief Join a computer to a domain or workgroup
758 * @param[in] server The server name to connect to
759 * @param[in] domain The domain or workgroup to join
760 * @param[in] account_ou The organizational Unit to create the computer account
761 * in (AD only)
762 * @param[in] account The domain account used for joining a domain
763 * @param[in] password The domain account's password used for joining a domain
764 * @param[in] join_flags Bitmask field to define specific join features
765 * @return NET_API_STATUS
767 * example netdomjoin/netdomjoin.c
768 ***************************************************************/
770 NET_API_STATUS NetJoinDomain(const char * server /* [in] */,
771 const char * domain /* [in] [ref] */,
772 const char * account_ou /* [in] */,
773 const char * account /* [in] */,
774 const char * password /* [in] */,
775 uint32_t join_flags /* [in] */);
777 /************************************************************//**
779 * NetUnjoinDomain
781 * @brief Unjoin a computer from a domain or workgroup
783 * @param[in] server_name The server name to connect to
784 * @param[in] account The domain account used for unjoining a domain
785 * @param[in] password The domain account's password used for unjoining a domain
786 * @param[in] unjoin_flags Bitmask field to define specific unjoin features
787 * @return NET_API_STATUS
789 ***************************************************************/
791 NET_API_STATUS NetUnjoinDomain(const char * server_name /* [in] */,
792 const char * account /* [in] */,
793 const char * password /* [in] */,
794 uint32_t unjoin_flags /* [in] */);
796 /************************************************************//**
798 * NetGetJoinInformation
800 * @brief Unjoin a computer from a domain or workgroup
802 * @param[in] server_name The server name to connect to
803 * @param[out] name_buffer Returns the name of the workgroup or domain
804 * @param[out] name_type Returns the type of that name
805 * @return NET_API_STATUS
807 * example netdomjoin-gui/netdomjoin-gui.c
809 ***************************************************************/
811 NET_API_STATUS NetGetJoinInformation(const char * server_name /* [in] */,
812 const char * *name_buffer /* [out] [ref] */,
813 uint16_t *name_type /* [out] [ref] */);
815 /************************************************************//**
817 * NetGetJoinableOUs
819 * @brief Query for the list of joinable organizational Units that can be used
820 * for joining AD
822 * @param[in] server_name The server name to connect to
823 * @param[in] domain The AD domain to query
824 * @param[in] account The domain account used for the query
825 * @param[in] password The domain account's password used for the query
826 * @param[out] ou_count The number of ous returned
827 * @param[out] ous Returned string array containing the ous
828 * @return NET_API_STATUS
830 * example netdomjoin-gui/netdomjoin-gui.c
832 ***************************************************************/
834 NET_API_STATUS NetGetJoinableOUs(const char * server_name /* [in] */,
835 const char * domain /* [in] [ref] */,
836 const char * account /* [in] */,
837 const char * password /* [in] */,
838 uint32_t *ou_count /* [out] [ref] */,
839 const char * **ous /* [out] [ref] */);
841 /************************************************************//**
843 * NetRenameMachineInDomain
845 * @brief Rename a machine in a domain
847 * @param[in] server_name The server name to connect to
848 * @param[in] new_machine_name The new machine name
849 * @param[in] account The domain account used for the query
850 * @param[in] password The domain account's password used for the query
851 * @param[in] rename_options Options used for the rename operation
852 * @return NET_API_STATUS
854 * example join/rename_machine.c
856 ***************************************************************/
858 NET_API_STATUS NetRenameMachineInDomain(const char * server_name /* [in] */,
859 const char * new_machine_name /* [in] */,
860 const char * account /* [in] */,
861 const char * password /* [in] */,
862 uint32_t rename_options /* [in] */);
864 /************************************************************//**
866 * NetServerGetInfo
868 * @brief Get Information on a server
870 * @param[in] server_name The server name to connect to
871 * @param[in] level The level to define which information is requested
872 * @param[out] buffer The returned buffer carrying the SERVER_INFO structure
873 * @return NET_API_STATUS
875 ***************************************************************/
877 NET_API_STATUS NetServerGetInfo(const char * server_name /* [in] */,
878 uint32_t level /* [in] */,
879 uint8_t **buffer /* [out] [ref] */);
881 /************************************************************//**
883 * NetServerSetInfo
885 * @brief Get Information on a server
887 * @param[in] server_name The server name to connect to
888 * @param[in] level The level to define which information is set
889 * @param[in] buffer The buffer carrying the SERVER_INFO structure
890 * @param[out] parm_error On failure returns the invalid SERVER_INFO member
891 * @return NET_API_STATUS
893 ***************************************************************/
895 NET_API_STATUS NetServerSetInfo(const char * server_name /* [in] */,
896 uint32_t level /* [in] */,
897 uint8_t *buffer /* [in] [ref] */,
898 uint32_t *parm_error /* [out] [ref] */);
900 /************************************************************//**
902 * NetGetDCName
904 * @brief Query for the PDC for a given domain
906 * @param[in] server_name The server name to connect to
907 * @param[in] domain_name The name of the domain to lookup
908 * @param[out] buffer The name of the domain to lookup
909 * @return NET_API_STATUS
911 * example getdc/getdc.c
912 ***************************************************************/
914 NET_API_STATUS NetGetDCName(const char * server_name /* [in] */,
915 const char * domain_name /* [in] */,
916 uint8_t **buffer /* [out] [ref] */);
918 /************************************************************//**
920 * NetGetAnyDCName
922 * @brief Query for any DC for a given domain
924 * @param[in] server_name The server name to connect to
925 * @param[in] domain_name The name of the domain to lookup
926 * @param[out] buffer The name of the domain to lookup
927 * @return NET_API_STATUS
929 * example getdc/getdc.c
930 ***************************************************************/
932 NET_API_STATUS NetGetAnyDCName(const char * server_name /* [in] */,
933 const char * domain_name /* [in] */,
934 uint8_t **buffer /* [out] [ref] */);
937 /************************************************************//**
939 * DsGetDcName
941 * @brief Lookup a DC for a given domain and return information structure
943 * @param[in] server_name The server name to connect to
944 * @param[in] domain_name The name of the domain to lookup (cannot be NULL)
945 * @param[in] domain_guid The GUID of the domain to lookup (optional)
946 * @param[in] site_name The name of the site the DC should reside in
947 * @param[in] flags A bitmask to request specific features supported by the DC
948 * @param[out] dc_info Pointer to a DOMAIN_CONTROLLER_INFO structure
949 * @return NET_API_STATUS
951 * example dsgetdc/dsgetdc.c
952 ***************************************************************/
954 NET_API_STATUS DsGetDcName(const char * server_name /* [in] [unique] */,
955 const char * domain_name /* [in] [ref] */,
956 struct GUID *domain_guid /* [in] [unique] */,
957 const char * site_name /* [in] [unique] */,
958 uint32_t flags /* [in] */,
959 struct DOMAIN_CONTROLLER_INFO **dc_info /* [out] [ref] */);
961 /************************************************************//**
963 * NetUserAdd
965 * @brief Create a user on a given server
967 * @param[in] server_name The server name to connect to
968 * @param[in] level The level of the USER_INFO structure passed in (Currently
969 * only level 1 is supported)
970 * @param[in] buffer The buffer carrying the USER_INFO structure
971 * @param[out] parm_error In case of error returns the failing member of the
972 * structure
973 * @return NET_API_STATUS
975 * example user/user_add.c
976 ***************************************************************/
978 NET_API_STATUS NetUserAdd(const char * server_name /* [in] */,
979 uint32_t level /* [in] */,
980 uint8_t *buffer /* [in] [ref] */,
981 uint32_t *parm_error /* [out] [ref] */);
983 /************************************************************//**
985 * NetUserDel
987 * @brief Delete a user on a given server
989 * @param[in] server_name The server name to connect to
990 * @param[in] user_name The user account to delete
991 * @return NET_API_STATUS
993 * example user/user_del.c
994 ***************************************************************/
996 NET_API_STATUS NetUserDel(const char * server_name /* [in] */,
997 const char * user_name /* [in] */);
999 /************************************************************//**
1001 * NetUserEnum
1003 * @brief Enumerate accounts on a server
1005 * @param[in] server_name The server name to connect to
1006 * @param[in] level The enumeration level used for the query (Currently only
1007 * level 0 is supported)
1008 * @param[in] filter The account flags filter used for the query
1009 * @param[out] buffer The returned enumeration buffer
1010 * @param[in] prefmaxlen The requested maximal buffer size
1011 * @param[out] entries_read The number of returned entries
1012 * @param[out] total_entries The number of total entries
1013 * @param[in,out] resume_handle A handle passed in and returned for resuming
1014 * operations
1015 * @return NET_API_STATUS
1017 * example user/user_enum.c
1018 ***************************************************************/
1020 NET_API_STATUS NetUserEnum(const char * server_name /* [in] */,
1021 uint32_t level /* [in] */,
1022 uint32_t filter /* [in] */,
1023 uint8_t **buffer /* [out] [ref] */,
1024 uint32_t prefmaxlen /* [in] */,
1025 uint32_t *entries_read /* [out] [ref] */,
1026 uint32_t *total_entries /* [out] [ref] */,
1027 uint32_t *resume_handle /* [in,out] [ref] */);
1029 /************************************************************//**
1031 * NetUserChangePassword
1033 * @brief Change the password for a user on a given server or in a given domain
1035 * @param[in] domain_name The server or domain name to connect to
1036 * @param[in] user_name The user account to change the password for
1037 * @param[in] old_password The user account's old password
1038 * @param[in] new_password The user account's new password
1039 * @return NET_API_STATUS
1041 * example user/user_chgpwd.c
1042 ***************************************************************/
1044 NET_API_STATUS NetUserChangePassword(const char * domain_name /* [in] */,
1045 const char * user_name /* [in] */,
1046 const char * old_password /* [in] */,
1047 const char * new_password /* [in] */);
1049 /************************************************************//**
1051 * NetUserGetInfo
1053 * @brief Get User Information
1055 * @param[in] server_name The server name to connect to
1056 * @param[in] user_name The name of the user that is going to be queried
1057 * @param[in] level The level defining the requested USER_INFO_X structure
1058 * @param[out] buffer The buffer containing a USER_INFO_X structure
1059 * @return NET_API_STATUS
1061 * example user/user_getinfo.c
1062 ***************************************************************/
1064 NET_API_STATUS NetUserGetInfo(const char * server_name /* [in] */,
1065 const char * user_name /* [in] */,
1066 uint32_t level /* [in] */,
1067 uint8_t **buffer /* [out] [ref] */);
1069 /************************************************************//**
1071 * NetUserSetInfo
1073 * @brief Set User Information
1075 * @param[in] server_name The server name to connect to
1076 * @param[in] user_name The name of the user that is going to be modified
1077 * @param[in] level The level defining the requested USER_INFO_X structure
1078 * @param[in] buffer The buffer containing a USER_INFO_X structure
1079 * @param[out] parm_err The returned parameter error number if any
1080 * @return NET_API_STATUS
1082 * example user/user_setinfo.c
1083 ***************************************************************/
1085 NET_API_STATUS NetUserSetInfo(const char * server_name /* [in] */,
1086 const char * user_name /* [in] */,
1087 uint32_t level /* [in] */,
1088 uint8_t *buffer /* [in] [ref] */,
1089 uint32_t *parm_err /* [out] [ref] */);
1091 /************************************************************//**
1093 * NetUserModalsGet
1095 * @brief Get SAM domain and password information
1097 * @param[in] server_name The server name to connect to
1098 * @param[in] level The level defining which USER_MODALS_INFO_X buffer to query
1099 * @param[out] buffer The returned USER_MODALS_INFO_X buffer
1100 * @return NET_API_STATUS
1102 * example user/user_modalsget.c
1103 ***************************************************************/
1105 NET_API_STATUS NetUserModalsGet(const char * server_name /* [in] */,
1106 uint32_t level /* [in] */,
1107 uint8_t **buffer /* [out] [ref] */);
1109 /************************************************************//**
1111 * NetUserModalsSet
1113 * @brief Set SAM domain and password information
1115 * @param[in] server_name The server name to connect to
1116 * @param[in] level The level defining which USER_MODALS_INFO_X buffer to query
1117 * @param[out] buffer The buffer conntaing a USER_MODALS_INFO_X structure
1118 * @param[out] parm_err The returned parameter error number if any
1119 * @return NET_API_STATUS
1121 * example user/user_modalsset.c
1122 ***************************************************************/
1124 NET_API_STATUS NetUserModalsSet(const char * server_name /* [in] */,
1125 uint32_t level /* [in] */,
1126 uint8_t *buffer /* [in] [ref] */,
1127 uint32_t *parm_err /* [out] [ref] */);
1129 /************************************************************//**
1131 * NetUserGetGroups
1133 * @brief Enumerate grouplist of a user on a server
1135 * @param[in] server_name The server name to connect to
1136 * @param[in] user_name The user name to query
1137 * @param[in] level The enumeration level used for the query (Currently only
1138 * level 0 is supported)
1139 * @param[out] buffer The returned enumeration buffer
1140 * @param[in] prefmaxlen The requested maximal buffer size
1141 * @param[out] entries_read The number of returned entries
1142 * @param[out] total_entries The number of total entries
1143 * @return NET_API_STATUS
1145 * example user/user_getgroups.c
1146 ***************************************************************/
1148 NET_API_STATUS NetUserGetGroups(const char * server_name /* [in] */,
1149 const char * user_name /* [in] */,
1150 uint32_t level /* [in] */,
1151 uint8_t **buffer /* [out] [ref] */,
1152 uint32_t prefmaxlen /* [in] */,
1153 uint32_t *entries_read /* [out] [ref] */,
1154 uint32_t *total_entries /* [out] [ref] */);
1156 /************************************************************//**
1158 * NetUserSetGroups
1160 * @brief Set grouplist of a user on a server
1162 * @param[in] server_name The server name to connect to
1163 * @param[in] user_name The user name to query
1164 * @param[in] level The level defining the GROUP_USERS_INFO_X structures in the buffer
1165 * @param[in] buffer The buffer containing GROUP_USERS_INFO_X structures
1166 * @param[in] num_entries The number of X structures in the buffer
1167 * @return NET_API_STATUS
1169 * example user/user_setgroups.c
1170 ***************************************************************/
1172 NET_API_STATUS NetUserSetGroups(const char * server_name /* [in] */,
1173 const char * user_name /* [in] */,
1174 uint32_t level /* [in] */,
1175 uint8_t *buffer /* [in] [ref] */,
1176 uint32_t num_entries /* [in] */);
1178 /************************************************************//**
1180 * NetUserGetLocalGroups
1182 * @brief Enumerate local grouplist of a user on a server
1184 * @param[in] server_name The server name to connect to
1185 * @param[in] user_name The user name to query
1186 * @param[in] level The enumeration level used for the query
1187 * @param[in] flags The flags used for the query
1188 * @param[out] buffer The returned enumeration buffer
1189 * @param[in] prefmaxlen The requested maximal buffer size
1190 * @param[out] entries_read The number of returned entries
1191 * @param[out] total_entries The number of total entries
1192 * @return NET_API_STATUS
1194 * example user/user_getlocalgroups.c
1195 ***************************************************************/
1197 NET_API_STATUS NetUserGetLocalGroups(const char * server_name /* [in] */,
1198 const char * user_name /* [in] */,
1199 uint32_t level /* [in] */,
1200 uint32_t flags /* [in] */,
1201 uint8_t **buffer /* [out] [ref] */,
1202 uint32_t prefmaxlen /* [in] */,
1203 uint32_t *entries_read /* [out] [ref] */,
1204 uint32_t *total_entries /* [out] [ref] */);
1206 /************************************************************//**
1208 * NetQueryDisplayInformation
1210 * @brief Enumerate accounts on a server
1212 * @param[in] server_name The server name to connect to
1213 * @param[in] level The enumeration level used for the query
1214 * @param[in] idx The index to start the the display enumeration at
1215 * @param[in] entries_requested The number of entries requested
1216 * @param[in] prefmaxlen The requested maximal buffer size
1217 * @param[out] entries_read The number of returned entries
1218 * @param[out] buffer The returned display information buffer
1219 * @return NET_API_STATUS
1221 * example user/user_dispinfo.c
1222 ***************************************************************/
1224 NET_API_STATUS NetQueryDisplayInformation(const char * server_name /* [in] [unique] */,
1225 uint32_t level /* [in] */,
1226 uint32_t idx /* [in] */,
1227 uint32_t entries_requested /* [in] */,
1228 uint32_t prefmaxlen /* [in] */,
1229 uint32_t *entries_read /* [out] [ref] */,
1230 void **buffer /* [out] [noprint,ref] */);
1232 /************************************************************//**
1234 * NetGroupAdd
1236 * @brief Create Domain Group
1238 * @param[in] server_name The server name to connect to
1239 * @param[in] level The level used for the new group creation
1240 * @param[in] buf The buffer containing the group structure
1241 * @param[out] parm_err The returned parameter error number if any
1242 * @return NET_API_STATUS
1244 * example group/group_add.c
1245 ***************************************************************/
1247 NET_API_STATUS NetGroupAdd(const char * server_name /* [in] */,
1248 uint32_t level /* [in] */,
1249 uint8_t *buf /* [in] [ref] */,
1250 uint32_t *parm_err /* [out] [ref] */);
1252 /************************************************************//**
1254 * NetGroupDel
1256 * @brief Delete Domain Group
1258 * @param[in] server_name The server name to connect to
1259 * @param[in] group_name The name of the group that is going to be deleted
1260 * @return NET_API_STATUS
1262 * example group/group_del.c
1263 ***************************************************************/
1265 NET_API_STATUS NetGroupDel(const char * server_name /* [in] */,
1266 const char * group_name /* [in] */);
1268 /************************************************************//**
1270 * NetGroupEnum
1272 * @brief Enumerate groups on a server
1274 * @param[in] server_name The server name to connect to
1275 * @param[in] level The enumeration level used for the query (Currently only
1276 * level 0 is supported)
1277 * @param[out] buffer The returned enumeration buffer
1278 * @param[in] prefmaxlen The requested maximal buffer size
1279 * @param[out] entries_read The number of returned entries
1280 * @param[out] total_entries The number of total entries
1281 * @param[in,out] resume_handle A handle passed in and returned for resuming
1282 * operations
1283 * @return NET_API_STATUS
1285 * example group/group_enum.c
1286 ***************************************************************/
1288 NET_API_STATUS NetGroupEnum(const char * server_name /* [in] */,
1289 uint32_t level /* [in] */,
1290 uint8_t **buffer /* [out] [ref] */,
1291 uint32_t prefmaxlen /* [in] */,
1292 uint32_t *entries_read /* [out] [ref] */,
1293 uint32_t *total_entries /* [out] [ref] */,
1294 uint32_t *resume_handle /* [in,out] [ref] */);
1296 /************************************************************//**
1298 * NetGroupSetInfo
1300 * @brief Set Domain Group Information
1302 * @param[in] server_name The server name to connect to
1303 * @param[in] group_name The name of the group that is going to be modified
1304 * @param[in] level The level defining the structure type in buf
1305 * @param[in] buf The buffer containing a GROUP_INFO_X structure
1306 * @param[out] parm_err The returned parameter error number if any
1307 * @return NET_API_STATUS
1309 * example group/group_setinfo.c
1310 ***************************************************************/
1312 NET_API_STATUS NetGroupSetInfo(const char * server_name /* [in] */,
1313 const char * group_name /* [in] */,
1314 uint32_t level /* [in] */,
1315 uint8_t *buf /* [in] [ref] */,
1316 uint32_t *parm_err /* [out] [ref] */);
1318 /************************************************************//**
1320 * NetGroupGetInfo
1322 * @brief Get Domain Group Information
1324 * @param[in] server_name The server name to connect to
1325 * @param[in] group_name The name of the group that is going to be queried
1326 * @param[in] level The level defining the requested GROUP_INFO_X structure
1327 * @param[out] buf The buffer containing a GROUP_INFO_X structure
1328 * @return NET_API_STATUS
1330 * example group/group_getinfo.c
1331 ***************************************************************/
1333 NET_API_STATUS NetGroupGetInfo(const char * server_name /* [in] */,
1334 const char * group_name /* [in] */,
1335 uint32_t level /* [in] */,
1336 uint8_t **buf /* [out] [ref] */);
1338 /************************************************************//**
1340 * NetGroupAddUser
1342 * @brief Add existing User to existing Domain Group
1344 * @param[in] server_name The server name to connect to
1345 * @param[in] group_name The name of the group that is going to be modified
1346 * @param[in] user_name The name of the user that is going to be added to the
1347 * group
1348 * @return NET_API_STATUS
1350 * example group/group_adduser.c
1351 ***************************************************************/
1353 NET_API_STATUS NetGroupAddUser(const char * server_name /* [in] */,
1354 const char * group_name /* [in] */,
1355 const char * user_name /* [in] */);
1357 /************************************************************//**
1359 * NetGroupDelUser
1361 * @brief Remove User from Domain Group
1363 * @param[in] server_name The server name to connect to
1364 * @param[in] group_name The name of the group that is going to be modified
1365 * @param[in] user_name The name of the user that is going to be removed from
1366 * the group
1367 * @return NET_API_STATUS
1369 * example group/group_deluser.c
1370 ***************************************************************/
1372 NET_API_STATUS NetGroupDelUser(const char * server_name /* [in] */,
1373 const char * group_name /* [in] */,
1374 const char * user_name /* [in] */);
1376 /************************************************************//**
1378 * NetGroupGetUsers
1380 * @brief Get Users for a group on a server
1382 * @param[in] server_name The server name to connect to
1383 * @param[in] group_name The group name to enumerate users for
1384 * @param[in] level The enumeration level used for the query
1385 * @param[out] buffer The returned enumeration buffer
1386 * @param[in] prefmaxlen The requested maximal buffer size
1387 * @param[out] entries_read The number of returned entries
1388 * @param[out] total_entries The number of total entries
1389 * @param[in,out] resume_handle A handle passed in and returned for resuming
1390 * operations
1391 * @return NET_API_STATUS
1393 * example group/group_getusers.c
1394 ***************************************************************/
1396 NET_API_STATUS NetGroupGetUsers(const char * server_name /* [in] */,
1397 const char * group_name /* [in] */,
1398 uint32_t level /* [in] */,
1399 uint8_t **buffer /* [out] [ref] */,
1400 uint32_t prefmaxlen /* [in] */,
1401 uint32_t *entries_read /* [out] [ref] */,
1402 uint32_t *total_entries /* [out] [ref] */,
1403 uint32_t *resume_handle /* [in,out] [ref] */);
1405 /************************************************************//**
1407 * NetGroupSetUsers
1409 * @brief Set Users for a group on a server
1411 * @param[in] server_name The server name to connect to
1412 * @param[in] group_name The group name to enumerate users for
1413 * @param[in] level The enumeration level used for the query
1414 * @param[in] buffer The buffer containing a X structure
1415 * @param[in] num_entries The number of X entries in the buffer
1416 * @return NET_API_STATUS
1418 * example group/group_setusers.c
1419 ***************************************************************/
1421 NET_API_STATUS NetGroupSetUsers(const char * server_name /* [in] */,
1422 const char * group_name /* [in] */,
1423 uint32_t level /* [in] */,
1424 uint8_t *buffer /* [in] [ref] */,
1425 uint32_t num_entries /* [in] */);
1427 /************************************************************//**
1429 * NetLocalGroupAdd
1431 * @brief Create Local Group
1433 * @param[in] server_name The server name to connect to
1434 * @param[in] level The level used for the new group creation
1435 * @param[in] buf The buffer containing the group structure
1436 * @param[out] parm_err The returned parameter error number if any
1437 * @return NET_API_STATUS
1439 * example localgroup/localgroup_add.c
1440 ***************************************************************/
1442 NET_API_STATUS NetLocalGroupAdd(const char * server_name /* [in] */,
1443 uint32_t level /* [in] */,
1444 uint8_t *buf /* [in] [ref] */,
1445 uint32_t *parm_err /* [out] [ref] */);
1447 /************************************************************//**
1449 * NetLocalGroupDel
1451 * @brief Delete Local Group
1453 * @param[in] server_name The server name to connect to
1454 * @param[in] group_name The name of the group that is going to be deleted
1455 * @return NET_API_STATUS
1457 * example localgroup/localgroup_del.c
1458 ***************************************************************/
1461 NET_API_STATUS NetLocalGroupDel(const char * server_name /* [in] */,
1462 const char * group_name /* [in] */);
1464 /************************************************************//**
1466 * NetLocalGroupGetInfo
1468 * @brief Get Local Group Information
1470 * @param[in] server_name The server name to connect to
1471 * @param[in] group_name The name of the group that is going to be queried
1472 * @param[in] level The level defining the requested LOCALGROUP_INFO_X structure
1473 * @param[out] buf The buffer containing a LOCALGROUP_INFO_X structure
1474 * @return NET_API_STATUS
1476 * example localgroup/localgroup_getinfo.c
1477 ***************************************************************/
1479 NET_API_STATUS NetLocalGroupGetInfo(const char * server_name /* [in] */,
1480 const char * group_name /* [in] */,
1481 uint32_t level /* [in] */,
1482 uint8_t **buf /* [out] [ref] */);
1484 /************************************************************//**
1486 * NetLocalGroupSetInfo
1488 * @brief Set Local Group Information
1490 * @param[in] server_name The server name to connect to
1491 * @param[in] group_name The name of the group that is going to be modified
1492 * @param[in] level The level defining the requested LOCALGROUP_INFO_X structure
1493 * @param[in] buf The buffer containing a LOCALGROUP_INFO_X structure
1494 * @param[out] parm_err The returned parameter error number if any
1495 * @return NET_API_STATUS
1497 * example localgroup/localgroup_setinfo.c
1498 ***************************************************************/
1501 NET_API_STATUS NetLocalGroupSetInfo(const char * server_name /* [in] */,
1502 const char * group_name /* [in] */,
1503 uint32_t level /* [in] */,
1504 uint8_t *buf /* [in] [ref] */,
1505 uint32_t *parm_err /* [out] [ref] */);
1507 /************************************************************//**
1509 * NetLocalGroupEnum
1511 * @brief Enumerate local groups on a server
1513 * @param[in] server_name The server name to connect to
1514 * @param[in] level The enumeration level used for the query (Currently only
1515 * level 0 is supported)
1516 * @param[out] buffer The returned enumeration buffer
1517 * @param[in] prefmaxlen The requested maximal buffer size
1518 * @param[out] entries_read The number of returned entries
1519 * @param[out] total_entries The number of total entries
1520 * @param[in,out] resume_handle A handle passed in and returned for resuming
1521 * operations
1522 * @return NET_API_STATUS
1524 * example localgroup/localgroup_enum.c
1525 ***************************************************************/
1527 NET_API_STATUS NetLocalGroupEnum(const char * server_name /* [in] */,
1528 uint32_t level /* [in] */,
1529 uint8_t **buffer /* [out] [ref] */,
1530 uint32_t prefmaxlen /* [in] */,
1531 uint32_t *entries_read /* [out] [ref] */,
1532 uint32_t *total_entries /* [out] [ref] */,
1533 uint32_t *resume_handle /* [in,out] [ref] */);
1535 /************************************************************//**
1537 * NetLocalGroupAddMembers
1539 * @brief Add Members to a Local Group
1541 * @param[in] server_name The server name to connect to
1542 * @param[in] group_name The name of the group that is going to modified
1543 * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1544 * @param[in] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X structure
1545 * @param[in] total_entries The number of LOCALGROUP_MEMBERS_INFO_X entries in
1546 * the buffer
1547 * @return NET_API_STATUS
1549 * example localgroup/localgroup_addmembers.c
1550 ***************************************************************/
1552 NET_API_STATUS NetLocalGroupAddMembers(const char * server_name /* [in] */,
1553 const char * group_name /* [in] */,
1554 uint32_t level /* [in] */,
1555 uint8_t *buffer /* [in] [ref] */,
1556 uint32_t total_entries /* [in] */);
1558 /************************************************************//**
1560 * NetLocalGroupDelMembers
1562 * @brief Delete Members from a Local Group
1564 * @param[in] server_name The server name to connect to
1565 * @param[in] group_name The name of the group that is going to modified
1566 * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1567 * @param[in] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X structure
1568 * @param[in] total_entries The number of LOCALGROUP_MEMBERS_INFO_X entries in
1569 * the buffer
1570 * @return NET_API_STATUS
1572 * example localgroup/localgroup_delmembers.c
1573 ***************************************************************/
1575 NET_API_STATUS NetLocalGroupDelMembers(const char * server_name /* [in] */,
1576 const char * group_name /* [in] */,
1577 uint32_t level /* [in] */,
1578 uint8_t *buffer /* [in] [ref] */,
1579 uint32_t total_entries /* [in] */);
1581 /************************************************************//**
1583 * NetLocalGroupGetMembers
1585 * @brief Enumerate Members in a local group
1587 * @param[in] server_name The server name to connect to
1588 * @param[in] local_group_name The localgroup that is going to be queried
1589 * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1590 * @param[out] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X
1591 * structure
1592 * @param[in] prefmaxlen The requested maximal buffer size
1593 * @param[out] entries_read The number of LOCALGROUP_MEMBERS_INFO_X entries in the buffer
1594 * @param[out] total_entries The total number of LOCALGROUP_MEMBERS_INFO_X entries for that group
1595 * @param[in,out] resume_handle A handle passed in and returned for resuming
1596 * operations
1597 * @return NET_API_STATUS
1599 * example localgroup/localgroup_getmembers.c
1600 ***************************************************************/
1602 NET_API_STATUS NetLocalGroupGetMembers(const char * server_name /* [in] */,
1603 const char * local_group_name /* [in] */,
1604 uint32_t level /* [in] */,
1605 uint8_t **buffer /* [out] [ref] */,
1606 uint32_t prefmaxlen /* [in] */,
1607 uint32_t *entries_read /* [out] [ref] */,
1608 uint32_t *total_entries /* [out] [ref] */,
1609 uint32_t *resume_handle /* [in,out] [ref] */);
1611 /************************************************************//**
1613 * NetLocalGroupSetMembers
1615 * @brief Set Members in a Local Group
1617 * @param[in] server_name The server name to connect to
1618 * @param[in] group_name The name of the group that is going to modified
1619 * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1620 * @param[in] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X structure
1621 * @param[in] total_entries The number of LOCALGROUP_MEMBERS_INFO_X entries in
1622 * the buffer
1623 * @return NET_API_STATUS
1625 * example localgroup/localgroup_setmembers.c
1626 ***************************************************************/
1628 NET_API_STATUS NetLocalGroupSetMembers(const char * server_name /* [in] */,
1629 const char * group_name /* [in] */,
1630 uint32_t level /* [in] */,
1631 uint8_t *buffer /* [in] [ref] */,
1632 uint32_t total_entries /* [in] */);
1634 /************************************************************//**
1636 * NetRemoteTOD
1638 * @brief Query remote Time of Day
1640 * @param[in] server_name The server name to connect to
1641 * @param[out] buf The buffer containing a TIME_OF_DAY_INFO structure
1642 * @return NET_API_STATUS
1644 * example server/remote_tod.c
1645 ***************************************************************/
1647 NET_API_STATUS NetRemoteTOD(const char * server_name /* [in] */,
1648 uint8_t **buf /* [out] [ref] */);
1650 /************************************************************//**
1652 * NetShareAdd
1654 * @brief Add Share
1656 * @param[in] server_name The server name to connect to
1657 * @param[in] level The level defining the requested SHARE_INFO_X structure
1658 * @param[in] buffer The buffer containing a SHARE_INFO_X structure
1659 * @param[out] parm_err The returned parameter error number if any
1660 * @return NET_API_STATUS
1662 * example share/share_add.c
1663 ***************************************************************/
1665 NET_API_STATUS NetShareAdd(const char * server_name /* [in] */,
1666 uint32_t level /* [in] */,
1667 uint8_t *buffer /* [in] [ref] */,
1668 uint32_t *parm_err /* [out] [ref] */);
1670 /************************************************************//**
1672 * NetShareDel
1674 * @brief Delete Share
1676 * @param[in] server_name The server name to connect to
1677 * @param[in] net_name The name of the share to delete
1678 * @param[in] reserved
1679 * @return NET_API_STATUS
1681 * example share/share_del.c
1682 ***************************************************************/
1684 NET_API_STATUS NetShareDel(const char * server_name /* [in] */,
1685 const char * net_name /* [in] */,
1686 uint32_t reserved /* [in] */);
1688 /************************************************************//**
1690 * NetShareEnum
1692 * @brief Enumerate Shares
1694 * @param[in] server_name The server name to connect to
1695 * @param[in] level The level defining the SHARE_INFO_X structure
1696 * @param[out] buffer The buffer containing a SHARE_INFO_X structure
1697 * @param[in] prefmaxlen The requested maximal buffer size
1698 * @param[out] entries_read The number of SHARE_INFO_X entries in the buffer
1699 * @param[out] total_entries The total number of SHARE_INFO_X entries
1700 * @param[in,out] resume_handle A handle passed in and returned for resuming
1701 * operations
1702 * @return NET_API_STATUS
1704 * example share/share_enum.c
1705 ***************************************************************/
1707 NET_API_STATUS NetShareEnum(const char * server_name /* [in] */,
1708 uint32_t level /* [in] */,
1709 uint8_t **buffer /* [out] [ref] */,
1710 uint32_t prefmaxlen /* [in] */,
1711 uint32_t *entries_read /* [out] [ref] */,
1712 uint32_t *total_entries /* [out] [ref] */,
1713 uint32_t *resume_handle /* [in,out] [ref] */);
1715 /************************************************************//**
1717 * NetShareGetInfo
1719 * @brief Get Share Info
1721 * @param[in] server_name The server name to connect to
1722 * @param[in] net_name The name of the share to query
1723 * @param[in] level The level defining the SHARE_INFO_X structure
1724 * @param[out] buffer The buffer containing a SHARE_INFO_X structure
1725 * @return NET_API_STATUS
1727 * example share/share_getinfo.c
1728 ***************************************************************/
1730 NET_API_STATUS NetShareGetInfo(const char * server_name /* [in] */,
1731 const char * net_name /* [in] */,
1732 uint32_t level /* [in] */,
1733 uint8_t **buffer /* [out] [ref] */);
1735 /************************************************************//**
1737 * NetShareSetInfo
1739 * @brief Set Share Info
1741 * @param[in] server_name The server name to connect to
1742 * @param[in] net_name The name of the share to query
1743 * @param[in] level The level defining the SHARE_INFO_X structure
1744 * @param[in] buffer The buffer containing a SHARE_INFO_X structure
1745 * @param[out] parm_err The returned parameter error number if any
1746 * @return NET_API_STATUS
1748 * example share/share_setinfo.c
1749 ***************************************************************/
1751 NET_API_STATUS NetShareSetInfo(const char * server_name /* [in] */,
1752 const char * net_name /* [in] */,
1753 uint32_t level /* [in] */,
1754 uint8_t *buffer /* [in] [ref] */,
1755 uint32_t *parm_err /* [out] [ref] */);
1757 /************************************************************//**
1759 * NetFileClose
1761 * @brief Close a file
1763 * @param[in] server_name The server name to connect to
1764 * @param[in] fileid The fileid of the file that is going to be closed
1765 * @return NET_API_STATUS
1767 * example file/file_close.c
1768 ***************************************************************/
1770 NET_API_STATUS NetFileClose(const char * server_name /* [in] */,
1771 uint32_t fileid /* [in] */);
1773 #ifdef __cplusplus
1775 #endif /* __cplusplus */
1777 #endif /* __LIB_NETAPI_H__ */