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/>.
20 #ifndef __LIB_NETAPI_H__
21 #define __LIB_NETAPI_H__
25 #endif /* __cplusplus */
27 /****************************************************************
29 ****************************************************************/
31 NET_API_STATUS_SUCCESS
= 0
34 #define ERROR_MORE_DATA ( 234L )
36 #define ENCRYPTED_PWLEN ( 16 )
38 /****************************************************************
39 ****************************************************************/
46 uint16_t time_hi_and_version
;
51 #endif /* _HEADER_misc */
53 #ifndef _HEADER_libnetapi
56 #define MAXSUBAUTHS 15 /* max sub authorities in a SID */
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
;
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,
103 NetSetupWorkgroupName
=2,
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
;
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
;
127 const char * sv102_comment
;
128 uint32_t sv102_users
;
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
;
143 const char * usri0_name
;
146 #define USER_PRIV_GUEST ( 0 )
147 #define USER_PRIV_USER ( 1 )
148 #define USER_PRIV_ADMIN ( 2 )
151 const char * usri1_name
;
152 const char * usri1_password
;
153 uint32_t usri1_password_age
;
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 )
167 const char * usri2_name
;
168 const char * usri2_password
;
169 uint32_t usri2_password_age
;
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
;
194 const char * usri3_name
;
195 uint32_t usri3_password_age
;
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
;
225 const char * usri4_name
;
226 const char * usri4_password
;
227 uint32_t usri4_password_age
;
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
;
549 SidTypeWellKnownGroup
=5,
550 SidTypeDeletedAccount
=6,
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
;
588 int32_t tod_timezone
;
589 uint32_t tod_tinterval
;
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
;
603 const char * shi1_remark
;
606 struct SHARE_INFO_2
{
607 const char * shi2_netname
;
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
;
642 uint32_t fi3_permissions
;
643 uint32_t fi3_num_locks
;
644 const char * fi3_pathname
;
645 const char * fi3_username
;
648 #endif /* _HEADER_libnetapi */
650 /****************************************************************
651 ****************************************************************/
653 struct libnetapi_ctx
{
661 int disable_policy_handle_cache
;
666 /****************************************************************
667 ****************************************************************/
669 NET_API_STATUS
libnetapi_init(struct libnetapi_ctx
**ctx
);
671 /****************************************************************
672 ****************************************************************/
674 NET_API_STATUS
libnetapi_free(struct libnetapi_ctx
*ctx
);
676 /****************************************************************
677 ****************************************************************/
679 NET_API_STATUS
libnetapi_getctx(struct libnetapi_ctx
**ctx
);
681 /****************************************************************
682 ****************************************************************/
684 NET_API_STATUS
libnetapi_set_debuglevel(struct libnetapi_ctx
*ctx
,
685 const char *debuglevel
);
687 /****************************************************************
688 ****************************************************************/
690 NET_API_STATUS
libnetapi_set_username(struct libnetapi_ctx
*ctx
,
691 const char *username
);
693 /****************************************************************
694 ****************************************************************/
696 NET_API_STATUS
libnetapi_set_password(struct libnetapi_ctx
*ctx
,
697 const char *password
);
699 /****************************************************************
700 ****************************************************************/
702 NET_API_STATUS
libnetapi_set_workgroup(struct libnetapi_ctx
*ctx
,
703 const char *workgroup
);
705 /****************************************************************
706 ****************************************************************/
708 NET_API_STATUS
libnetapi_set_use_kerberos(struct libnetapi_ctx
*ctx
);
710 /****************************************************************
711 ****************************************************************/
713 const char *libnetapi_errstr(NET_API_STATUS status
);
715 /****************************************************************
716 ****************************************************************/
718 const char *libnetapi_get_error_string(struct libnetapi_ctx
*ctx
,
719 NET_API_STATUS status
);
721 /****************************************************************
723 ****************************************************************/
725 NET_API_STATUS
NetApiBufferAllocate(uint32_t byte_count
,
728 /****************************************************************
730 ****************************************************************/
732 NET_API_STATUS
NetApiBufferFree(void *buffer
);
734 /************************************************************//**
736 * ConvertSidToStringSid
738 * @brief Convert a domain sid into a string
740 * @param[in] sid A pointer to a sid structure
741 * @param[in,out] sid_string A pointer that holds a pointer to a sid string. Caller
742 * needs to free with free(3)
744 ***************************************************************/
746 int ConvertSidToStringSid(const struct domsid
*sid
,
749 /************************************************************//**
751 * ConvertStringSidToSid
753 * @brief Convert a string into a domain sid
755 * @param[in] sid_string A pointer to a sid string.
756 * @param[in,out] sid A pointer that holds a pointer to a sid structure.
757 * Caller needs to free with free(3)
759 ***************************************************************/
761 int ConvertStringSidToSid(const char *sid_string
,
762 struct domsid
**sid
);
764 /************************************************************//**
768 * @brief Join a computer to a domain or workgroup
770 * @param[in] server The server name to connect to
771 * @param[in] domain The domain or workgroup to join
772 * @param[in] account_ou The organizational Unit to create the computer account
774 * @param[in] account The domain account used for joining a domain
775 * @param[in] password The domain account's password used for joining a domain
776 * @param[in] join_flags Bitmask field to define specific join features
777 * @return NET_API_STATUS
779 * example netdomjoin/netdomjoin.c
780 ***************************************************************/
782 NET_API_STATUS
NetJoinDomain(const char * server
/* [in] */,
783 const char * domain
/* [in] [ref] */,
784 const char * account_ou
/* [in] */,
785 const char * account
/* [in] */,
786 const char * password
/* [in] */,
787 uint32_t join_flags
/* [in] */);
789 /************************************************************//**
793 * @brief Unjoin a computer from a domain or workgroup
795 * @param[in] server_name The server name to connect to
796 * @param[in] account The domain account used for unjoining a domain
797 * @param[in] password The domain account's password used for unjoining a domain
798 * @param[in] unjoin_flags Bitmask field to define specific unjoin features
799 * @return NET_API_STATUS
801 ***************************************************************/
803 NET_API_STATUS
NetUnjoinDomain(const char * server_name
/* [in] */,
804 const char * account
/* [in] */,
805 const char * password
/* [in] */,
806 uint32_t unjoin_flags
/* [in] */);
808 /************************************************************//**
810 * NetGetJoinInformation
812 * @brief Unjoin a computer from a domain or workgroup
814 * @param[in] server_name The server name to connect to
815 * @param[out] name_buffer Returns the name of the workgroup or domain
816 * @param[out] name_type Returns the type of that name
817 * @return NET_API_STATUS
819 * example netdomjoin-gui/netdomjoin-gui.c
821 ***************************************************************/
823 NET_API_STATUS
NetGetJoinInformation(const char * server_name
/* [in] */,
824 const char * *name_buffer
/* [out] [ref] */,
825 uint16_t *name_type
/* [out] [ref] */);
827 /************************************************************//**
831 * @brief Query for the list of joinable organizational Units that can be used
834 * @param[in] server_name The server name to connect to
835 * @param[in] domain The AD domain to query
836 * @param[in] account The domain account used for the query
837 * @param[in] password The domain account's password used for the query
838 * @param[out] ou_count The number of ous returned
839 * @param[out] ous Returned string array containing the ous
840 * @return NET_API_STATUS
842 * example netdomjoin-gui/netdomjoin-gui.c
844 ***************************************************************/
846 NET_API_STATUS
NetGetJoinableOUs(const char * server_name
/* [in] */,
847 const char * domain
/* [in] [ref] */,
848 const char * account
/* [in] */,
849 const char * password
/* [in] */,
850 uint32_t *ou_count
/* [out] [ref] */,
851 const char * **ous
/* [out] [ref] */);
853 /************************************************************//**
855 * NetRenameMachineInDomain
857 * @brief Rename a machine in a domain
859 * @param[in] server_name The server name to connect to
860 * @param[in] new_machine_name The new machine name
861 * @param[in] account The domain account used for the query
862 * @param[in] password The domain account's password used for the query
863 * @param[in] rename_options Options used for the rename operation
864 * @return NET_API_STATUS
866 * example join/rename_machine.c
868 ***************************************************************/
870 NET_API_STATUS
NetRenameMachineInDomain(const char * server_name
/* [in] */,
871 const char * new_machine_name
/* [in] */,
872 const char * account
/* [in] */,
873 const char * password
/* [in] */,
874 uint32_t rename_options
/* [in] */);
876 /************************************************************//**
880 * @brief Get Information on a server
882 * @param[in] server_name The server name to connect to
883 * @param[in] level The level to define which information is requested
884 * @param[out] buffer The returned buffer carrying the SERVER_INFO structure
885 * @return NET_API_STATUS
887 ***************************************************************/
889 NET_API_STATUS
NetServerGetInfo(const char * server_name
/* [in] */,
890 uint32_t level
/* [in] */,
891 uint8_t **buffer
/* [out] [ref] */);
893 /************************************************************//**
897 * @brief Get Information on a server
899 * @param[in] server_name The server name to connect to
900 * @param[in] level The level to define which information is set
901 * @param[in] buffer The buffer carrying the SERVER_INFO structure
902 * @param[out] parm_error On failure returns the invalid SERVER_INFO member
903 * @return NET_API_STATUS
905 ***************************************************************/
907 NET_API_STATUS
NetServerSetInfo(const char * server_name
/* [in] */,
908 uint32_t level
/* [in] */,
909 uint8_t *buffer
/* [in] [ref] */,
910 uint32_t *parm_error
/* [out] [ref] */);
912 /************************************************************//**
916 * @brief Query for the PDC for a given domain
918 * @param[in] server_name The server name to connect to
919 * @param[in] domain_name The name of the domain to lookup
920 * @param[out] buffer The name of the domain to lookup
921 * @return NET_API_STATUS
923 * example getdc/getdc.c
924 ***************************************************************/
926 NET_API_STATUS
NetGetDCName(const char * server_name
/* [in] */,
927 const char * domain_name
/* [in] */,
928 uint8_t **buffer
/* [out] [ref] */);
930 /************************************************************//**
934 * @brief Query for any DC for a given domain
936 * @param[in] server_name The server name to connect to
937 * @param[in] domain_name The name of the domain to lookup
938 * @param[out] buffer The name of the domain to lookup
939 * @return NET_API_STATUS
941 * example getdc/getdc.c
942 ***************************************************************/
944 NET_API_STATUS
NetGetAnyDCName(const char * server_name
/* [in] */,
945 const char * domain_name
/* [in] */,
946 uint8_t **buffer
/* [out] [ref] */);
949 /************************************************************//**
953 * @brief Lookup a DC for a given domain and return information structure
955 * @param[in] server_name The server name to connect to
956 * @param[in] domain_name The name of the domain to lookup (cannot be NULL)
957 * @param[in] domain_guid The GUID of the domain to lookup (optional)
958 * @param[in] site_name The name of the site the DC should reside in
959 * @param[in] flags A bitmask to request specific features supported by the DC
960 * @param[out] dc_info Pointer to a DOMAIN_CONTROLLER_INFO structure
961 * @return NET_API_STATUS
963 * example dsgetdc/dsgetdc.c
964 ***************************************************************/
966 NET_API_STATUS
DsGetDcName(const char * server_name
/* [in] [unique] */,
967 const char * domain_name
/* [in] [ref] */,
968 struct GUID
*domain_guid
/* [in] [unique] */,
969 const char * site_name
/* [in] [unique] */,
970 uint32_t flags
/* [in] */,
971 struct DOMAIN_CONTROLLER_INFO
**dc_info
/* [out] [ref] */);
973 /************************************************************//**
977 * @brief Create a user on a given server
979 * @param[in] server_name The server name to connect to
980 * @param[in] level The level of the USER_INFO structure passed in (Currently
981 * only level 1 is supported)
982 * @param[in] buffer The buffer carrying the USER_INFO structure
983 * @param[out] parm_error In case of error returns the failing member of the
985 * @return NET_API_STATUS
987 * example user/user_add.c
988 ***************************************************************/
990 NET_API_STATUS
NetUserAdd(const char * server_name
/* [in] */,
991 uint32_t level
/* [in] */,
992 uint8_t *buffer
/* [in] [ref] */,
993 uint32_t *parm_error
/* [out] [ref] */);
995 /************************************************************//**
999 * @brief Delete a user on a given server
1001 * @param[in] server_name The server name to connect to
1002 * @param[in] user_name The user account to delete
1003 * @return NET_API_STATUS
1005 * example user/user_del.c
1006 ***************************************************************/
1008 NET_API_STATUS
NetUserDel(const char * server_name
/* [in] */,
1009 const char * user_name
/* [in] */);
1011 /************************************************************//**
1015 * @brief Enumerate accounts on a server
1017 * @param[in] server_name The server name to connect to
1018 * @param[in] level The enumeration level used for the query (Currently only
1019 * level 0 is supported)
1020 * @param[in] filter The account flags filter used for the query
1021 * @param[out] buffer The returned enumeration buffer
1022 * @param[in] prefmaxlen The requested maximal buffer size
1023 * @param[out] entries_read The number of returned entries
1024 * @param[out] total_entries The number of total entries
1025 * @param[in,out] resume_handle A handle passed in and returned for resuming
1027 * @return NET_API_STATUS
1029 * example user/user_enum.c
1030 ***************************************************************/
1032 NET_API_STATUS
NetUserEnum(const char * server_name
/* [in] */,
1033 uint32_t level
/* [in] */,
1034 uint32_t filter
/* [in] */,
1035 uint8_t **buffer
/* [out] [ref] */,
1036 uint32_t prefmaxlen
/* [in] */,
1037 uint32_t *entries_read
/* [out] [ref] */,
1038 uint32_t *total_entries
/* [out] [ref] */,
1039 uint32_t *resume_handle
/* [in,out] [ref] */);
1041 /************************************************************//**
1043 * NetUserChangePassword
1045 * @brief Change the password for a user on a given server or in a given domain
1047 * @param[in] domain_name The server or domain name to connect to
1048 * @param[in] user_name The user account to change the password for
1049 * @param[in] old_password The user account's old password
1050 * @param[in] new_password The user account's new password
1051 * @return NET_API_STATUS
1053 * example user/user_chgpwd.c
1054 ***************************************************************/
1056 NET_API_STATUS
NetUserChangePassword(const char * domain_name
/* [in] */,
1057 const char * user_name
/* [in] */,
1058 const char * old_password
/* [in] */,
1059 const char * new_password
/* [in] */);
1061 /************************************************************//**
1065 * @brief Get User Information
1067 * @param[in] server_name The server name to connect to
1068 * @param[in] user_name The name of the user that is going to be queried
1069 * @param[in] level The level defining the requested USER_INFO_X structure
1070 * @param[out] buffer The buffer containing a USER_INFO_X structure
1071 * @return NET_API_STATUS
1073 * example user/user_getinfo.c
1074 ***************************************************************/
1076 NET_API_STATUS
NetUserGetInfo(const char * server_name
/* [in] */,
1077 const char * user_name
/* [in] */,
1078 uint32_t level
/* [in] */,
1079 uint8_t **buffer
/* [out] [ref] */);
1081 /************************************************************//**
1085 * @brief Set User Information
1087 * @param[in] server_name The server name to connect to
1088 * @param[in] user_name The name of the user that is going to be modified
1089 * @param[in] level The level defining the requested USER_INFO_X structure
1090 * @param[in] buffer The buffer containing a USER_INFO_X structure
1091 * @param[out] parm_err The returned parameter error number if any
1092 * @return NET_API_STATUS
1094 * example user/user_setinfo.c
1095 ***************************************************************/
1097 NET_API_STATUS
NetUserSetInfo(const char * server_name
/* [in] */,
1098 const char * user_name
/* [in] */,
1099 uint32_t level
/* [in] */,
1100 uint8_t *buffer
/* [in] [ref] */,
1101 uint32_t *parm_err
/* [out] [ref] */);
1103 /************************************************************//**
1107 * @brief Get SAM domain and password information
1109 * @param[in] server_name The server name to connect to
1110 * @param[in] level The level defining which USER_MODALS_INFO_X buffer to query
1111 * @param[out] buffer The returned USER_MODALS_INFO_X buffer
1112 * @return NET_API_STATUS
1114 * example user/user_modalsget.c
1115 ***************************************************************/
1117 NET_API_STATUS
NetUserModalsGet(const char * server_name
/* [in] */,
1118 uint32_t level
/* [in] */,
1119 uint8_t **buffer
/* [out] [ref] */);
1121 /************************************************************//**
1125 * @brief Set SAM domain and password information
1127 * @param[in] server_name The server name to connect to
1128 * @param[in] level The level defining which USER_MODALS_INFO_X buffer to query
1129 * @param[out] buffer The buffer conntaing a USER_MODALS_INFO_X structure
1130 * @param[out] parm_err The returned parameter error number if any
1131 * @return NET_API_STATUS
1133 * example user/user_modalsset.c
1134 ***************************************************************/
1136 NET_API_STATUS
NetUserModalsSet(const char * server_name
/* [in] */,
1137 uint32_t level
/* [in] */,
1138 uint8_t *buffer
/* [in] [ref] */,
1139 uint32_t *parm_err
/* [out] [ref] */);
1141 /************************************************************//**
1145 * @brief Enumerate grouplist of a user on a server
1147 * @param[in] server_name The server name to connect to
1148 * @param[in] user_name The user name to query
1149 * @param[in] level The enumeration level used for the query (Currently only
1150 * level 0 is supported)
1151 * @param[out] buffer The returned enumeration buffer
1152 * @param[in] prefmaxlen The requested maximal buffer size
1153 * @param[out] entries_read The number of returned entries
1154 * @param[out] total_entries The number of total entries
1155 * @return NET_API_STATUS
1157 * example user/user_getgroups.c
1158 ***************************************************************/
1160 NET_API_STATUS
NetUserGetGroups(const char * server_name
/* [in] */,
1161 const char * user_name
/* [in] */,
1162 uint32_t level
/* [in] */,
1163 uint8_t **buffer
/* [out] [ref] */,
1164 uint32_t prefmaxlen
/* [in] */,
1165 uint32_t *entries_read
/* [out] [ref] */,
1166 uint32_t *total_entries
/* [out] [ref] */);
1168 /************************************************************//**
1172 * @brief Set grouplist of a user on a server
1174 * @param[in] server_name The server name to connect to
1175 * @param[in] user_name The user name to query
1176 * @param[in] level The level defining the GROUP_USERS_INFO_X structures in the buffer
1177 * @param[in] buffer The buffer containing GROUP_USERS_INFO_X structures
1178 * @param[in] num_entries The number of X structures in the buffer
1179 * @return NET_API_STATUS
1181 * example user/user_setgroups.c
1182 ***************************************************************/
1184 NET_API_STATUS
NetUserSetGroups(const char * server_name
/* [in] */,
1185 const char * user_name
/* [in] */,
1186 uint32_t level
/* [in] */,
1187 uint8_t *buffer
/* [in] [ref] */,
1188 uint32_t num_entries
/* [in] */);
1190 /************************************************************//**
1192 * NetUserGetLocalGroups
1194 * @brief Enumerate local grouplist of a user on a server
1196 * @param[in] server_name The server name to connect to
1197 * @param[in] user_name The user name to query
1198 * @param[in] level The enumeration level used for the query
1199 * @param[in] flags The flags used for the query
1200 * @param[out] buffer The returned enumeration buffer
1201 * @param[in] prefmaxlen The requested maximal buffer size
1202 * @param[out] entries_read The number of returned entries
1203 * @param[out] total_entries The number of total entries
1204 * @return NET_API_STATUS
1206 * example user/user_getlocalgroups.c
1207 ***************************************************************/
1209 NET_API_STATUS
NetUserGetLocalGroups(const char * server_name
/* [in] */,
1210 const char * user_name
/* [in] */,
1211 uint32_t level
/* [in] */,
1212 uint32_t flags
/* [in] */,
1213 uint8_t **buffer
/* [out] [ref] */,
1214 uint32_t prefmaxlen
/* [in] */,
1215 uint32_t *entries_read
/* [out] [ref] */,
1216 uint32_t *total_entries
/* [out] [ref] */);
1218 /************************************************************//**
1220 * NetQueryDisplayInformation
1222 * @brief Enumerate accounts on a server
1224 * @param[in] server_name The server name to connect to
1225 * @param[in] level The enumeration level used for the query
1226 * @param[in] idx The index to start the the display enumeration at
1227 * @param[in] entries_requested The number of entries requested
1228 * @param[in] prefmaxlen The requested maximal buffer size
1229 * @param[out] entries_read The number of returned entries
1230 * @param[out] buffer The returned display information buffer
1231 * @return NET_API_STATUS
1233 * example user/user_dispinfo.c
1234 ***************************************************************/
1236 NET_API_STATUS
NetQueryDisplayInformation(const char * server_name
/* [in] [unique] */,
1237 uint32_t level
/* [in] */,
1238 uint32_t idx
/* [in] */,
1239 uint32_t entries_requested
/* [in] */,
1240 uint32_t prefmaxlen
/* [in] */,
1241 uint32_t *entries_read
/* [out] [ref] */,
1242 void **buffer
/* [out] [noprint,ref] */);
1244 /************************************************************//**
1248 * @brief Create Domain Group
1250 * @param[in] server_name The server name to connect to
1251 * @param[in] level The level used for the new group creation
1252 * @param[in] buf The buffer containing the group structure
1253 * @param[out] parm_err The returned parameter error number if any
1254 * @return NET_API_STATUS
1256 * example group/group_add.c
1257 ***************************************************************/
1259 NET_API_STATUS
NetGroupAdd(const char * server_name
/* [in] */,
1260 uint32_t level
/* [in] */,
1261 uint8_t *buf
/* [in] [ref] */,
1262 uint32_t *parm_err
/* [out] [ref] */);
1264 /************************************************************//**
1268 * @brief Delete Domain Group
1270 * @param[in] server_name The server name to connect to
1271 * @param[in] group_name The name of the group that is going to be deleted
1272 * @return NET_API_STATUS
1274 * example group/group_del.c
1275 ***************************************************************/
1277 NET_API_STATUS
NetGroupDel(const char * server_name
/* [in] */,
1278 const char * group_name
/* [in] */);
1280 /************************************************************//**
1284 * @brief Enumerate groups on a server
1286 * @param[in] server_name The server name to connect to
1287 * @param[in] level The enumeration level used for the query (Currently only
1288 * level 0 is supported)
1289 * @param[out] buffer The returned enumeration buffer
1290 * @param[in] prefmaxlen The requested maximal buffer size
1291 * @param[out] entries_read The number of returned entries
1292 * @param[out] total_entries The number of total entries
1293 * @param[in,out] resume_handle A handle passed in and returned for resuming
1295 * @return NET_API_STATUS
1297 * example group/group_enum.c
1298 ***************************************************************/
1300 NET_API_STATUS
NetGroupEnum(const char * server_name
/* [in] */,
1301 uint32_t level
/* [in] */,
1302 uint8_t **buffer
/* [out] [ref] */,
1303 uint32_t prefmaxlen
/* [in] */,
1304 uint32_t *entries_read
/* [out] [ref] */,
1305 uint32_t *total_entries
/* [out] [ref] */,
1306 uint32_t *resume_handle
/* [in,out] [ref] */);
1308 /************************************************************//**
1312 * @brief Set Domain Group Information
1314 * @param[in] server_name The server name to connect to
1315 * @param[in] group_name The name of the group that is going to be modified
1316 * @param[in] level The level defining the structure type in buf
1317 * @param[in] buf The buffer containing a GROUP_INFO_X structure
1318 * @param[out] parm_err The returned parameter error number if any
1319 * @return NET_API_STATUS
1321 * example group/group_setinfo.c
1322 ***************************************************************/
1324 NET_API_STATUS
NetGroupSetInfo(const char * server_name
/* [in] */,
1325 const char * group_name
/* [in] */,
1326 uint32_t level
/* [in] */,
1327 uint8_t *buf
/* [in] [ref] */,
1328 uint32_t *parm_err
/* [out] [ref] */);
1330 /************************************************************//**
1334 * @brief Get Domain Group Information
1336 * @param[in] server_name The server name to connect to
1337 * @param[in] group_name The name of the group that is going to be queried
1338 * @param[in] level The level defining the requested GROUP_INFO_X structure
1339 * @param[out] buf The buffer containing a GROUP_INFO_X structure
1340 * @return NET_API_STATUS
1342 * example group/group_getinfo.c
1343 ***************************************************************/
1345 NET_API_STATUS
NetGroupGetInfo(const char * server_name
/* [in] */,
1346 const char * group_name
/* [in] */,
1347 uint32_t level
/* [in] */,
1348 uint8_t **buf
/* [out] [ref] */);
1350 /************************************************************//**
1354 * @brief Add existing User to existing Domain Group
1356 * @param[in] server_name The server name to connect to
1357 * @param[in] group_name The name of the group that is going to be modified
1358 * @param[in] user_name The name of the user that is going to be added to the
1360 * @return NET_API_STATUS
1362 * example group/group_adduser.c
1363 ***************************************************************/
1365 NET_API_STATUS
NetGroupAddUser(const char * server_name
/* [in] */,
1366 const char * group_name
/* [in] */,
1367 const char * user_name
/* [in] */);
1369 /************************************************************//**
1373 * @brief Remove User from Domain Group
1375 * @param[in] server_name The server name to connect to
1376 * @param[in] group_name The name of the group that is going to be modified
1377 * @param[in] user_name The name of the user that is going to be removed from
1379 * @return NET_API_STATUS
1381 * example group/group_deluser.c
1382 ***************************************************************/
1384 NET_API_STATUS
NetGroupDelUser(const char * server_name
/* [in] */,
1385 const char * group_name
/* [in] */,
1386 const char * user_name
/* [in] */);
1388 /************************************************************//**
1392 * @brief Get Users for a group on a server
1394 * @param[in] server_name The server name to connect to
1395 * @param[in] group_name The group name to enumerate users for
1396 * @param[in] level The enumeration level used for the query
1397 * @param[out] buffer The returned enumeration buffer
1398 * @param[in] prefmaxlen The requested maximal buffer size
1399 * @param[out] entries_read The number of returned entries
1400 * @param[out] total_entries The number of total entries
1401 * @param[in,out] resume_handle A handle passed in and returned for resuming
1403 * @return NET_API_STATUS
1405 * example group/group_getusers.c
1406 ***************************************************************/
1408 NET_API_STATUS
NetGroupGetUsers(const char * server_name
/* [in] */,
1409 const char * group_name
/* [in] */,
1410 uint32_t level
/* [in] */,
1411 uint8_t **buffer
/* [out] [ref] */,
1412 uint32_t prefmaxlen
/* [in] */,
1413 uint32_t *entries_read
/* [out] [ref] */,
1414 uint32_t *total_entries
/* [out] [ref] */,
1415 uint32_t *resume_handle
/* [in,out] [ref] */);
1417 /************************************************************//**
1421 * @brief Set Users for a group on a server
1423 * @param[in] server_name The server name to connect to
1424 * @param[in] group_name The group name to enumerate users for
1425 * @param[in] level The enumeration level used for the query
1426 * @param[in] buffer The buffer containing a X structure
1427 * @param[in] num_entries The number of X entries in the buffer
1428 * @return NET_API_STATUS
1430 * example group/group_setusers.c
1431 ***************************************************************/
1433 NET_API_STATUS
NetGroupSetUsers(const char * server_name
/* [in] */,
1434 const char * group_name
/* [in] */,
1435 uint32_t level
/* [in] */,
1436 uint8_t *buffer
/* [in] [ref] */,
1437 uint32_t num_entries
/* [in] */);
1439 /************************************************************//**
1443 * @brief Create Local Group
1445 * @param[in] server_name The server name to connect to
1446 * @param[in] level The level used for the new group creation
1447 * @param[in] buf The buffer containing the group structure
1448 * @param[out] parm_err The returned parameter error number if any
1449 * @return NET_API_STATUS
1451 * example localgroup/localgroup_add.c
1452 ***************************************************************/
1454 NET_API_STATUS
NetLocalGroupAdd(const char * server_name
/* [in] */,
1455 uint32_t level
/* [in] */,
1456 uint8_t *buf
/* [in] [ref] */,
1457 uint32_t *parm_err
/* [out] [ref] */);
1459 /************************************************************//**
1463 * @brief Delete Local Group
1465 * @param[in] server_name The server name to connect to
1466 * @param[in] group_name The name of the group that is going to be deleted
1467 * @return NET_API_STATUS
1469 * example localgroup/localgroup_del.c
1470 ***************************************************************/
1473 NET_API_STATUS
NetLocalGroupDel(const char * server_name
/* [in] */,
1474 const char * group_name
/* [in] */);
1476 /************************************************************//**
1478 * NetLocalGroupGetInfo
1480 * @brief Get Local Group Information
1482 * @param[in] server_name The server name to connect to
1483 * @param[in] group_name The name of the group that is going to be queried
1484 * @param[in] level The level defining the requested LOCALGROUP_INFO_X structure
1485 * @param[out] buf The buffer containing a LOCALGROUP_INFO_X structure
1486 * @return NET_API_STATUS
1488 * example localgroup/localgroup_getinfo.c
1489 ***************************************************************/
1491 NET_API_STATUS
NetLocalGroupGetInfo(const char * server_name
/* [in] */,
1492 const char * group_name
/* [in] */,
1493 uint32_t level
/* [in] */,
1494 uint8_t **buf
/* [out] [ref] */);
1496 /************************************************************//**
1498 * NetLocalGroupSetInfo
1500 * @brief Set Local Group Information
1502 * @param[in] server_name The server name to connect to
1503 * @param[in] group_name The name of the group that is going to be modified
1504 * @param[in] level The level defining the requested LOCALGROUP_INFO_X structure
1505 * @param[in] buf The buffer containing a LOCALGROUP_INFO_X structure
1506 * @param[out] parm_err The returned parameter error number if any
1507 * @return NET_API_STATUS
1509 * example localgroup/localgroup_setinfo.c
1510 ***************************************************************/
1513 NET_API_STATUS
NetLocalGroupSetInfo(const char * server_name
/* [in] */,
1514 const char * group_name
/* [in] */,
1515 uint32_t level
/* [in] */,
1516 uint8_t *buf
/* [in] [ref] */,
1517 uint32_t *parm_err
/* [out] [ref] */);
1519 /************************************************************//**
1523 * @brief Enumerate local groups on a server
1525 * @param[in] server_name The server name to connect to
1526 * @param[in] level The enumeration level used for the query (Currently only
1527 * level 0 is supported)
1528 * @param[out] buffer The returned enumeration buffer
1529 * @param[in] prefmaxlen The requested maximal buffer size
1530 * @param[out] entries_read The number of returned entries
1531 * @param[out] total_entries The number of total entries
1532 * @param[in,out] resume_handle A handle passed in and returned for resuming
1534 * @return NET_API_STATUS
1536 * example localgroup/localgroup_enum.c
1537 ***************************************************************/
1539 NET_API_STATUS
NetLocalGroupEnum(const char * server_name
/* [in] */,
1540 uint32_t level
/* [in] */,
1541 uint8_t **buffer
/* [out] [ref] */,
1542 uint32_t prefmaxlen
/* [in] */,
1543 uint32_t *entries_read
/* [out] [ref] */,
1544 uint32_t *total_entries
/* [out] [ref] */,
1545 uint32_t *resume_handle
/* [in,out] [ref] */);
1547 /************************************************************//**
1549 * NetLocalGroupAddMembers
1551 * @brief Add Members to a Local Group
1553 * @param[in] server_name The server name to connect to
1554 * @param[in] group_name The name of the group that is going to modified
1555 * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1556 * @param[in] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X structure
1557 * @param[in] total_entries The number of LOCALGROUP_MEMBERS_INFO_X entries in
1559 * @return NET_API_STATUS
1561 * example localgroup/localgroup_addmembers.c
1562 ***************************************************************/
1564 NET_API_STATUS
NetLocalGroupAddMembers(const char * server_name
/* [in] */,
1565 const char * group_name
/* [in] */,
1566 uint32_t level
/* [in] */,
1567 uint8_t *buffer
/* [in] [ref] */,
1568 uint32_t total_entries
/* [in] */);
1570 /************************************************************//**
1572 * NetLocalGroupDelMembers
1574 * @brief Delete Members from a Local Group
1576 * @param[in] server_name The server name to connect to
1577 * @param[in] group_name The name of the group that is going to modified
1578 * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1579 * @param[in] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X structure
1580 * @param[in] total_entries The number of LOCALGROUP_MEMBERS_INFO_X entries in
1582 * @return NET_API_STATUS
1584 * example localgroup/localgroup_delmembers.c
1585 ***************************************************************/
1587 NET_API_STATUS
NetLocalGroupDelMembers(const char * server_name
/* [in] */,
1588 const char * group_name
/* [in] */,
1589 uint32_t level
/* [in] */,
1590 uint8_t *buffer
/* [in] [ref] */,
1591 uint32_t total_entries
/* [in] */);
1593 /************************************************************//**
1595 * NetLocalGroupGetMembers
1597 * @brief Enumerate Members in a local group
1599 * @param[in] server_name The server name to connect to
1600 * @param[in] local_group_name The localgroup that is going to be queried
1601 * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1602 * @param[out] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X
1604 * @param[in] prefmaxlen The requested maximal buffer size
1605 * @param[out] entries_read The number of LOCALGROUP_MEMBERS_INFO_X entries in the buffer
1606 * @param[out] total_entries The total number of LOCALGROUP_MEMBERS_INFO_X entries for that group
1607 * @param[in,out] resume_handle A handle passed in and returned for resuming
1609 * @return NET_API_STATUS
1611 * example localgroup/localgroup_getmembers.c
1612 ***************************************************************/
1614 NET_API_STATUS
NetLocalGroupGetMembers(const char * server_name
/* [in] */,
1615 const char * local_group_name
/* [in] */,
1616 uint32_t level
/* [in] */,
1617 uint8_t **buffer
/* [out] [ref] */,
1618 uint32_t prefmaxlen
/* [in] */,
1619 uint32_t *entries_read
/* [out] [ref] */,
1620 uint32_t *total_entries
/* [out] [ref] */,
1621 uint32_t *resume_handle
/* [in,out] [ref] */);
1623 /************************************************************//**
1625 * NetLocalGroupSetMembers
1627 * @brief Set Members in a Local Group
1629 * @param[in] server_name The server name to connect to
1630 * @param[in] group_name The name of the group that is going to modified
1631 * @param[in] level The level defining the LOCALGROUP_MEMBERS_INFO_X structure
1632 * @param[in] buffer The buffer containing a LOCALGROUP_MEMBERS_INFO_X structure
1633 * @param[in] total_entries The number of LOCALGROUP_MEMBERS_INFO_X entries in
1635 * @return NET_API_STATUS
1637 * example localgroup/localgroup_setmembers.c
1638 ***************************************************************/
1640 NET_API_STATUS
NetLocalGroupSetMembers(const char * server_name
/* [in] */,
1641 const char * group_name
/* [in] */,
1642 uint32_t level
/* [in] */,
1643 uint8_t *buffer
/* [in] [ref] */,
1644 uint32_t total_entries
/* [in] */);
1646 /************************************************************//**
1650 * @brief Query remote Time of Day
1652 * @param[in] server_name The server name to connect to
1653 * @param[out] buf The buffer containing a TIME_OF_DAY_INFO structure
1654 * @return NET_API_STATUS
1656 * example server/remote_tod.c
1657 ***************************************************************/
1659 NET_API_STATUS
NetRemoteTOD(const char * server_name
/* [in] */,
1660 uint8_t **buf
/* [out] [ref] */);
1662 /************************************************************//**
1668 * @param[in] server_name The server name to connect to
1669 * @param[in] level The level defining the requested SHARE_INFO_X structure
1670 * @param[in] buffer The buffer containing a SHARE_INFO_X structure
1671 * @param[out] parm_err The returned parameter error number if any
1672 * @return NET_API_STATUS
1674 * example share/share_add.c
1675 ***************************************************************/
1677 NET_API_STATUS
NetShareAdd(const char * server_name
/* [in] */,
1678 uint32_t level
/* [in] */,
1679 uint8_t *buffer
/* [in] [ref] */,
1680 uint32_t *parm_err
/* [out] [ref] */);
1682 /************************************************************//**
1686 * @brief Delete Share
1688 * @param[in] server_name The server name to connect to
1689 * @param[in] net_name The name of the share to delete
1690 * @param[in] reserved
1691 * @return NET_API_STATUS
1693 * example share/share_del.c
1694 ***************************************************************/
1696 NET_API_STATUS
NetShareDel(const char * server_name
/* [in] */,
1697 const char * net_name
/* [in] */,
1698 uint32_t reserved
/* [in] */);
1700 /************************************************************//**
1704 * @brief Enumerate Shares
1706 * @param[in] server_name The server name to connect to
1707 * @param[in] level The level defining the SHARE_INFO_X structure
1708 * @param[out] buffer The buffer containing a SHARE_INFO_X structure
1709 * @param[in] prefmaxlen The requested maximal buffer size
1710 * @param[out] entries_read The number of SHARE_INFO_X entries in the buffer
1711 * @param[out] total_entries The total number of SHARE_INFO_X entries
1712 * @param[in,out] resume_handle A handle passed in and returned for resuming
1714 * @return NET_API_STATUS
1716 * example share/share_enum.c
1717 ***************************************************************/
1719 NET_API_STATUS
NetShareEnum(const char * server_name
/* [in] */,
1720 uint32_t level
/* [in] */,
1721 uint8_t **buffer
/* [out] [ref] */,
1722 uint32_t prefmaxlen
/* [in] */,
1723 uint32_t *entries_read
/* [out] [ref] */,
1724 uint32_t *total_entries
/* [out] [ref] */,
1725 uint32_t *resume_handle
/* [in,out] [ref] */);
1727 /************************************************************//**
1731 * @brief Get Share Info
1733 * @param[in] server_name The server name to connect to
1734 * @param[in] net_name The name of the share to query
1735 * @param[in] level The level defining the SHARE_INFO_X structure
1736 * @param[out] buffer The buffer containing a SHARE_INFO_X structure
1737 * @return NET_API_STATUS
1739 * example share/share_getinfo.c
1740 ***************************************************************/
1742 NET_API_STATUS
NetShareGetInfo(const char * server_name
/* [in] */,
1743 const char * net_name
/* [in] */,
1744 uint32_t level
/* [in] */,
1745 uint8_t **buffer
/* [out] [ref] */);
1747 /************************************************************//**
1751 * @brief Set Share Info
1753 * @param[in] server_name The server name to connect to
1754 * @param[in] net_name The name of the share to query
1755 * @param[in] level The level defining the SHARE_INFO_X structure
1756 * @param[in] buffer The buffer containing a SHARE_INFO_X structure
1757 * @param[out] parm_err The returned parameter error number if any
1758 * @return NET_API_STATUS
1760 * example share/share_setinfo.c
1761 ***************************************************************/
1763 NET_API_STATUS
NetShareSetInfo(const char * server_name
/* [in] */,
1764 const char * net_name
/* [in] */,
1765 uint32_t level
/* [in] */,
1766 uint8_t *buffer
/* [in] [ref] */,
1767 uint32_t *parm_err
/* [out] [ref] */);
1769 /************************************************************//**
1773 * @brief Close a file
1775 * @param[in] server_name The server name to connect to
1776 * @param[in] fileid The fileid of the file that is going to be closed
1777 * @return NET_API_STATUS
1779 * example file/file_close.c
1780 ***************************************************************/
1782 NET_API_STATUS
NetFileClose(const char * server_name
/* [in] */,
1783 uint32_t fileid
/* [in] */);
1785 /************************************************************//**
1789 * @brief Close a file
1791 * @param[in] server_name The server name to connect to
1792 * @param[in] fileid The fileid of the file that is going to be closed
1793 * @param[in] level The level of the FILE_INFO_X buffer
1794 * @param[out] buffer The buffer containing a FILE_INFO_X structure
1795 * @return NET_API_STATUS
1797 * example file/file_getinfo.c
1798 ***************************************************************/
1800 NET_API_STATUS
NetFileGetInfo(const char * server_name
/* [in] */,
1801 uint32_t fileid
/* [in] */,
1802 uint32_t level
/* [in] */,
1803 uint8_t **buffer
/* [out] [ref] */);
1805 /************************************************************//**
1809 * @brief Enumerate Files
1811 * @param[in] server_name The server name to connect to
1812 * @param[in] base_path The
1813 * @param[in] user_name The
1814 * @param[in] level The level defining the FILE_INFO_X structure
1815 * @param[out] buffer The buffer containing a FILE_INFO_X structure
1816 * @param[in] prefmaxlen The requested maximal buffer size
1817 * @param[out] entries_read The number of FILE_INFO_X entries in the buffer
1818 * @param[out] total_entries The total number of FILE_INFO_X entries
1819 * @param[in,out] resume_handle A handle passed in and returned for resuming
1821 * @return NET_API_STATUS
1823 * example file/file_enum.c
1824 ***************************************************************/
1826 NET_API_STATUS
NetFileEnum(const char * server_name
/* [in] */,
1827 const char * base_path
/* [in] */,
1828 const char * user_name
/* [in] */,
1829 uint32_t level
/* [in] */,
1830 uint8_t **buffer
/* [out] [ref] */,
1831 uint32_t prefmaxlen
/* [in] */,
1832 uint32_t *entries_read
/* [out] [ref] */,
1833 uint32_t *total_entries
/* [out] [ref] */,
1834 uint32_t *resume_handle
/* [in,out] [ref] */);
1838 #endif /* __cplusplus */
1840 #endif /* __LIB_NETAPI_H__ */