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 /* auth_flags in USER_INFO_2 */
171 const int AF_OP_PRINT
= 0x1;
172 const int AF_OP_COMM
= 0x2;
173 const int AF_OP_SERVER
= 0x4;
174 const int AF_OP_ACCOUNTS
= 0x8;
175 const int AF_SETTABLE_BITS
= (AF_OP_PRINT | AF_OP_COMM | AF_OP_SERVER | AF_OP_ACCOUNTS
);
177 [public] typedef struct {
179 string usri2_password
;
180 uint32 usri2_password_age
;
182 string usri2_home_dir
;
183 string usri2_comment
;
185 string usri2_script_path
;
186 uint32 usri2_auth_flags
;
187 string usri2_full_name
;
188 string usri2_usr_comment
;
190 string usri2_workstations
;
191 uint32 usri2_last_logon
;
192 uint32 usri2_last_logoff
;
193 uint32 usri2_acct_expires
;
194 uint32 usri2_max_storage
;
195 uint32 usri2_units_per_week
;
196 uint8
*usri2_logon_hours
;
197 uint32 usri2_bad_pw_count
;
198 uint32 usri2_num_logons
;
199 string usri2_logon_server
;
200 uint32 usri2_country_code
;
201 uint32 usri2_code_page
;
204 [public] typedef struct {
206 uint32 usri3_password_age
;
208 string usri3_home_dir
;
209 string usri3_comment
;
211 string usri3_script_path
;
212 uint32 usri3_auth_flags
;
213 string usri3_full_name
;
214 string usri3_usr_comment
;
216 string usri3_workstations
;
217 uint32 usri3_last_logon
;
218 uint32 usri3_last_logoff
;
219 uint32 usri3_acct_expires
;
220 uint32 usri3_max_storage
;
221 uint32 usri3_units_per_week
;
222 uint8
*usri3_logon_hours
;
223 uint32 usri3_bad_pw_count
;
224 uint32 usri3_num_logons
;
225 string usri3_logon_server
;
226 uint32 usri3_country_code
;
227 uint32 usri3_code_page
;
228 uint32 usri3_user_id
;
229 uint32 usri3_primary_group_id
;
230 string usri3_profile
;
231 string usri3_home_dir_drive
;
232 uint32 usri3_password_expired
;
235 [public] typedef struct {
237 string usri4_password
;
238 uint32 usri4_password_age
;
240 string usri4_home_dir
;
241 string usri4_comment
;
243 string usri4_script_path
;
244 uint32 usri4_auth_flags
;
245 string usri4_full_name
;
246 string usri4_usr_comment
;
248 string usri4_workstations
;
249 uint32 usri4_last_logon
;
250 uint32 usri4_last_logoff
;
251 uint32 usri4_acct_expires
;
252 uint32 usri4_max_storage
;
253 uint32 usri4_units_per_week
;
254 uint8
*usri4_logon_hours
;
255 uint32 usri4_bad_pw_count
;
256 uint32 usri4_num_logons
;
257 string usri4_logon_server
;
258 uint32 usri4_country_code
;
259 uint32 usri4_code_page
;
260 domsid
*usri4_user_sid
;
261 uint32 usri4_primary_group_id
;
262 string usri4_profile
;
263 string usri4_home_dir_drive
;
264 uint32 usri4_password_expired
;
267 [public] typedef struct {
269 string usri10_comment
;
270 string usri10_usr_comment
;
271 string usri10_full_name
;
274 [public] typedef struct {
276 string usri11_comment
;
277 string usri11_usr_comment
;
278 string usri11_full_name
;
280 uint32 usri11_auth_flags
;
281 uint32 usri11_password_age
;
282 string usri11_home_dir
;
284 uint32 usri11_last_logon
;
285 uint32 usri11_last_logoff
;
286 uint32 usri11_bad_pw_count
;
287 uint32 usri11_num_logons
;
288 string usri11_logon_server
;
289 uint32 usri11_country_code
;
290 string usri11_workstations
;
291 uint32 usri11_max_storage
;
292 uint32 usri11_units_per_week
;
293 uint8
*usri11_logon_hours
;
294 uint32 usri11_code_page
;
297 [public] typedef struct {
299 string usri20_full_name
;
300 string usri20_comment
;
302 uint32 usri20_user_id
;
305 const int ENCRYPTED_PWLEN
= 16;
307 [public] typedef struct {
308 uint8 usri21_password
[ENCRYPTED_PWLEN
];
311 [public] typedef struct {
313 uint8 usri22_password
[ENCRYPTED_PWLEN
];
314 uint32 usri22_password_age
;
316 string usri22_home_dir
;
317 string usri22_comment
;
319 uint32 usri22_script_path
;
320 uint32 usri22_auth_flags
;
321 string usri22_full_name
;
322 string usri22_usr_comment
;
324 string usri22_workstations
;
325 uint32 usri22_last_logon
;
326 uint32 usri22_last_logoff
;
327 uint32 usri22_acct_expires
;
328 uint32 usri22_max_storage
;
329 uint32 usri22_units_per_week
;
330 uint8
*usri22_logon_hours
;
331 uint32 usri22_bad_pw_count
;
332 uint32 usri22_num_logons
;
333 string usri22_logon_server
;
334 uint32 usri22_country_code
;
335 uint32 usri22_code_page
;
338 [public] typedef struct {
340 string usri23_full_name
;
341 string usri23_comment
;
343 domsid
*usri23_user_sid
;
346 [public] typedef struct {
347 string usri1003_password
;
350 [public] typedef struct {
351 uint32 usri1005_priv
;
354 [public] typedef struct {
355 string usri1006_home_dir
;
358 [public] typedef struct {
359 string usri1007_comment
;
362 [public] typedef struct {
363 uint32 usri1008_flags
;
366 [public] typedef struct {
367 string usri1009_script_path
;
370 [public] typedef struct {
371 uint32 usri1010_auth_flags
;
374 [public] typedef struct {
375 string usri1011_full_name
;
378 [public] typedef struct {
379 string usri1012_usr_comment
;
382 [public] typedef struct {
383 string usri1013_parms
;
386 [public] typedef struct {
387 string usri1014_workstations
;
390 [public] typedef struct {
391 uint32 usri1017_acct_expires
;
394 [public] typedef struct {
395 uint32 usri1018_max_storage
;
398 [public] typedef struct {
399 uint32 usri1020_units_per_week
;
400 uint8
*usri1020_logon_hours
;
403 [public] typedef struct {
404 string usri1023_logon_server
;
407 [public] typedef struct {
408 uint32 usri1024_country_code
;
411 [public] typedef struct {
412 uint32 usri1025_code_page
;
415 [public] typedef struct {
416 uint32 usri1051_primary_group_id
;
419 [public] typedef struct {
420 string usri1052_profile
;
423 [public] typedef struct {
424 string usri1053_home_dir_drive
;
427 [public] typedef struct {
429 string usriX_password
;
430 uint32 usriX_password_age
;
432 string usriX_home_dir
;
433 string usriX_comment
;
435 string usriX_script_path
;
436 uint32 usriX_auth_flags
;
437 string usriX_full_name
;
438 string usriX_usr_comment
;
440 string usriX_workstations
;
441 uint32 usriX_last_logon
;
442 uint32 usriX_last_logoff
;
443 uint32 usriX_acct_expires
;
444 uint32 usriX_max_storage
;
445 uint32 usriX_units_per_week
;
446 uint8
*usriX_logon_hours
;
447 uint32 usriX_bad_pw_count
;
448 uint32 usriX_num_logons
;
449 string usriX_logon_server
;
450 uint32 usriX_country_code
;
451 uint32 usriX_code_page
;
452 string usriX_profile
;
453 string usriX_home_dir_drive
;
454 uint32 usriX_primary_group_id
;
457 [nopush
,nopull
] NET_API_STATUS NetUserAdd
(
458 [in,unique] string *server_name
,
460 [in,ref] uint8
*buffer
,
461 [out,ref] uint32
*parm_error
464 /*******************************************/
466 /*******************************************/
468 [nopush
,nopull
] NET_API_STATUS NetUserDel
(
469 [in,unique] string *server_name
,
470 [in,ref] string *user_name
473 /*******************************************/
475 /*******************************************/
477 const int FILTER_TEMP_DUPLICATE_ACCOUNT
= 0x0001;
478 const int FILTER_NORMAL_ACCOUNT
= 0x0002;
479 const int FILTER_INTERDOMAIN_TRUST_ACCOUNT
= 0x0008;
480 const int FILTER_WORKSTATION_TRUST_ACCOUNT
= 0x0010;
481 const int FILTER_SERVER_TRUST_ACCOUNT
= 0x0020;
483 [nopush
,nopull
] NET_API_STATUS NetUserEnum
(
484 [in,unique] string *server_name
,
487 [out,ref] uint8
**buffer
,
488 [in] uint32 prefmaxlen
,
489 [out,ref] uint32
*entries_read
,
490 [out,ref] uint32
*total_entries
,
491 [in,out,ref] uint32
*resume_handle
494 /*******************************************/
495 /* NetUserChangePassword */
496 /*******************************************/
498 [nopush
,nopull
] NET_API_STATUS NetUserChangePassword
(
499 [in] string domain_name
,
500 [in] string user_name
,
501 [in] string old_password
,
502 [in] string new_password
505 /*******************************************/
507 /*******************************************/
509 [nopush
,nopull
] NET_API_STATUS NetUserGetInfo
(
510 [in] string server_name
,
511 [in] string user_name
,
516 /*******************************************/
518 /*******************************************/
520 [nopush
,nopull
] NET_API_STATUS NetUserSetInfo
(
521 [in] string server_name
,
522 [in] string user_name
,
525 [out] uint32
*parm_err
528 /*******************************************/
529 /* NetUserGetGroups */
530 /*******************************************/
532 [public] typedef struct {
534 } GROUP_USERS_INFO_0
;
536 [public] typedef struct {
538 uint32 grui1_attributes
;
539 } GROUP_USERS_INFO_1
;
541 [nopush
,nopull
] NET_API_STATUS NetUserGetGroups
(
542 [in] string server_name
,
543 [in] string user_name
,
545 [out] uint8
**buffer
,
546 [in] uint32 prefmaxlen
,
547 [out,ref] uint32
*entries_read
,
548 [out,ref] uint32
*total_entries
551 /*******************************************/
552 /* NetUserModalsGet */
553 /*******************************************/
555 const int TIMEQ_FOREVER
= (uint32_t
)-1L;
558 uint32 usrmod0_min_passwd_len
;
559 uint32 usrmod0_max_passwd_age
;
560 uint32 usrmod0_min_passwd_age
;
561 uint32 usrmod0_force_logoff
;
562 uint32 usrmod0_password_hist_len
;
563 } USER_MODALS_INFO_0
;
567 string usrmod1_primary
;
568 } USER_MODALS_INFO_1
;
571 string usrmod2_domain_name
;
572 domsid
*usrmod2_domain_id
;
573 } USER_MODALS_INFO_2
;
576 uint32 usrmod3_lockout_duration
;
577 uint32 usrmod3_lockout_observation_window
;
578 uint32 usrmod3_lockout_threshold
;
579 } USER_MODALS_INFO_3
;
582 uint32 usrmod1001_min_passwd_len
;
583 } USER_MODALS_INFO_1001
;
586 uint32 usrmod1002_max_passwd_age
;
587 } USER_MODALS_INFO_1002
;
590 uint32 usrmod1003_min_passwd_age
;
591 } USER_MODALS_INFO_1003
;
594 uint32 usrmod1004_force_logoff
;
595 } USER_MODALS_INFO_1004
;
598 uint32 usrmod1005_password_hist_len
;
599 } USER_MODALS_INFO_1005
;
602 uint32 usrmod1006_role
;
603 } USER_MODALS_INFO_1006
;
606 string usrmod1007_primary
;
607 } USER_MODALS_INFO_1007
;
609 [nopush
,nopull
] NET_API_STATUS NetUserModalsGet
(
610 [in] string server_name
,
612 [out,ref] uint8
**buffer
615 /*******************************************/
616 /* NetUserModalsSet */
617 /*******************************************/
619 [nopush
,nopull
] NET_API_STATUS NetUserModalsSet
(
620 [in] string server_name
,
623 [out,ref] uint32
*parm_err
626 /*******************************************/
627 /* NetQueryDisplayInformation */
628 /*******************************************/
630 [public] typedef struct {
632 string usri1_comment
;
634 string usri1_full_name
;
635 uint32 usri1_user_id
;
636 uint32 usri1_next_index
;
639 [public] typedef struct {
641 string usri2_comment
;
643 uint32 usri2_user_id
;
644 uint32 usri2_next_index
;
645 } NET_DISPLAY_MACHINE
;
647 [public] typedef struct {
649 string grpi3_comment
;
650 uint32 grpi3_group_id
;
651 uint32 grpi3_attributes
;
652 uint32 grpi3_next_index
;
655 [nopush
,nopull
] NET_API_STATUS NetQueryDisplayInformation
(
656 [in,unique] string *server_name
,
659 [in] uint32 entries_requested
,
660 [in] uint32 prefmaxlen
,
661 [out,ref] uint32
*entries_read
,
662 [out,ref,noprint
] void **buffer
665 /*******************************************/
667 /*******************************************/
675 string grpi1_comment
;
680 string grpi2_comment
;
681 uint32 grpi2_group_id
;
682 uint32 grpi2_attributes
;
687 string grpi3_comment
;
688 domsid
*grpi3_group_sid
;
689 uint32 grpi3_attributes
;
693 string grpi1002_comment
;
697 uint32 grpi1005_attributes
;
700 [nopush
,nopull
] NET_API_STATUS NetGroupAdd
(
701 [in] string server_name
,
704 [out] uint32
*parm_err
707 /*******************************************/
709 /*******************************************/
711 [nopush
,nopull
] NET_API_STATUS NetGroupDel
(
712 [in] string server_name
,
713 [in] string group_name
716 /*******************************************/
718 /*******************************************/
720 [nopush
,nopull
] NET_API_STATUS NetGroupEnum
(
721 [in] string server_name
,
723 [out,ref] uint8
**buffer
,
724 [in] uint32 prefmaxlen
,
725 [out,ref] uint32
*entries_read
,
726 [out,ref] uint32
*total_entries
,
727 [in,out,ref] uint32
*resume_handle
730 /*******************************************/
731 /* NetGroupSetInfo */
732 /*******************************************/
734 [nopush
,nopull
] NET_API_STATUS NetGroupSetInfo
(
735 [in] string server_name
,
736 [in] string group_name
,
739 [out] uint32
*parm_err
742 /*******************************************/
743 /* NetGroupGetInfo */
744 /*******************************************/
746 [nopush
,nopull
] NET_API_STATUS NetGroupGetInfo
(
747 [in] string server_name
,
748 [in] string group_name
,
753 /*******************************************/
754 /* NetGroupAddUser */
755 /*******************************************/
757 [nopush
,nopull
] NET_API_STATUS NetGroupAddUser
(
758 [in] string server_name
,
759 [in] string group_name
,
760 [in] string user_name
763 /*******************************************/
764 /* NetGroupDelUser */
765 /*******************************************/
767 [nopush
,nopull
] NET_API_STATUS NetGroupDelUser
(
768 [in] string server_name
,
769 [in] string group_name
,
770 [in] string user_name
773 /*******************************************/
774 /* NetGroupGetUsers */
775 /*******************************************/
777 [nopush
,nopull
] NET_API_STATUS NetGroupGetUsers
(
778 [in] string server_name
,
779 [in] string group_name
,
781 [out] uint8
**buffer
,
782 [in] uint32 prefmaxlen
,
783 [out,ref] uint32
*entries_read
,
784 [out,ref] uint32
*total_entries
,
785 [in,out,ref] uint32
*resume_handle
788 /*******************************************/
789 /* NetLocalGroupAdd */
790 /*******************************************/
798 string lgrpi1_comment
;
802 string lgrpi1002_comment
;
803 } LOCALGROUP_INFO_1002
;
805 [nopush
,nopull
] NET_API_STATUS NetLocalGroupAdd
(
806 [in] string server_name
,
809 [out,ref] uint32
*parm_err
812 /*******************************************/
813 /* NetLocalGroupDel */
814 /*******************************************/
816 [nopush
,nopull
] NET_API_STATUS NetLocalGroupDel
(
817 [in] string server_name
,
818 [in] string group_name
821 /*******************************************/
822 /* NetLocalGroupGetInfo */
823 /*******************************************/
825 [nopush
,nopull
] NET_API_STATUS NetLocalGroupGetInfo
(
826 [in] string server_name
,
827 [in] string group_name
,
829 [out,ref] uint8
**buffer
832 /*******************************************/
833 /* NetLocalGroupSetInfo */
834 /*******************************************/
836 [nopush
,nopull
] NET_API_STATUS NetLocalGroupSetInfo
(
837 [in] string server_name
,
838 [in] string group_name
,
840 [in,ref] uint8
*buffer
,
841 [out,ref] uint32
*parm_err
844 /*******************************************/
845 /* NetLocalGroupEnum */
846 /*******************************************/
848 [nopush
,nopull
] NET_API_STATUS NetLocalGroupEnum
(
849 [in] string server_name
,
851 [out,ref] uint8
**buffer
,
852 [in] uint32 prefmaxlen
,
853 [out,ref] uint32
*entries_read
,
854 [out,ref] uint32
*total_entries
,
855 [in,out,ref] uint32
*resume_handle
858 /*******************************************/
859 /* NetLocalGroupAddMembers */
860 /*******************************************/
867 SidTypeWellKnownGroup
= 5,
868 SidTypeDeletedAccount
= 6,
877 } LOCALGROUP_MEMBERS_INFO_0
;
881 SID_NAME_USE lgrmi1_sidusage
;
883 } LOCALGROUP_MEMBERS_INFO_1
;
887 SID_NAME_USE lgrmi2_sidusage
;
888 string lgrmi2_domainandname
;
889 } LOCALGROUP_MEMBERS_INFO_2
;
892 string lgrmi3_domainandname
;
893 } LOCALGROUP_MEMBERS_INFO_3
;
895 [nopush
,nopull
] NET_API_STATUS NetLocalGroupAddMembers
(
896 [in] string server_name
,
897 [in] string group_name
,
900 [in] uint32 total_entries
903 /*******************************************/
904 /* NetLocalGroupDelMembers */
905 /*******************************************/
907 [nopush
,nopull
] NET_API_STATUS NetLocalGroupDelMembers
(
908 [in] string server_name
,
909 [in] string group_name
,
912 [in] uint32 total_entries
915 /*******************************************/
916 /* NetLocalGroupGetMembers */
917 /*******************************************/
919 [nopush
,nopull
] NET_API_STATUS NetLocalGroupGetMembers
(
920 [in] string server_name
,
921 [in] string local_group_name
,
923 [out] uint8
**buffer
,
924 [in] uint32 prefmaxlen
,
925 [out] uint32
*entries_read
,
926 [out] uint32
*total_entries
,
927 [in,out] uint32
*resume_handle
930 /*******************************************/
931 /* NetLocalGroupSetMembers */
932 /*******************************************/
934 [nopush
,nopull
] NET_API_STATUS NetLocalGroupSetMembers
(
935 [in] string server_name
,
936 [in] string group_name
,
939 [in] uint32 total_entries
942 /*******************************************/
944 /*******************************************/
954 uint32 tod_tinterval
;
961 [nopush
,nopull
] NET_API_STATUS NetRemoteTOD
(
962 [in] string server_name
,
963 [out,ref] uint8
**buffer
966 /*******************************************/
968 /*******************************************/
974 uint32 shi2_permissions
;
975 uint32 shi2_max_uses
;
976 uint32 shi2_current_uses
;
981 [nopush
,nopull
] NET_API_STATUS NetShareAdd
(
982 [in] string server_name
,
985 [out] uint32
*parm_err