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 {
153 [public] typedef struct {
155 string usri1_password
;
156 uint32 usri1_password_age
;
158 string usri1_home_dir
;
159 string usri1_comment
;
161 string usri1_script_path
;
164 [public] typedef struct {
166 string usri2_password
;
167 uint32 usri2_password_age
;
169 string usri2_home_dir
;
170 string usri2_comment
;
172 string usri2_script_path
;
173 uint32 usri2_auth_flags
;
174 string usri2_full_name
;
175 string usri2_usr_comment
;
177 string usri2_workstations
;
178 uint32 usri2_last_logon
;
179 uint32 usri2_last_logoff
;
180 uint32 usri2_acct_expires
;
181 uint32 usri2_max_storage
;
182 uint32 usri2_units_per_week
;
183 uint8
*usri2_logon_hours
;
184 uint32 usri2_bad_pw_count
;
185 uint32 usri2_num_logons
;
186 string usri2_logon_server
;
187 uint32 usri2_country_code
;
188 uint32 usri2_code_page
;
191 [public] typedef struct {
193 uint32 usri3_password_age
;
195 string usri3_home_dir
;
196 string usri3_comment
;
198 string usri3_script_path
;
199 uint32 usri3_auth_flags
;
200 string usri3_full_name
;
201 string usri3_usr_comment
;
203 string usri3_workstations
;
204 uint32 usri3_last_logon
;
205 uint32 usri3_last_logoff
;
206 uint32 usri3_acct_expires
;
207 uint32 usri3_max_storage
;
208 uint32 usri3_units_per_week
;
209 uint8
*usri3_logon_hours
;
210 uint32 usri3_bad_pw_count
;
211 uint32 usri3_num_logons
;
212 string usri3_logon_server
;
213 uint32 usri3_country_code
;
214 uint32 usri3_code_page
;
215 uint32 usri3_user_id
;
216 uint32 usri3_primary_group_id
;
217 string usri3_profile
;
218 string usri3_home_dir_drive
;
219 uint32 usri3_password_expired
;
222 [public] typedef struct {
224 string usri4_password
;
225 uint32 usri4_password_age
;
227 string usri4_home_dir
;
228 string usri4_comment
;
230 string usri4_script_path
;
231 uint32 usri4_auth_flags
;
232 string usri4_full_name
;
233 string usri4_usr_comment
;
235 string usri4_workstations
;
236 uint32 usri4_last_logon
;
237 uint32 usri4_last_logoff
;
238 uint32 usri4_acct_expires
;
239 uint32 usri4_max_storage
;
240 uint32 usri4_units_per_week
;
241 uint8
*usri4_logon_hours
;
242 uint32 usri4_bad_pw_count
;
243 uint32 usri4_num_logons
;
244 string usri4_logon_server
;
245 uint32 usri4_country_code
;
246 uint32 usri4_code_page
;
247 dom_sid
*usri4_user_sid
;
248 uint32 usri4_primary_group_id
;
249 string usri4_profile
;
250 string usri4_home_dir_drive
;
251 uint32 usri4_password_expired
;
254 [public] typedef struct {
256 string usri10_comment
;
257 string usri10_usr_comment
;
258 string usri10_full_name
;
261 [public] typedef struct {
263 string usri11_comment
;
264 string usri11_usr_comment
;
265 string usri11_full_name
;
267 uint32 usri11_auth_flags
;
268 uint32 usri11_password_age
;
269 string usri11_home_dir
;
271 uint32 usri11_last_logon
;
272 uint32 usri11_last_logoff
;
273 uint32 usri11_bad_pw_count
;
274 uint32 usri11_num_logons
;
275 string usri11_logon_server
;
276 uint32 usri11_country_code
;
277 string usri11_workstations
;
278 uint32 usri11_max_storage
;
279 uint32 usri11_units_per_week
;
280 uint8
*usri11_logon_hours
;
281 uint32 usri11_code_page
;
284 [public] typedef struct {
286 string usri20_full_name
;
287 string usri20_comment
;
289 uint32 usri20_user_id
;
292 const int ENCRYPTED_PWLEN
= 16;
294 [public] typedef struct {
295 uint8 usri21_password
[ENCRYPTED_PWLEN
];
298 [public] typedef struct {
300 uint8 usri22_password
[ENCRYPTED_PWLEN
];
301 uint32 usri22_password_age
;
303 string usri22_home_dir
;
304 string usri22_comment
;
306 uint32 usri22_script_path
;
307 uint32 usri22_auth_flags
;
308 string usri22_full_name
;
309 string usri22_usr_comment
;
311 string usri22_workstations
;
312 uint32 usri22_last_logon
;
313 uint32 usri22_last_logoff
;
314 uint32 usri22_acct_expires
;
315 uint32 usri22_max_storage
;
316 uint32 usri22_units_per_week
;
317 uint8
*usri22_logon_hours
;
318 uint32 usri22_bad_pw_count
;
319 uint32 usri22_num_logons
;
320 string usri22_logon_server
;
321 uint32 usri22_country_code
;
322 uint32 usri22_code_page
;
325 [public] typedef struct {
327 string usri23_full_name
;
328 string usri23_comment
;
330 domsid
*usri23_user_sid
;
333 [public] typedef struct {
334 string usri1003_password
;
337 [public] typedef struct {
338 uint32 usri1005_priv
;
341 [public] typedef struct {
342 string usri1006_home_dir
;
345 [public] typedef struct {
346 string usri1007_comment
;
349 [public] typedef struct {
350 uint32 usri1008_flags
;
353 [public] typedef struct {
354 string usri1009_script_path
;
357 [public] typedef struct {
358 uint32 usri1010_auth_flags
;
361 [public] typedef struct {
362 string usri1011_full_name
;
365 [public] typedef struct {
366 string usri1012_usr_comment
;
369 [public] typedef struct {
370 string usri1013_parms
;
373 [public] typedef struct {
374 string usri1014_workstations
;
377 [public] typedef struct {
378 uint32 usri1017_acct_expires
;
381 [public] typedef struct {
382 uint32 usri1018_max_storage
;
385 [public] typedef struct {
386 uint32 usri1020_units_per_week
;
387 uint8
*usri1020_logon_hours
;
390 [public] typedef struct {
391 string usri1023_logon_server
;
394 [public] typedef struct {
395 uint32 usri1024_country_code
;
398 [public] typedef struct {
399 uint32 usri1025_code_page
;
402 [public] typedef struct {
403 uint32 usri1051_primary_group_id
;
406 [public] typedef struct {
407 string usri1052_profile
;
410 [public] typedef struct {
411 string usri1053_home_dir_drive
;
414 [public] typedef struct {
416 string usriX_password
;
417 uint32 usriX_password_age
;
419 string usriX_home_dir
;
420 string usriX_comment
;
422 string usriX_script_path
;
423 uint32 usriX_auth_flags
;
424 string usriX_full_name
;
425 string usriX_usr_comment
;
427 string usriX_workstations
;
428 uint32 usriX_last_logon
;
429 uint32 usriX_last_logoff
;
430 uint32 usriX_acct_expires
;
431 uint32 usriX_max_storage
;
432 uint32 usriX_units_per_week
;
433 uint8
*usriX_logon_hours
;
434 uint32 usriX_bad_pw_count
;
435 uint32 usriX_num_logons
;
436 string usriX_logon_server
;
437 uint32 usriX_country_code
;
438 uint32 usriX_code_page
;
439 string usriX_profile
;
440 string usriX_home_dir_drive
;
441 uint32 usriX_primary_group_id
;
444 [nopush
,nopull
] NET_API_STATUS NetUserAdd
(
445 [in,unique] string *server_name
,
447 [in,ref] uint8
*buffer
,
448 [out,ref] uint32
*parm_error
451 /*******************************************/
453 /*******************************************/
455 [nopush
,nopull
] NET_API_STATUS NetUserDel
(
456 [in,unique] string *server_name
,
457 [in,ref] string *user_name
460 /*******************************************/
462 /*******************************************/
464 const int FILTER_TEMP_DUPLICATE_ACCOUNT
= 0x0001;
465 const int FILTER_NORMAL_ACCOUNT
= 0x0002;
466 const int FILTER_INTERDOMAIN_TRUST_ACCOUNT
= 0x0008;
467 const int FILTER_WORKSTATION_TRUST_ACCOUNT
= 0x0010;
468 const int FILTER_SERVER_TRUST_ACCOUNT
= 0x0020;
470 [nopush
,nopull
] NET_API_STATUS NetUserEnum
(
471 [in,unique] string *server_name
,
474 [out,ref] uint8
**buffer
,
475 [in] uint32 prefmaxlen
,
476 [out,ref] uint32
*entries_read
,
477 [out,ref] uint32
*total_entries
,
478 [in,out,ref] uint32
*resume_handle
481 /*******************************************/
482 /* NetUserChangePassword */
483 /*******************************************/
485 [nopush
,nopull
] NET_API_STATUS NetUserChangePassword
(
486 [in] string domain_name
,
487 [in] string user_name
,
488 [in] string old_password
,
489 [in] string new_password
492 /*******************************************/
494 /*******************************************/
496 [nopush
,nopull
] NET_API_STATUS NetUserGetInfo
(
497 [in] string server_name
,
498 [in] string user_name
,
503 /*******************************************/
505 /*******************************************/
507 [nopush
,nopull
] NET_API_STATUS NetUserSetInfo
(
508 [in] string server_name
,
509 [in] string user_name
,
512 [out] uint32
*parm_err
515 /*******************************************/
516 /* NetUserGetGroups */
517 /*******************************************/
519 [public] typedef struct {
521 } GROUP_USERS_INFO_0
;
523 [public] typedef struct {
525 uint32 grui1_attributes
;
526 } GROUP_USERS_INFO_1
;
528 [nopush
,nopull
] NET_API_STATUS NetUserGetGroups
(
529 [in] string server_name
,
530 [in] string user_name
,
532 [out] uint8
**buffer
,
533 [in] uint32 prefmaxlen
,
534 [out,ref] uint32
*entries_read
,
535 [out,ref] uint32
*total_entries
538 /*******************************************/
539 /* NetUserModalsGet */
540 /*******************************************/
542 const int TIMEQ_FOREVER
= (uint32_t
)-1L;
545 uint32 usrmod0_min_passwd_len
;
546 uint32 usrmod0_max_passwd_age
;
547 uint32 usrmod0_min_passwd_age
;
548 uint32 usrmod0_force_logoff
;
549 uint32 usrmod0_password_hist_len
;
550 } USER_MODALS_INFO_0
;
554 string usrmod1_primary
;
555 } USER_MODALS_INFO_1
;
558 string usrmod2_domain_name
;
559 domsid
*usrmod2_domain_id
;
560 } USER_MODALS_INFO_2
;
563 uint32 usrmod3_lockout_duration
;
564 uint32 usrmod3_lockout_observation_window
;
565 uint32 usrmod3_lockout_threshold
;
566 } USER_MODALS_INFO_3
;
569 uint32 usrmod1001_min_passwd_len
;
570 } USER_MODALS_INFO_1001
;
573 uint32 usrmod1002_max_passwd_age
;
574 } USER_MODALS_INFO_1002
;
577 uint32 usrmod1003_min_passwd_age
;
578 } USER_MODALS_INFO_1003
;
581 uint32 usrmod1004_force_logoff
;
582 } USER_MODALS_INFO_1004
;
585 uint32 usrmod1005_password_hist_len
;
586 } USER_MODALS_INFO_1005
;
589 uint32 usrmod1006_role
;
590 } USER_MODALS_INFO_1006
;
593 string usrmod1007_primary
;
594 } USER_MODALS_INFO_1007
;
596 [nopush
,nopull
] NET_API_STATUS NetUserModalsGet
(
597 [in] string server_name
,
599 [out,ref] uint8
**buffer
602 /*******************************************/
603 /* NetUserModalsSet */
604 /*******************************************/
606 [nopush
,nopull
] NET_API_STATUS NetUserModalsSet
(
607 [in] string server_name
,
610 [out,ref] uint32
*parm_err
613 /*******************************************/
614 /* NetQueryDisplayInformation */
615 /*******************************************/
617 [public] typedef struct {
619 string usri1_comment
;
621 string usri1_full_name
;
622 uint32 usri1_user_id
;
623 uint32 usri1_next_index
;
626 [public] typedef struct {
628 string usri2_comment
;
630 uint32 usri2_user_id
;
631 uint32 usri2_next_index
;
632 } NET_DISPLAY_MACHINE
;
634 [public] typedef struct {
636 string grpi3_comment
;
637 uint32 grpi3_group_id
;
638 uint32 grpi3_attributes
;
639 uint32 grpi3_next_index
;
642 [nopush
,nopull
] NET_API_STATUS NetQueryDisplayInformation
(
643 [in,unique] string *server_name
,
646 [in] uint32 entries_requested
,
647 [in] uint32 prefmaxlen
,
648 [out,ref] uint32
*entries_read
,
649 [out,ref,noprint
] void **buffer
652 /*******************************************/
654 /*******************************************/
662 string grpi1_comment
;
667 string grpi2_comment
;
668 uint32 grpi2_group_id
;
669 uint32 grpi2_attributes
;
674 string grpi3_comment
;
675 domsid
*grpi3_group_sid
;
676 uint32 grpi3_attributes
;
680 string grpi1002_comment
;
684 uint32 grpi1005_attributes
;
687 [nopush
,nopull
] NET_API_STATUS NetGroupAdd
(
688 [in] string server_name
,
691 [out] uint32
*parm_err
694 /*******************************************/
696 /*******************************************/
698 [nopush
,nopull
] NET_API_STATUS NetGroupDel
(
699 [in] string server_name
,
700 [in] string group_name
703 /*******************************************/
705 /*******************************************/
707 [nopush
,nopull
] NET_API_STATUS NetGroupEnum
(
708 [in] string server_name
,
710 [out,ref] uint8
**buffer
,
711 [in] uint32 prefmaxlen
,
712 [out,ref] uint32
*entries_read
,
713 [out,ref] uint32
*total_entries
,
714 [in,out,ref] uint32
*resume_handle
717 /*******************************************/
718 /* NetGroupSetInfo */
719 /*******************************************/
721 [nopush
,nopull
] NET_API_STATUS NetGroupSetInfo
(
722 [in] string server_name
,
723 [in] string group_name
,
726 [out] uint32
*parm_err
729 /*******************************************/
730 /* NetGroupGetInfo */
731 /*******************************************/
733 [nopush
,nopull
] NET_API_STATUS NetGroupGetInfo
(
734 [in] string server_name
,
735 [in] string group_name
,
740 /*******************************************/
741 /* NetGroupAddUser */
742 /*******************************************/
744 [nopush
,nopull
] NET_API_STATUS NetGroupAddUser
(
745 [in] string server_name
,
746 [in] string group_name
,
747 [in] string user_name
750 /*******************************************/
751 /* NetGroupDelUser */
752 /*******************************************/
754 [nopush
,nopull
] NET_API_STATUS NetGroupDelUser
(
755 [in] string server_name
,
756 [in] string group_name
,
757 [in] string user_name
760 /*******************************************/
761 /* NetGroupGetUsers */
762 /*******************************************/
764 [nopush
,nopull
] NET_API_STATUS NetGroupGetUsers
(
765 [in] string server_name
,
766 [in] string group_name
,
768 [out] uint8
**buffer
,
769 [in] uint32 prefmaxlen
,
770 [out,ref] uint32
*entries_read
,
771 [out,ref] uint32
*total_entries
,
772 [in,out,ref] uint32
*resume_handle
775 /*******************************************/
776 /* NetLocalGroupAdd */
777 /*******************************************/
785 string lgrpi1_comment
;
789 string lgrpi1002_comment
;
790 } LOCALGROUP_INFO_1002
;
792 [nopush
,nopull
] NET_API_STATUS NetLocalGroupAdd
(
793 [in] string server_name
,
796 [out,ref] uint32
*parm_err
799 /*******************************************/
800 /* NetLocalGroupDel */
801 /*******************************************/
803 [nopush
,nopull
] NET_API_STATUS NetLocalGroupDel
(
804 [in] string server_name
,
805 [in] string group_name
808 /*******************************************/
809 /* NetLocalGroupGetInfo */
810 /*******************************************/
812 [nopush
,nopull
] NET_API_STATUS NetLocalGroupGetInfo
(
813 [in] string server_name
,
814 [in] string group_name
,
816 [out,ref] uint8
**buffer
819 /*******************************************/
820 /* NetLocalGroupSetInfo */
821 /*******************************************/
823 [nopush
,nopull
] NET_API_STATUS NetLocalGroupSetInfo
(
824 [in] string server_name
,
825 [in] string group_name
,
827 [in,ref] uint8
*buffer
,
828 [out,ref] uint32
*parm_err
831 /*******************************************/
832 /* NetLocalGroupEnum */
833 /*******************************************/
835 [nopush
,nopull
] NET_API_STATUS NetLocalGroupEnum
(
836 [in] string server_name
,
838 [out,ref] uint8
**buffer
,
839 [in] uint32 prefmaxlen
,
840 [out,ref] uint32
*entries_read
,
841 [out,ref] uint32
*total_entries
,
842 [in,out,ref] uint32
*resume_handle
845 /*******************************************/
846 /* NetLocalGroupAddMembers */
847 /*******************************************/
854 SidTypeWellKnownGroup
= 5,
855 SidTypeDeletedAccount
= 6,
864 } LOCALGROUP_MEMBERS_INFO_0
;
868 SID_NAME_USE lgrmi1_sidusage
;
870 } LOCALGROUP_MEMBERS_INFO_1
;
874 SID_NAME_USE lgrmi2_sidusage
;
875 string lgrmi2_domainandname
;
876 } LOCALGROUP_MEMBERS_INFO_2
;
879 string lgrmi3_domainandname
;
880 } LOCALGROUP_MEMBERS_INFO_3
;
882 [nopush
,nopull
] NET_API_STATUS NetLocalGroupAddMembers
(
883 [in] string server_name
,
884 [in] string group_name
,
887 [in] uint32 total_entries
890 /*******************************************/
891 /* NetLocalGroupDelMembers */
892 /*******************************************/
894 [nopush
,nopull
] NET_API_STATUS NetLocalGroupDelMembers
(
895 [in] string server_name
,
896 [in] string group_name
,
899 [in] uint32 total_entries
902 /*******************************************/
903 /* NetLocalGroupGetMembers */
904 /*******************************************/
906 [nopush
,nopull
] NET_API_STATUS NetLocalGroupGetMembers
(
907 [in] string server_name
,
908 [in] string local_group_name
,
910 [out] uint8
**buffer
,
911 [in] uint32 prefmaxlen
,
912 [out] uint32
*entries_read
,
913 [out] uint32
*total_entries
,
914 [in,out] uint32
*resume_handle
917 /*******************************************/
918 /* NetLocalGroupSetMembers */
919 /*******************************************/
921 [nopush
,nopull
] NET_API_STATUS NetLocalGroupSetMembers
(
922 [in] string server_name
,
923 [in] string group_name
,
926 [in] uint32 total_entries
929 /*******************************************/
931 /*******************************************/
941 uint32 tod_tinterval
;
948 [nopush
,nopull
] NET_API_STATUS NetRemoteTOD
(
949 [in] string server_name
,
950 [out,ref] uint8
**buffer