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 [nopush,nopull] NET_API_STATUS NetJoinDomain(
33 [in,unique] string *server,
34 [in,ref] string *domain,
35 [in,unique] string *account_ou,
36 [in,unique] string *account,
37 [in,unique] string *password,
38 [in] uint32 join_flags
41 /*******************************************/
43 /*******************************************/
45 [nopush,nopull] NET_API_STATUS NetUnjoinDomain(
46 [in,unique] string *server_name,
47 [in,unique] string *account,
48 [in,unique] string *password,
49 [in] uint32 unjoin_flags
52 /*******************************************/
53 /* NetGetJoinInformation */
54 /*******************************************/
56 [nopush,nopull] NET_API_STATUS NetGetJoinInformation(
57 [in,unique] string *server_name,
58 [out] string **name_buffer,
59 [out] uint16 *name_type
62 /*******************************************/
63 /* NetGetJoinableOUs */
64 /*******************************************/
66 [nopush,nopull] NET_API_STATUS NetGetJoinableOUs(
67 [in,unique] string *server_name,
68 [in,ref] string *domain,
69 [in,unique] string *account,
70 [in,unique] string *password,
71 [out] uint32 *ou_count,
75 /*******************************************/
76 /* NetServerGetInfo */
77 /*******************************************/
79 [public] typedef struct {
80 string sv1005_comment;
83 [nopush,nopull] NET_API_STATUS NetServerGetInfo(
84 [in,unique] string *server_name,
89 /*******************************************/
90 /* NetServerSetInfo */
91 /*******************************************/
93 [nopush,nopull] NET_API_STATUS NetServerSetInfo(
94 [in,unique] string *server_name,
97 [out] uint32 *parm_error
100 /*******************************************/
102 /*******************************************/
104 [nopush,nopull] NET_API_STATUS NetGetDCName(
105 [in,unique] string *server_name,
106 [in,unique] string *domain_name,
110 /*******************************************/
111 /* NetGetAnyDCName */
112 /*******************************************/
114 [nopush,nopull] NET_API_STATUS NetGetAnyDCName(
115 [in,unique] string *server_name,
116 [in,unique] string *domain_name,
120 /*******************************************/
122 /*******************************************/
124 [public] typedef struct {
125 string domain_controller_name;
126 string domain_controller_address;
127 uint32 domain_controller_address_type;
130 string dns_forest_name;
133 string client_site_name;
134 } DOMAIN_CONTROLLER_INFO;
136 [nopush,nopull] NET_API_STATUS DsGetDcName(
137 [in,unique] string *server_name,
138 [in,ref] string *domain_name,
139 [in,unique] GUID *domain_guid,
140 [in,unique] string *site_name,
142 [out,ref] DOMAIN_CONTROLLER_INFO **dc_info
145 /*******************************************/
147 /*******************************************/
149 [public] typedef struct {
154 const int USER_PRIV_GUEST = 0;
155 const int USER_PRIV_USER = 1;
156 const int USER_PRIV_ADMIN = 2;
158 [public] typedef struct {
160 string usri1_password;
161 uint32 usri1_password_age;
163 string usri1_home_dir;
164 string usri1_comment;
166 string usri1_script_path;
169 [public] typedef struct {
171 string usri2_password;
172 uint32 usri2_password_age;
174 string usri2_home_dir;
175 string usri2_comment;
177 string usri2_script_path;
178 uint32 usri2_auth_flags;
179 string usri2_full_name;
180 string usri2_usr_comment;
182 string usri2_workstations;
183 uint32 usri2_last_logon;
184 uint32 usri2_last_logoff;
185 uint32 usri2_acct_expires;
186 uint32 usri2_max_storage;
187 uint32 usri2_units_per_week;
188 uint8 *usri2_logon_hours;
189 uint32 usri2_bad_pw_count;
190 uint32 usri2_num_logons;
191 string usri2_logon_server;
192 uint32 usri2_country_code;
193 uint32 usri2_code_page;
196 [public] typedef struct {
198 uint32 usri3_password_age;
200 string usri3_home_dir;
201 string usri3_comment;
203 string usri3_script_path;
204 uint32 usri3_auth_flags;
205 string usri3_full_name;
206 string usri3_usr_comment;
208 string usri3_workstations;
209 uint32 usri3_last_logon;
210 uint32 usri3_last_logoff;
211 uint32 usri3_acct_expires;
212 uint32 usri3_max_storage;
213 uint32 usri3_units_per_week;
214 uint8 *usri3_logon_hours;
215 uint32 usri3_bad_pw_count;
216 uint32 usri3_num_logons;
217 string usri3_logon_server;
218 uint32 usri3_country_code;
219 uint32 usri3_code_page;
220 uint32 usri3_user_id;
221 uint32 usri3_primary_group_id;
222 string usri3_profile;
223 string usri3_home_dir_drive;
224 uint32 usri3_password_expired;
227 [public] typedef struct {
229 string usri4_password;
230 uint32 usri4_password_age;
232 string usri4_home_dir;
233 string usri4_comment;
235 string usri4_script_path;
236 uint32 usri4_auth_flags;
237 string usri4_full_name;
238 string usri4_usr_comment;
240 string usri4_workstations;
241 uint32 usri4_last_logon;
242 uint32 usri4_last_logoff;
243 uint32 usri4_acct_expires;
244 uint32 usri4_max_storage;
245 uint32 usri4_units_per_week;
246 uint8 *usri4_logon_hours;
247 uint32 usri4_bad_pw_count;
248 uint32 usri4_num_logons;
249 string usri4_logon_server;
250 uint32 usri4_country_code;
251 uint32 usri4_code_page;
252 domsid *usri4_user_sid;
253 uint32 usri4_primary_group_id;
254 string usri4_profile;
255 string usri4_home_dir_drive;
256 uint32 usri4_password_expired;
259 [public] typedef struct {
261 string usri10_comment;
262 string usri10_usr_comment;
263 string usri10_full_name;
266 [public] typedef struct {
268 string usri11_comment;
269 string usri11_usr_comment;
270 string usri11_full_name;
272 uint32 usri11_auth_flags;
273 uint32 usri11_password_age;
274 string usri11_home_dir;
276 uint32 usri11_last_logon;
277 uint32 usri11_last_logoff;
278 uint32 usri11_bad_pw_count;
279 uint32 usri11_num_logons;
280 string usri11_logon_server;
281 uint32 usri11_country_code;
282 string usri11_workstations;
283 uint32 usri11_max_storage;
284 uint32 usri11_units_per_week;
285 uint8 *usri11_logon_hours;
286 uint32 usri11_code_page;
289 [public] typedef struct {
291 string usri20_full_name;
292 string usri20_comment;
294 uint32 usri20_user_id;
297 const int ENCRYPTED_PWLEN = 16;
299 [public] typedef struct {
300 uint8 usri21_password[ENCRYPTED_PWLEN];
303 [public] typedef struct {
305 uint8 usri22_password[ENCRYPTED_PWLEN];
306 uint32 usri22_password_age;
308 string usri22_home_dir;
309 string usri22_comment;
311 uint32 usri22_script_path;
312 uint32 usri22_auth_flags;
313 string usri22_full_name;
314 string usri22_usr_comment;
316 string usri22_workstations;
317 uint32 usri22_last_logon;
318 uint32 usri22_last_logoff;
319 uint32 usri22_acct_expires;
320 uint32 usri22_max_storage;
321 uint32 usri22_units_per_week;
322 uint8 *usri22_logon_hours;
323 uint32 usri22_bad_pw_count;
324 uint32 usri22_num_logons;
325 string usri22_logon_server;
326 uint32 usri22_country_code;
327 uint32 usri22_code_page;
330 [public] typedef struct {
332 string usri23_full_name;
333 string usri23_comment;
335 domsid *usri23_user_sid;
338 [public] typedef struct {
339 string usri1003_password;
342 [public] typedef struct {
343 uint32 usri1005_priv;
346 [public] typedef struct {
347 string usri1006_home_dir;
350 [public] typedef struct {
351 string usri1007_comment;
354 [public] typedef struct {
355 uint32 usri1008_flags;
358 [public] typedef struct {
359 string usri1009_script_path;
362 [public] typedef struct {
363 uint32 usri1010_auth_flags;
366 [public] typedef struct {
367 string usri1011_full_name;
370 [public] typedef struct {
371 string usri1012_usr_comment;
374 [public] typedef struct {
375 string usri1013_parms;
378 [public] typedef struct {
379 string usri1014_workstations;
382 [public] typedef struct {
383 uint32 usri1017_acct_expires;
386 [public] typedef struct {
387 uint32 usri1018_max_storage;
390 [public] typedef struct {
391 uint32 usri1020_units_per_week;
392 uint8 *usri1020_logon_hours;
395 [public] typedef struct {
396 string usri1023_logon_server;
399 [public] typedef struct {
400 uint32 usri1024_country_code;
403 [public] typedef struct {
404 uint32 usri1025_code_page;
407 [public] typedef struct {
408 uint32 usri1051_primary_group_id;
411 [public] typedef struct {
412 string usri1052_profile;
415 [public] typedef struct {
416 string usri1053_home_dir_drive;
419 [public] typedef struct {
421 string usriX_password;
422 uint32 usriX_password_age;
424 string usriX_home_dir;
425 string usriX_comment;
427 string usriX_script_path;
428 uint32 usriX_auth_flags;
429 string usriX_full_name;
430 string usriX_usr_comment;
432 string usriX_workstations;
433 uint32 usriX_last_logon;
434 uint32 usriX_last_logoff;
435 uint32 usriX_acct_expires;
436 uint32 usriX_max_storage;
437 uint32 usriX_units_per_week;
438 uint8 *usriX_logon_hours;
439 uint32 usriX_bad_pw_count;
440 uint32 usriX_num_logons;
441 string usriX_logon_server;
442 uint32 usriX_country_code;
443 uint32 usriX_code_page;
444 string usriX_profile;
445 string usriX_home_dir_drive;
446 uint32 usriX_primary_group_id;
449 [nopush,nopull] NET_API_STATUS NetUserAdd(
450 [in,unique] string *server_name,
452 [in,ref] uint8 *buffer,
453 [out,ref] uint32 *parm_error
456 /*******************************************/
458 /*******************************************/
460 [nopush,nopull] NET_API_STATUS NetUserDel(
461 [in,unique] string *server_name,
462 [in,ref] string *user_name
465 /*******************************************/
467 /*******************************************/
469 const int FILTER_TEMP_DUPLICATE_ACCOUNT = 0x0001;
470 const int FILTER_NORMAL_ACCOUNT = 0x0002;
471 const int FILTER_INTERDOMAIN_TRUST_ACCOUNT = 0x0008;
472 const int FILTER_WORKSTATION_TRUST_ACCOUNT = 0x0010;
473 const int FILTER_SERVER_TRUST_ACCOUNT = 0x0020;
475 [nopush,nopull] NET_API_STATUS NetUserEnum(
476 [in,unique] string *server_name,
479 [out,ref] uint8 **buffer,
480 [in] uint32 prefmaxlen,
481 [out,ref] uint32 *entries_read,
482 [out,ref] uint32 *total_entries,
483 [in,out,ref] uint32 *resume_handle
486 /*******************************************/
487 /* NetUserChangePassword */
488 /*******************************************/
490 [nopush,nopull] NET_API_STATUS NetUserChangePassword(
491 [in] string domain_name,
492 [in] string user_name,
493 [in] string old_password,
494 [in] string new_password
497 /*******************************************/
499 /*******************************************/
501 [nopush,nopull] NET_API_STATUS NetUserGetInfo(
502 [in] string server_name,
503 [in] string user_name,
508 /*******************************************/
510 /*******************************************/
512 [nopush,nopull] NET_API_STATUS NetUserSetInfo(
513 [in] string server_name,
514 [in] string user_name,
517 [out] uint32 *parm_err
520 /*******************************************/
521 /* NetUserGetGroups */
522 /*******************************************/
524 [public] typedef struct {
526 } GROUP_USERS_INFO_0;
528 [public] typedef struct {
530 uint32 grui1_attributes;
531 } GROUP_USERS_INFO_1;
533 [nopush,nopull] NET_API_STATUS NetUserGetGroups(
534 [in] string server_name,
535 [in] string user_name,
537 [out] uint8 **buffer,
538 [in] uint32 prefmaxlen,
539 [out,ref] uint32 *entries_read,
540 [out,ref] uint32 *total_entries
543 /*******************************************/
544 /* NetUserModalsGet */
545 /*******************************************/
547 const int TIMEQ_FOREVER = (uint32_t)-1L;
550 uint32 usrmod0_min_passwd_len;
551 uint32 usrmod0_max_passwd_age;
552 uint32 usrmod0_min_passwd_age;
553 uint32 usrmod0_force_logoff;
554 uint32 usrmod0_password_hist_len;
555 } USER_MODALS_INFO_0;
559 string usrmod1_primary;
560 } USER_MODALS_INFO_1;
563 string usrmod2_domain_name;
564 domsid *usrmod2_domain_id;
565 } USER_MODALS_INFO_2;
568 uint32 usrmod3_lockout_duration;
569 uint32 usrmod3_lockout_observation_window;
570 uint32 usrmod3_lockout_threshold;
571 } USER_MODALS_INFO_3;
574 uint32 usrmod1001_min_passwd_len;
575 } USER_MODALS_INFO_1001;
578 uint32 usrmod1002_max_passwd_age;
579 } USER_MODALS_INFO_1002;
582 uint32 usrmod1003_min_passwd_age;
583 } USER_MODALS_INFO_1003;
586 uint32 usrmod1004_force_logoff;
587 } USER_MODALS_INFO_1004;
590 uint32 usrmod1005_password_hist_len;
591 } USER_MODALS_INFO_1005;
594 uint32 usrmod1006_role;
595 } USER_MODALS_INFO_1006;
598 string usrmod1007_primary;
599 } USER_MODALS_INFO_1007;
601 [nopush,nopull] NET_API_STATUS NetUserModalsGet(
602 [in] string server_name,
604 [out,ref] uint8 **buffer
607 /*******************************************/
608 /* NetUserModalsSet */
609 /*******************************************/
611 [nopush,nopull] NET_API_STATUS NetUserModalsSet(
612 [in] string server_name,
615 [out,ref] uint32 *parm_err
618 /*******************************************/
619 /* NetQueryDisplayInformation */
620 /*******************************************/
622 [public] typedef struct {
624 string usri1_comment;
626 string usri1_full_name;
627 uint32 usri1_user_id;
628 uint32 usri1_next_index;
631 [public] typedef struct {
633 string usri2_comment;
635 uint32 usri2_user_id;
636 uint32 usri2_next_index;
637 } NET_DISPLAY_MACHINE;
639 [public] typedef struct {
641 string grpi3_comment;
642 uint32 grpi3_group_id;
643 uint32 grpi3_attributes;
644 uint32 grpi3_next_index;
647 [nopush,nopull] NET_API_STATUS NetQueryDisplayInformation(
648 [in,unique] string *server_name,
651 [in] uint32 entries_requested,
652 [in] uint32 prefmaxlen,
653 [out,ref] uint32 *entries_read,
654 [out,ref,noprint] void **buffer
657 /*******************************************/
659 /*******************************************/
667 string grpi1_comment;
672 string grpi2_comment;
673 uint32 grpi2_group_id;
674 uint32 grpi2_attributes;
679 string grpi3_comment;
680 domsid *grpi3_group_sid;
681 uint32 grpi3_attributes;
685 string grpi1002_comment;
689 uint32 grpi1005_attributes;
692 [nopush,nopull] NET_API_STATUS NetGroupAdd(
693 [in] string server_name,
696 [out] uint32 *parm_err
699 /*******************************************/
701 /*******************************************/
703 [nopush,nopull] NET_API_STATUS NetGroupDel(
704 [in] string server_name,
705 [in] string group_name
708 /*******************************************/
710 /*******************************************/
712 [nopush,nopull] NET_API_STATUS NetGroupEnum(
713 [in] string server_name,
715 [out,ref] uint8 **buffer,
716 [in] uint32 prefmaxlen,
717 [out,ref] uint32 *entries_read,
718 [out,ref] uint32 *total_entries,
719 [in,out,ref] uint32 *resume_handle
722 /*******************************************/
723 /* NetGroupSetInfo */
724 /*******************************************/
726 [nopush,nopull] NET_API_STATUS NetGroupSetInfo(
727 [in] string server_name,
728 [in] string group_name,
731 [out] uint32 *parm_err
734 /*******************************************/
735 /* NetGroupGetInfo */
736 /*******************************************/
738 [nopush,nopull] NET_API_STATUS NetGroupGetInfo(
739 [in] string server_name,
740 [in] string group_name,
745 /*******************************************/
746 /* NetGroupAddUser */
747 /*******************************************/
749 [nopush,nopull] NET_API_STATUS NetGroupAddUser(
750 [in] string server_name,
751 [in] string group_name,
752 [in] string user_name
755 /*******************************************/
756 /* NetGroupDelUser */
757 /*******************************************/
759 [nopush,nopull] NET_API_STATUS NetGroupDelUser(
760 [in] string server_name,
761 [in] string group_name,
762 [in] string user_name
765 /*******************************************/
766 /* NetGroupGetUsers */
767 /*******************************************/
769 [nopush,nopull] NET_API_STATUS NetGroupGetUsers(
770 [in] string server_name,
771 [in] string group_name,
773 [out] uint8 **buffer,
774 [in] uint32 prefmaxlen,
775 [out,ref] uint32 *entries_read,
776 [out,ref] uint32 *total_entries,
777 [in,out,ref] uint32 *resume_handle
780 /*******************************************/
781 /* NetLocalGroupAdd */
782 /*******************************************/
790 string lgrpi1_comment;
794 string lgrpi1002_comment;
795 } LOCALGROUP_INFO_1002;
797 [nopush,nopull] NET_API_STATUS NetLocalGroupAdd(
798 [in] string server_name,
801 [out,ref] uint32 *parm_err
804 /*******************************************/
805 /* NetLocalGroupDel */
806 /*******************************************/
808 [nopush,nopull] NET_API_STATUS NetLocalGroupDel(
809 [in] string server_name,
810 [in] string group_name
813 /*******************************************/
814 /* NetLocalGroupGetInfo */
815 /*******************************************/
817 [nopush,nopull] NET_API_STATUS NetLocalGroupGetInfo(
818 [in] string server_name,
819 [in] string group_name,
821 [out,ref] uint8 **buffer
824 /*******************************************/
825 /* NetLocalGroupSetInfo */
826 /*******************************************/
828 [nopush,nopull] NET_API_STATUS NetLocalGroupSetInfo(
829 [in] string server_name,
830 [in] string group_name,
832 [in,ref] uint8 *buffer,
833 [out,ref] uint32 *parm_err
836 /*******************************************/
837 /* NetLocalGroupEnum */
838 /*******************************************/
840 [nopush,nopull] NET_API_STATUS NetLocalGroupEnum(
841 [in] string server_name,
843 [out,ref] uint8 **buffer,
844 [in] uint32 prefmaxlen,
845 [out,ref] uint32 *entries_read,
846 [out,ref] uint32 *total_entries,
847 [in,out,ref] uint32 *resume_handle
850 /*******************************************/
851 /* NetLocalGroupAddMembers */
852 /*******************************************/
859 SidTypeWellKnownGroup = 5,
860 SidTypeDeletedAccount = 6,
869 } LOCALGROUP_MEMBERS_INFO_0;
873 SID_NAME_USE lgrmi1_sidusage;
875 } LOCALGROUP_MEMBERS_INFO_1;
879 SID_NAME_USE lgrmi2_sidusage;
880 string lgrmi2_domainandname;
881 } LOCALGROUP_MEMBERS_INFO_2;
884 string lgrmi3_domainandname;
885 } LOCALGROUP_MEMBERS_INFO_3;
887 [nopush,nopull] NET_API_STATUS NetLocalGroupAddMembers(
888 [in] string server_name,
889 [in] string group_name,
892 [in] uint32 total_entries
895 /*******************************************/
896 /* NetLocalGroupDelMembers */
897 /*******************************************/
899 [nopush,nopull] NET_API_STATUS NetLocalGroupDelMembers(
900 [in] string server_name,
901 [in] string group_name,
904 [in] uint32 total_entries
907 /*******************************************/
908 /* NetLocalGroupGetMembers */
909 /*******************************************/
911 [nopush,nopull] NET_API_STATUS NetLocalGroupGetMembers(
912 [in] string server_name,
913 [in] string local_group_name,
915 [out] uint8 **buffer,
916 [in] uint32 prefmaxlen,
917 [out] uint32 *entries_read,
918 [out] uint32 *total_entries,
919 [in,out] uint32 *resume_handle
922 /*******************************************/
923 /* NetLocalGroupSetMembers */
924 /*******************************************/
926 [nopush,nopull] NET_API_STATUS NetLocalGroupSetMembers(
927 [in] string server_name,
928 [in] string group_name,
931 [in] uint32 total_entries
934 /*******************************************/
936 /*******************************************/
946 uint32 tod_tinterval;
953 [nopush,nopull] NET_API_STATUS NetRemoteTOD(
954 [in] string server_name,
955 [out,ref] uint8 **buffer