2 libnetapi interface definition
5 cpp_quote("#define LIBNETAPI_LOCAL_SERVER(x) (!x || is_myname_or_ipaddr(x))")
6 cpp_quote("#ifndef MAXSUBAUTHS")
7 cpp_quote("#define MAXSUBAUTHS 15 /* max sub authorities in a SID */")
11 pointer_default(unique)
15 const int ERROR_MORE_DATA = 234L;
17 [public] typedef [v1_enum] enum {
21 [public] typedef struct {
25 uint32 sub_auths[MAXSUBAUTHS];
28 /*******************************************/
30 /*******************************************/
32 typedef [public,bitmap32bit] bitmap {
33 NETSETUP_JOIN_DOMAIN = 0x00000001,
34 NETSETUP_ACCT_CREATE = 0x00000002,
35 NETSETUP_ACCT_DELETE = 0x00000004,
36 NETSETUP_WIN9X_UPGRADE = 0x00000010,
37 NETSETUP_DOMAIN_JOIN_IF_JOINED = 0x00000020,
38 NETSETUP_JOIN_UNSECURE = 0x00000040,
39 NETSETUP_MACHINE_PWD_PASSED = 0x00000080,
40 NETSETUP_DEFER_SPN_SET = 0x00000100,
41 NETSETUP_JOIN_DC_ACCOUNT = 0x00000200,
42 NETSETUP_JOIN_WITH_NEW_NAME = 0x00000400,
43 NETSETUP_INSTALL_INVOCATION = 0x00040000,
44 NETSETUP_IGNORE_UNSUPPORTED_FLAGS = 0x10000000
47 [nopush,nopull] NET_API_STATUS NetJoinDomain(
48 [in,unique] string *server,
49 [in,ref] string *domain,
50 [in,unique] string *account_ou,
51 [in,unique] string *account,
52 [in,unique] string *password,
53 [in] NetJoinFlags join_flags
56 /*******************************************/
58 /*******************************************/
60 [nopush,nopull] NET_API_STATUS NetUnjoinDomain(
61 [in,unique] string *server_name,
62 [in,unique] string *account,
63 [in,unique] string *password,
64 [in] NetJoinFlags unjoin_flags
67 /*******************************************/
68 /* NetGetJoinInformation */
69 /*******************************************/
71 [nopush,nopull] NET_API_STATUS NetGetJoinInformation(
72 [in,unique] string *server_name,
73 [out] string **name_buffer,
74 [out] uint16 *name_type
77 /*******************************************/
78 /* NetGetJoinableOUs */
79 /*******************************************/
81 [nopush,nopull] NET_API_STATUS NetGetJoinableOUs(
82 [in,unique] string *server_name,
83 [in,ref] string *domain,
84 [in,unique] string *account,
85 [in,unique] string *password,
86 [out] uint32 *ou_count,
90 /*******************************************/
91 /* NetServerGetInfo */
92 /*******************************************/
94 [public] typedef struct {
95 string sv1005_comment;
98 [nopush,nopull] NET_API_STATUS NetServerGetInfo(
99 [in,unique] string *server_name,
104 /*******************************************/
105 /* NetServerSetInfo */
106 /*******************************************/
108 [nopush,nopull] NET_API_STATUS NetServerSetInfo(
109 [in,unique] string *server_name,
112 [out] uint32 *parm_error
115 /*******************************************/
117 /*******************************************/
119 [nopush,nopull] NET_API_STATUS NetGetDCName(
120 [in,unique] string *server_name,
121 [in,unique] string *domain_name,
125 /*******************************************/
126 /* NetGetAnyDCName */
127 /*******************************************/
129 [nopush,nopull] NET_API_STATUS NetGetAnyDCName(
130 [in,unique] string *server_name,
131 [in,unique] string *domain_name,
135 /*******************************************/
137 /*******************************************/
139 [public] typedef struct {
140 string domain_controller_name;
141 string domain_controller_address;
142 uint32 domain_controller_address_type;
145 string dns_forest_name;
148 string client_site_name;
149 } DOMAIN_CONTROLLER_INFO;
151 [nopush,nopull] NET_API_STATUS DsGetDcName(
152 [in,unique] string *server_name,
153 [in,ref] string *domain_name,
154 [in,unique] GUID *domain_guid,
155 [in,unique] string *site_name,
157 [out,ref] DOMAIN_CONTROLLER_INFO **dc_info
160 /*******************************************/
162 /*******************************************/
164 [public] typedef struct {
169 const int USER_PRIV_GUEST = 0;
170 const int USER_PRIV_USER = 1;
171 const int USER_PRIV_ADMIN = 2;
173 [public] typedef struct {
175 string usri1_password;
176 uint32 usri1_password_age;
178 string usri1_home_dir;
179 string usri1_comment;
181 string usri1_script_path;
184 /* auth_flags in USER_INFO_2 */
186 const int AF_OP_PRINT = 0x1;
187 const int AF_OP_COMM = 0x2;
188 const int AF_OP_SERVER = 0x4;
189 const int AF_OP_ACCOUNTS = 0x8;
190 const int AF_SETTABLE_BITS = (AF_OP_PRINT | AF_OP_COMM | AF_OP_SERVER | AF_OP_ACCOUNTS);
192 const int USER_MAXSTORAGE_UNLIMITED = (uint32_t)-1L;
194 [public] typedef struct {
196 string usri2_password;
197 uint32 usri2_password_age;
199 string usri2_home_dir;
200 string usri2_comment;
202 string usri2_script_path;
203 uint32 usri2_auth_flags;
204 string usri2_full_name;
205 string usri2_usr_comment;
207 string usri2_workstations;
208 uint32 usri2_last_logon;
209 uint32 usri2_last_logoff;
210 uint32 usri2_acct_expires;
211 uint32 usri2_max_storage;
212 uint32 usri2_units_per_week;
213 uint8 *usri2_logon_hours;
214 uint32 usri2_bad_pw_count;
215 uint32 usri2_num_logons;
216 string usri2_logon_server;
217 uint32 usri2_country_code;
218 uint32 usri2_code_page;
221 [public] typedef struct {
223 uint32 usri3_password_age;
225 string usri3_home_dir;
226 string usri3_comment;
228 string usri3_script_path;
229 uint32 usri3_auth_flags;
230 string usri3_full_name;
231 string usri3_usr_comment;
233 string usri3_workstations;
234 uint32 usri3_last_logon;
235 uint32 usri3_last_logoff;
236 uint32 usri3_acct_expires;
237 uint32 usri3_max_storage;
238 uint32 usri3_units_per_week;
239 uint8 *usri3_logon_hours;
240 uint32 usri3_bad_pw_count;
241 uint32 usri3_num_logons;
242 string usri3_logon_server;
243 uint32 usri3_country_code;
244 uint32 usri3_code_page;
245 uint32 usri3_user_id;
246 uint32 usri3_primary_group_id;
247 string usri3_profile;
248 string usri3_home_dir_drive;
249 uint32 usri3_password_expired;
252 [public] typedef struct {
254 string usri4_password;
255 uint32 usri4_password_age;
257 string usri4_home_dir;
258 string usri4_comment;
260 string usri4_script_path;
261 uint32 usri4_auth_flags;
262 string usri4_full_name;
263 string usri4_usr_comment;
265 string usri4_workstations;
266 uint32 usri4_last_logon;
267 uint32 usri4_last_logoff;
268 uint32 usri4_acct_expires;
269 uint32 usri4_max_storage;
270 uint32 usri4_units_per_week;
271 uint8 *usri4_logon_hours;
272 uint32 usri4_bad_pw_count;
273 uint32 usri4_num_logons;
274 string usri4_logon_server;
275 uint32 usri4_country_code;
276 uint32 usri4_code_page;
277 domsid *usri4_user_sid;
278 uint32 usri4_primary_group_id;
279 string usri4_profile;
280 string usri4_home_dir_drive;
281 uint32 usri4_password_expired;
284 [public] typedef struct {
286 string usri10_comment;
287 string usri10_usr_comment;
288 string usri10_full_name;
291 [public] typedef struct {
293 string usri11_comment;
294 string usri11_usr_comment;
295 string usri11_full_name;
297 uint32 usri11_auth_flags;
298 uint32 usri11_password_age;
299 string usri11_home_dir;
301 uint32 usri11_last_logon;
302 uint32 usri11_last_logoff;
303 uint32 usri11_bad_pw_count;
304 uint32 usri11_num_logons;
305 string usri11_logon_server;
306 uint32 usri11_country_code;
307 string usri11_workstations;
308 uint32 usri11_max_storage;
309 uint32 usri11_units_per_week;
310 uint8 *usri11_logon_hours;
311 uint32 usri11_code_page;
314 [public] typedef struct {
316 string usri20_full_name;
317 string usri20_comment;
319 uint32 usri20_user_id;
322 const int ENCRYPTED_PWLEN = 16;
324 [public] typedef struct {
325 uint8 usri21_password[ENCRYPTED_PWLEN];
328 [public] typedef struct {
330 uint8 usri22_password[ENCRYPTED_PWLEN];
331 uint32 usri22_password_age;
333 string usri22_home_dir;
334 string usri22_comment;
336 uint32 usri22_script_path;
337 uint32 usri22_auth_flags;
338 string usri22_full_name;
339 string usri22_usr_comment;
341 string usri22_workstations;
342 uint32 usri22_last_logon;
343 uint32 usri22_last_logoff;
344 uint32 usri22_acct_expires;
345 uint32 usri22_max_storage;
346 uint32 usri22_units_per_week;
347 uint8 *usri22_logon_hours;
348 uint32 usri22_bad_pw_count;
349 uint32 usri22_num_logons;
350 string usri22_logon_server;
351 uint32 usri22_country_code;
352 uint32 usri22_code_page;
355 [public] typedef struct {
357 string usri23_full_name;
358 string usri23_comment;
360 domsid *usri23_user_sid;
363 [public] typedef struct {
364 string usri1003_password;
367 [public] typedef struct {
368 uint32 usri1005_priv;
371 [public] typedef struct {
372 string usri1006_home_dir;
375 [public] typedef struct {
376 string usri1007_comment;
379 [public] typedef struct {
380 uint32 usri1008_flags;
383 [public] typedef struct {
384 string usri1009_script_path;
387 [public] typedef struct {
388 uint32 usri1010_auth_flags;
391 [public] typedef struct {
392 string usri1011_full_name;
395 [public] typedef struct {
396 string usri1012_usr_comment;
399 [public] typedef struct {
400 string usri1013_parms;
403 [public] typedef struct {
404 string usri1014_workstations;
407 [public] typedef struct {
408 uint32 usri1017_acct_expires;
411 [public] typedef struct {
412 uint32 usri1018_max_storage;
415 [public] typedef struct {
416 uint32 usri1020_units_per_week;
417 uint8 *usri1020_logon_hours;
420 [public] typedef struct {
421 string usri1023_logon_server;
424 [public] typedef struct {
425 uint32 usri1024_country_code;
428 [public] typedef struct {
429 uint32 usri1025_code_page;
432 [public] typedef struct {
433 uint32 usri1051_primary_group_id;
436 [public] typedef struct {
437 string usri1052_profile;
440 [public] typedef struct {
441 string usri1053_home_dir_drive;
444 [public] typedef struct {
446 string usriX_password;
447 uint32 usriX_password_age;
449 string usriX_home_dir;
450 string usriX_comment;
452 string usriX_script_path;
453 uint32 usriX_auth_flags;
454 string usriX_full_name;
455 string usriX_usr_comment;
457 string usriX_workstations;
458 uint32 usriX_last_logon;
459 uint32 usriX_last_logoff;
460 uint32 usriX_acct_expires;
461 uint32 usriX_max_storage;
462 uint32 usriX_units_per_week;
463 uint8 *usriX_logon_hours;
464 uint32 usriX_bad_pw_count;
465 uint32 usriX_num_logons;
466 string usriX_logon_server;
467 uint32 usriX_country_code;
468 uint32 usriX_code_page;
469 string usriX_profile;
470 string usriX_home_dir_drive;
471 uint32 usriX_primary_group_id;
474 [nopush,nopull] NET_API_STATUS NetUserAdd(
475 [in,unique] string *server_name,
477 [in,ref] uint8 *buffer,
478 [out,ref] uint32 *parm_error
481 /*******************************************/
483 /*******************************************/
485 [nopush,nopull] NET_API_STATUS NetUserDel(
486 [in,unique] string *server_name,
487 [in,ref] string *user_name
490 /*******************************************/
492 /*******************************************/
494 const int FILTER_TEMP_DUPLICATE_ACCOUNT = 0x0001;
495 const int FILTER_NORMAL_ACCOUNT = 0x0002;
496 const int FILTER_INTERDOMAIN_TRUST_ACCOUNT = 0x0008;
497 const int FILTER_WORKSTATION_TRUST_ACCOUNT = 0x0010;
498 const int FILTER_SERVER_TRUST_ACCOUNT = 0x0020;
500 [nopush,nopull] NET_API_STATUS NetUserEnum(
501 [in,unique] string *server_name,
504 [out,ref] uint8 **buffer,
505 [in] uint32 prefmaxlen,
506 [out,ref] uint32 *entries_read,
507 [out,ref] uint32 *total_entries,
508 [in,out,ref] uint32 *resume_handle
511 /*******************************************/
512 /* NetUserChangePassword */
513 /*******************************************/
515 [nopush,nopull] NET_API_STATUS NetUserChangePassword(
516 [in] string domain_name,
517 [in] string user_name,
518 [in] string old_password,
519 [in] string new_password
522 /*******************************************/
524 /*******************************************/
526 [nopush,nopull] NET_API_STATUS NetUserGetInfo(
527 [in] string server_name,
528 [in] string user_name,
533 /*******************************************/
535 /*******************************************/
537 [nopush,nopull] NET_API_STATUS NetUserSetInfo(
538 [in] string server_name,
539 [in] string user_name,
542 [out] uint32 *parm_err
545 /*******************************************/
546 /* NetUserGetGroups */
547 /*******************************************/
549 [public] typedef struct {
551 } GROUP_USERS_INFO_0;
553 [public] typedef struct {
555 uint32 grui1_attributes;
556 } GROUP_USERS_INFO_1;
558 [nopush,nopull] NET_API_STATUS NetUserGetGroups(
559 [in] string server_name,
560 [in] string user_name,
562 [out] uint8 **buffer,
563 [in] uint32 prefmaxlen,
564 [out,ref] uint32 *entries_read,
565 [out,ref] uint32 *total_entries
568 /*******************************************/
569 /* NetUserModalsGet */
570 /*******************************************/
572 const int TIMEQ_FOREVER = (uint32_t)-1L;
575 uint32 usrmod0_min_passwd_len;
576 uint32 usrmod0_max_passwd_age;
577 uint32 usrmod0_min_passwd_age;
578 uint32 usrmod0_force_logoff;
579 uint32 usrmod0_password_hist_len;
580 } USER_MODALS_INFO_0;
584 string usrmod1_primary;
585 } USER_MODALS_INFO_1;
588 string usrmod2_domain_name;
589 domsid *usrmod2_domain_id;
590 } USER_MODALS_INFO_2;
593 uint32 usrmod3_lockout_duration;
594 uint32 usrmod3_lockout_observation_window;
595 uint32 usrmod3_lockout_threshold;
596 } USER_MODALS_INFO_3;
599 uint32 usrmod1001_min_passwd_len;
600 } USER_MODALS_INFO_1001;
603 uint32 usrmod1002_max_passwd_age;
604 } USER_MODALS_INFO_1002;
607 uint32 usrmod1003_min_passwd_age;
608 } USER_MODALS_INFO_1003;
611 uint32 usrmod1004_force_logoff;
612 } USER_MODALS_INFO_1004;
615 uint32 usrmod1005_password_hist_len;
616 } USER_MODALS_INFO_1005;
619 uint32 usrmod1006_role;
620 } USER_MODALS_INFO_1006;
623 string usrmod1007_primary;
624 } USER_MODALS_INFO_1007;
626 [nopush,nopull] NET_API_STATUS NetUserModalsGet(
627 [in] string server_name,
629 [out,ref] uint8 **buffer
632 /*******************************************/
633 /* NetUserModalsSet */
634 /*******************************************/
636 [nopush,nopull] NET_API_STATUS NetUserModalsSet(
637 [in] string server_name,
640 [out,ref] uint32 *parm_err
643 /*******************************************/
644 /* NetQueryDisplayInformation */
645 /*******************************************/
647 [public] typedef struct {
649 string usri1_comment;
651 string usri1_full_name;
652 uint32 usri1_user_id;
653 uint32 usri1_next_index;
656 [public] typedef struct {
658 string usri2_comment;
660 uint32 usri2_user_id;
661 uint32 usri2_next_index;
662 } NET_DISPLAY_MACHINE;
664 [public] typedef struct {
666 string grpi3_comment;
667 uint32 grpi3_group_id;
668 uint32 grpi3_attributes;
669 uint32 grpi3_next_index;
672 [nopush,nopull] NET_API_STATUS NetQueryDisplayInformation(
673 [in,unique] string *server_name,
676 [in] uint32 entries_requested,
677 [in] uint32 prefmaxlen,
678 [out,ref] uint32 *entries_read,
679 [out,ref,noprint] void **buffer
682 /*******************************************/
684 /*******************************************/
692 string grpi1_comment;
697 string grpi2_comment;
698 uint32 grpi2_group_id;
699 uint32 grpi2_attributes;
704 string grpi3_comment;
705 domsid *grpi3_group_sid;
706 uint32 grpi3_attributes;
710 string grpi1002_comment;
714 uint32 grpi1005_attributes;
717 [nopush,nopull] NET_API_STATUS NetGroupAdd(
718 [in] string server_name,
721 [out] uint32 *parm_err
724 /*******************************************/
726 /*******************************************/
728 [nopush,nopull] NET_API_STATUS NetGroupDel(
729 [in] string server_name,
730 [in] string group_name
733 /*******************************************/
735 /*******************************************/
737 [nopush,nopull] NET_API_STATUS NetGroupEnum(
738 [in] string server_name,
740 [out,ref] uint8 **buffer,
741 [in] uint32 prefmaxlen,
742 [out,ref] uint32 *entries_read,
743 [out,ref] uint32 *total_entries,
744 [in,out,ref] uint32 *resume_handle
747 /*******************************************/
748 /* NetGroupSetInfo */
749 /*******************************************/
751 [nopush,nopull] NET_API_STATUS NetGroupSetInfo(
752 [in] string server_name,
753 [in] string group_name,
756 [out] uint32 *parm_err
759 /*******************************************/
760 /* NetGroupGetInfo */
761 /*******************************************/
763 [nopush,nopull] NET_API_STATUS NetGroupGetInfo(
764 [in] string server_name,
765 [in] string group_name,
770 /*******************************************/
771 /* NetGroupAddUser */
772 /*******************************************/
774 [nopush,nopull] NET_API_STATUS NetGroupAddUser(
775 [in] string server_name,
776 [in] string group_name,
777 [in] string user_name
780 /*******************************************/
781 /* NetGroupDelUser */
782 /*******************************************/
784 [nopush,nopull] NET_API_STATUS NetGroupDelUser(
785 [in] string server_name,
786 [in] string group_name,
787 [in] string user_name
790 /*******************************************/
791 /* NetGroupGetUsers */
792 /*******************************************/
794 [nopush,nopull] NET_API_STATUS NetGroupGetUsers(
795 [in] string server_name,
796 [in] string group_name,
798 [out] uint8 **buffer,
799 [in] uint32 prefmaxlen,
800 [out,ref] uint32 *entries_read,
801 [out,ref] uint32 *total_entries,
802 [in,out,ref] uint32 *resume_handle
805 /*******************************************/
806 /* NetLocalGroupAdd */
807 /*******************************************/
815 string lgrpi1_comment;
819 string lgrpi1002_comment;
820 } LOCALGROUP_INFO_1002;
822 [nopush,nopull] NET_API_STATUS NetLocalGroupAdd(
823 [in] string server_name,
826 [out,ref] uint32 *parm_err
829 /*******************************************/
830 /* NetLocalGroupDel */
831 /*******************************************/
833 [nopush,nopull] NET_API_STATUS NetLocalGroupDel(
834 [in] string server_name,
835 [in] string group_name
838 /*******************************************/
839 /* NetLocalGroupGetInfo */
840 /*******************************************/
842 [nopush,nopull] NET_API_STATUS NetLocalGroupGetInfo(
843 [in] string server_name,
844 [in] string group_name,
846 [out,ref] uint8 **buffer
849 /*******************************************/
850 /* NetLocalGroupSetInfo */
851 /*******************************************/
853 [nopush,nopull] NET_API_STATUS NetLocalGroupSetInfo(
854 [in] string server_name,
855 [in] string group_name,
857 [in,ref] uint8 *buffer,
858 [out,ref] uint32 *parm_err
861 /*******************************************/
862 /* NetLocalGroupEnum */
863 /*******************************************/
865 [nopush,nopull] NET_API_STATUS NetLocalGroupEnum(
866 [in] string server_name,
868 [out,ref] uint8 **buffer,
869 [in] uint32 prefmaxlen,
870 [out,ref] uint32 *entries_read,
871 [out,ref] uint32 *total_entries,
872 [in,out,ref] uint32 *resume_handle
875 /*******************************************/
876 /* NetLocalGroupAddMembers */
877 /*******************************************/
884 SidTypeWellKnownGroup = 5,
885 SidTypeDeletedAccount = 6,
894 } LOCALGROUP_MEMBERS_INFO_0;
898 SID_NAME_USE lgrmi1_sidusage;
900 } LOCALGROUP_MEMBERS_INFO_1;
904 SID_NAME_USE lgrmi2_sidusage;
905 string lgrmi2_domainandname;
906 } LOCALGROUP_MEMBERS_INFO_2;
909 string lgrmi3_domainandname;
910 } LOCALGROUP_MEMBERS_INFO_3;
912 [nopush,nopull] NET_API_STATUS NetLocalGroupAddMembers(
913 [in] string server_name,
914 [in] string group_name,
917 [in] uint32 total_entries
920 /*******************************************/
921 /* NetLocalGroupDelMembers */
922 /*******************************************/
924 [nopush,nopull] NET_API_STATUS NetLocalGroupDelMembers(
925 [in] string server_name,
926 [in] string group_name,
929 [in] uint32 total_entries
932 /*******************************************/
933 /* NetLocalGroupGetMembers */
934 /*******************************************/
936 [nopush,nopull] NET_API_STATUS NetLocalGroupGetMembers(
937 [in] string server_name,
938 [in] string local_group_name,
940 [out] uint8 **buffer,
941 [in] uint32 prefmaxlen,
942 [out] uint32 *entries_read,
943 [out] uint32 *total_entries,
944 [in,out] uint32 *resume_handle
947 /*******************************************/
948 /* NetLocalGroupSetMembers */
949 /*******************************************/
951 [nopush,nopull] NET_API_STATUS NetLocalGroupSetMembers(
952 [in] string server_name,
953 [in] string group_name,
956 [in] uint32 total_entries
959 /*******************************************/
961 /*******************************************/
971 uint32 tod_tinterval;
978 [nopush,nopull] NET_API_STATUS NetRemoteTOD(
979 [in] string server_name,
980 [out,ref] uint8 **buffer
983 /*******************************************/
985 /*******************************************/
991 uint32 shi2_permissions;
992 uint32 shi2_max_uses;
993 uint32 shi2_current_uses;
998 [nopush,nopull] NET_API_STATUS NetShareAdd(
999 [in] string server_name,
1002 [out] uint32 *parm_err
1005 /*******************************************/
1007 /*******************************************/
1009 [nopush,nopull] NET_API_STATUS NetShareDel(
1010 [in] string server_name,
1011 [in] string net_name,
1012 [in] uint32 reserved