Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1375 lines
38 KiB

  1. /*++ BUILD Version: 0002 // Increment this if a change has global effects
  2. Copyright (c) 1991-1995 Microsoft Corporation
  3. Module Name:
  4. lmaccess.h
  5. Abstract:
  6. This file contains structures, function prototypes, and definitions
  7. for the NetUser, NetUserModals, NetGroup, NetAccess, and NetLogon API.
  8. Environment:
  9. User Mode - Win32
  10. Notes:
  11. You must include NETCONS.H before this file, since this file depends
  12. on values defined in NETCONS.H.
  13. --*/
  14. //
  15. // User Class
  16. //
  17. #ifndef _LMUSER_
  18. #define _LMUSER_
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #include <lmcons.h> // unfortunately created a dependence on this
  23. //
  24. // Function Prototypes - User
  25. //
  26. NET_API_STATUS NET_API_FUNCTION
  27. NetUserAdd (
  28. IN LPWSTR servername OPTIONAL,
  29. IN DWORD level,
  30. IN LPBYTE buf,
  31. OUT LPDWORD parm_err OPTIONAL
  32. );
  33. NET_API_STATUS NET_API_FUNCTION
  34. NetUserEnum (
  35. IN LPWSTR servername OPTIONAL,
  36. IN DWORD level,
  37. IN DWORD filter,
  38. OUT LPBYTE *bufptr,
  39. IN DWORD prefmaxlen,
  40. OUT LPDWORD entriesread,
  41. OUT LPDWORD totalentries,
  42. IN OUT LPDWORD resume_handle OPTIONAL
  43. );
  44. NET_API_STATUS NET_API_FUNCTION
  45. NetUserGetInfo (
  46. IN LPWSTR servername OPTIONAL,
  47. IN LPWSTR username,
  48. IN DWORD level,
  49. OUT LPBYTE *bufptr
  50. );
  51. NET_API_STATUS NET_API_FUNCTION
  52. NetUserSetInfo (
  53. IN LPWSTR servername OPTIONAL,
  54. IN LPWSTR username,
  55. IN DWORD level,
  56. IN LPBYTE buf,
  57. OUT LPDWORD parm_err OPTIONAL
  58. );
  59. NET_API_STATUS NET_API_FUNCTION
  60. NetUserDel (
  61. IN LPWSTR servername OPTIONAL,
  62. IN LPWSTR username
  63. );
  64. NET_API_STATUS NET_API_FUNCTION
  65. NetUserGetGroups (
  66. IN LPWSTR servername OPTIONAL,
  67. IN LPWSTR username,
  68. IN DWORD level,
  69. OUT LPBYTE *bufptr,
  70. IN DWORD prefmaxlen,
  71. OUT LPDWORD entriesread,
  72. OUT LPDWORD totalentries
  73. );
  74. NET_API_STATUS NET_API_FUNCTION
  75. NetUserSetGroups (
  76. IN LPWSTR servername OPTIONAL,
  77. IN LPWSTR username,
  78. IN DWORD level,
  79. IN LPBYTE buf,
  80. IN DWORD num_entries
  81. );
  82. NET_API_STATUS NET_API_FUNCTION
  83. NetUserGetLocalGroups (
  84. IN LPWSTR servername OPTIONAL,
  85. IN LPWSTR username,
  86. IN DWORD level,
  87. IN DWORD flags,
  88. OUT LPBYTE *bufptr,
  89. IN DWORD prefmaxlen,
  90. OUT LPDWORD entriesread,
  91. OUT LPDWORD totalentries
  92. );
  93. NET_API_STATUS NET_API_FUNCTION
  94. NetUserModalsGet (
  95. IN LPWSTR servername OPTIONAL,
  96. IN DWORD level,
  97. OUT LPBYTE *bufptr
  98. );
  99. NET_API_STATUS NET_API_FUNCTION
  100. NetUserModalsSet (
  101. IN LPWSTR servername OPTIONAL,
  102. IN DWORD level,
  103. IN LPBYTE buf,
  104. OUT LPDWORD parm_err OPTIONAL
  105. );
  106. NET_API_STATUS NET_API_FUNCTION
  107. NetUserChangePassword (
  108. IN LPWSTR domainname OPTIONAL,
  109. IN LPWSTR username OPTIONAL,
  110. IN LPWSTR oldpassword,
  111. IN LPWSTR newpassword
  112. );
  113. //
  114. // Data Structures - User
  115. //
  116. typedef struct _USER_INFO_0 {
  117. LPWSTR usri0_name;
  118. }USER_INFO_0, *PUSER_INFO_0, *LPUSER_INFO_0;
  119. typedef struct _USER_INFO_1 {
  120. LPWSTR usri1_name;
  121. LPWSTR usri1_password;
  122. DWORD usri1_password_age;
  123. DWORD usri1_priv;
  124. LPWSTR usri1_home_dir;
  125. LPWSTR usri1_comment;
  126. DWORD usri1_flags;
  127. LPWSTR usri1_script_path;
  128. }USER_INFO_1, *PUSER_INFO_1, *LPUSER_INFO_1;
  129. typedef struct _USER_INFO_2 {
  130. LPWSTR usri2_name;
  131. LPWSTR usri2_password;
  132. DWORD usri2_password_age;
  133. DWORD usri2_priv;
  134. LPWSTR usri2_home_dir;
  135. LPWSTR usri2_comment;
  136. DWORD usri2_flags;
  137. LPWSTR usri2_script_path;
  138. DWORD usri2_auth_flags;
  139. LPWSTR usri2_full_name;
  140. LPWSTR usri2_usr_comment;
  141. LPWSTR usri2_parms;
  142. LPWSTR usri2_workstations;
  143. DWORD usri2_last_logon;
  144. DWORD usri2_last_logoff;
  145. DWORD usri2_acct_expires;
  146. DWORD usri2_max_storage;
  147. DWORD usri2_units_per_week;
  148. PBYTE usri2_logon_hours;
  149. DWORD usri2_bad_pw_count;
  150. DWORD usri2_num_logons;
  151. LPWSTR usri2_logon_server;
  152. DWORD usri2_country_code;
  153. DWORD usri2_code_page;
  154. }USER_INFO_2, *PUSER_INFO_2, *LPUSER_INFO_2;
  155. typedef struct _USER_INFO_3 {
  156. LPWSTR usri3_name;
  157. LPWSTR usri3_password;
  158. DWORD usri3_password_age;
  159. DWORD usri3_priv;
  160. LPWSTR usri3_home_dir;
  161. LPWSTR usri3_comment;
  162. DWORD usri3_flags;
  163. LPWSTR usri3_script_path;
  164. DWORD usri3_auth_flags;
  165. LPWSTR usri3_full_name;
  166. LPWSTR usri3_usr_comment;
  167. LPWSTR usri3_parms;
  168. LPWSTR usri3_workstations;
  169. DWORD usri3_last_logon;
  170. DWORD usri3_last_logoff;
  171. DWORD usri3_acct_expires;
  172. DWORD usri3_max_storage;
  173. DWORD usri3_units_per_week;
  174. PBYTE usri3_logon_hours;
  175. DWORD usri3_bad_pw_count;
  176. DWORD usri3_num_logons;
  177. LPWSTR usri3_logon_server;
  178. DWORD usri3_country_code;
  179. DWORD usri3_code_page;
  180. DWORD usri3_user_id;
  181. DWORD usri3_primary_group_id;
  182. LPWSTR usri3_profile;
  183. LPWSTR usri3_home_dir_drive;
  184. DWORD usri3_password_expired;
  185. }USER_INFO_3, *PUSER_INFO_3, *LPUSER_INFO_3;
  186. typedef struct _USER_INFO_10 {
  187. LPWSTR usri10_name;
  188. LPWSTR usri10_comment;
  189. LPWSTR usri10_usr_comment;
  190. LPWSTR usri10_full_name;
  191. }USER_INFO_10, *PUSER_INFO_10, *LPUSER_INFO_10;
  192. typedef struct _USER_INFO_11 {
  193. LPWSTR usri11_name;
  194. LPWSTR usri11_comment;
  195. LPWSTR usri11_usr_comment;
  196. LPWSTR usri11_full_name;
  197. DWORD usri11_priv;
  198. DWORD usri11_auth_flags;
  199. DWORD usri11_password_age;
  200. LPWSTR usri11_home_dir;
  201. LPWSTR usri11_parms;
  202. DWORD usri11_last_logon;
  203. DWORD usri11_last_logoff;
  204. DWORD usri11_bad_pw_count;
  205. DWORD usri11_num_logons;
  206. LPWSTR usri11_logon_server;
  207. DWORD usri11_country_code;
  208. LPWSTR usri11_workstations;
  209. DWORD usri11_max_storage;
  210. DWORD usri11_units_per_week;
  211. PBYTE usri11_logon_hours;
  212. DWORD usri11_code_page;
  213. }USER_INFO_11, *PUSER_INFO_11, *LPUSER_INFO_11;
  214. typedef struct _USER_INFO_20 {
  215. LPWSTR usri20_name;
  216. LPWSTR usri20_full_name;
  217. LPWSTR usri20_comment;
  218. DWORD usri20_flags;
  219. DWORD usri20_user_id;
  220. }USER_INFO_20, *PUSER_INFO_20, *LPUSER_INFO_20;
  221. typedef struct _USER_INFO_21 {
  222. BYTE usri21_password[ENCRYPTED_PWLEN];
  223. }USER_INFO_21, *PUSER_INFO_21, *LPUSER_INFO_21;
  224. typedef struct _USER_INFO_22 {
  225. LPWSTR usri22_name;
  226. BYTE usri22_password[ENCRYPTED_PWLEN];
  227. DWORD usri22_password_age;
  228. DWORD usri22_priv;
  229. LPWSTR usri22_home_dir;
  230. LPWSTR usri22_comment;
  231. DWORD usri22_flags;
  232. LPWSTR usri22_script_path;
  233. DWORD usri22_auth_flags;
  234. LPWSTR usri22_full_name;
  235. LPWSTR usri22_usr_comment;
  236. LPWSTR usri22_parms;
  237. LPWSTR usri22_workstations;
  238. DWORD usri22_last_logon;
  239. DWORD usri22_last_logoff;
  240. DWORD usri22_acct_expires;
  241. DWORD usri22_max_storage;
  242. DWORD usri22_units_per_week;
  243. PBYTE usri22_logon_hours;
  244. DWORD usri22_bad_pw_count;
  245. DWORD usri22_num_logons;
  246. LPWSTR usri22_logon_server;
  247. DWORD usri22_country_code;
  248. DWORD usri22_code_page;
  249. }USER_INFO_22, *PUSER_INFO_22, *LPUSER_INFO_22;
  250. typedef struct _USER_INFO_1003 {
  251. LPWSTR usri1003_password;
  252. } USER_INFO_1003, *PUSER_INFO_1003, *LPUSER_INFO_1003;
  253. typedef struct _USER_INFO_1005 {
  254. DWORD usri1005_priv;
  255. } USER_INFO_1005, *PUSER_INFO_1005, *LPUSER_INFO_1005;
  256. typedef struct _USER_INFO_1006 {
  257. LPWSTR usri1006_home_dir;
  258. } USER_INFO_1006, *PUSER_INFO_1006, *LPUSER_INFO_1006;
  259. typedef struct _USER_INFO_1007 {
  260. LPWSTR usri1007_comment;
  261. } USER_INFO_1007, *PUSER_INFO_1007, *LPUSER_INFO_1007;
  262. typedef struct _USER_INFO_1008 {
  263. DWORD usri1008_flags;
  264. } USER_INFO_1008, *PUSER_INFO_1008, *LPUSER_INFO_1008;
  265. typedef struct _USER_INFO_1009 {
  266. LPWSTR usri1009_script_path;
  267. } USER_INFO_1009, *PUSER_INFO_1009, *LPUSER_INFO_1009;
  268. typedef struct _USER_INFO_1010 {
  269. DWORD usri1010_auth_flags;
  270. } USER_INFO_1010, *PUSER_INFO_1010, *LPUSER_INFO_1010;
  271. typedef struct _USER_INFO_1011 {
  272. LPWSTR usri1011_full_name;
  273. } USER_INFO_1011, *PUSER_INFO_1011, *LPUSER_INFO_1011;
  274. typedef struct _USER_INFO_1012 {
  275. LPWSTR usri1012_usr_comment;
  276. } USER_INFO_1012, *PUSER_INFO_1012, *LPUSER_INFO_1012;
  277. typedef struct _USER_INFO_1013 {
  278. LPWSTR usri1013_parms;
  279. } USER_INFO_1013, *PUSER_INFO_1013, *LPUSER_INFO_1013;
  280. typedef struct _USER_INFO_1014 {
  281. LPWSTR usri1014_workstations;
  282. } USER_INFO_1014, *PUSER_INFO_1014, *LPUSER_INFO_1014;
  283. typedef struct _USER_INFO_1017 {
  284. DWORD usri1017_acct_expires;
  285. } USER_INFO_1017, *PUSER_INFO_1017, *LPUSER_INFO_1017;
  286. typedef struct _USER_INFO_1018 {
  287. DWORD usri1018_max_storage;
  288. } USER_INFO_1018, *PUSER_INFO_1018, *LPUSER_INFO_1018;
  289. typedef struct _USER_INFO_1020 {
  290. DWORD usri1020_units_per_week;
  291. LPBYTE usri1020_logon_hours;
  292. } USER_INFO_1020, *PUSER_INFO_1020, *LPUSER_INFO_1020;
  293. typedef struct _USER_INFO_1023 {
  294. LPWSTR usri1023_logon_server;
  295. } USER_INFO_1023, *PUSER_INFO_1023, *LPUSER_INFO_1023;
  296. typedef struct _USER_INFO_1024 {
  297. DWORD usri1024_country_code;
  298. } USER_INFO_1024, *PUSER_INFO_1024, *LPUSER_INFO_1024;
  299. typedef struct _USER_INFO_1025 {
  300. DWORD usri1025_code_page;
  301. } USER_INFO_1025, *PUSER_INFO_1025, *LPUSER_INFO_1025;
  302. typedef struct _USER_INFO_1051 {
  303. DWORD usri1051_primary_group_id;
  304. } USER_INFO_1051, *PUSER_INFO_1051, *LPUSER_INFO_1051;
  305. typedef struct _USER_INFO_1052 {
  306. LPWSTR usri1052_profile;
  307. } USER_INFO_1052, *PUSER_INFO_1052, *LPUSER_INFO_1052;
  308. typedef struct _USER_INFO_1053 {
  309. LPWSTR usri1053_home_dir_drive;
  310. } USER_INFO_1053, *PUSER_INFO_1053, *LPUSER_INFO_1053;
  311. //
  312. // Data Structures - User Modals
  313. //
  314. typedef struct _USER_MODALS_INFO_0 {
  315. DWORD usrmod0_min_passwd_len;
  316. DWORD usrmod0_max_passwd_age;
  317. DWORD usrmod0_min_passwd_age;
  318. DWORD usrmod0_force_logoff;
  319. DWORD usrmod0_password_hist_len;
  320. }USER_MODALS_INFO_0, *PUSER_MODALS_INFO_0, *LPUSER_MODALS_INFO_0;
  321. typedef struct _USER_MODALS_INFO_1 {
  322. DWORD usrmod1_role;
  323. LPWSTR usrmod1_primary;
  324. }USER_MODALS_INFO_1, *PUSER_MODALS_INFO_1, *LPUSER_MODALS_INFO_1;
  325. typedef struct _USER_MODALS_INFO_2 {
  326. LPWSTR usrmod2_domain_name;
  327. PSID usrmod2_domain_id;
  328. }USER_MODALS_INFO_2, *PUSER_MODALS_INFO_2, *LPUSER_MODALS_INFO_2;
  329. typedef struct _USER_MODALS_INFO_3 {
  330. DWORD usrmod3_lockout_duration;
  331. DWORD usrmod3_lockout_observation_window;
  332. DWORD usrmod3_lockout_threshold;
  333. }USER_MODALS_INFO_3, *PUSER_MODALS_INFO_3, *LPUSER_MODALS_INFO_3;
  334. typedef struct _USER_MODALS_INFO_1001 {
  335. DWORD usrmod1001_min_passwd_len;
  336. } USER_MODALS_INFO_1001, *PUSER_MODALS_INFO_1001, *LPUSER_MODALS_INFO_1001;
  337. typedef struct _USER_MODALS_INFO_1002 {
  338. DWORD usrmod1002_max_passwd_age;
  339. } USER_MODALS_INFO_1002, *PUSER_MODALS_INFO_1002, *LPUSER_MODALS_INFO_1002;
  340. typedef struct _USER_MODALS_INFO_1003 {
  341. DWORD usrmod1003_min_passwd_age;
  342. } USER_MODALS_INFO_1003, *PUSER_MODALS_INFO_1003, *LPUSER_MODALS_INFO_1003;
  343. typedef struct _USER_MODALS_INFO_1004 {
  344. DWORD usrmod1004_force_logoff;
  345. } USER_MODALS_INFO_1004, *PUSER_MODALS_INFO_1004, *LPUSER_MODALS_INFO_1004;
  346. typedef struct _USER_MODALS_INFO_1005 {
  347. DWORD usrmod1005_password_hist_len;
  348. } USER_MODALS_INFO_1005, *PUSER_MODALS_INFO_1005, *LPUSER_MODALS_INFO_1005;
  349. typedef struct _USER_MODALS_INFO_1006 {
  350. DWORD usrmod1006_role;
  351. } USER_MODALS_INFO_1006, *PUSER_MODALS_INFO_1006, *LPUSER_MODALS_INFO_1006;
  352. typedef struct _USER_MODALS_INFO_1007 {
  353. LPWSTR usrmod1007_primary;
  354. } USER_MODALS_INFO_1007, *PUSER_MODALS_INFO_1007, *LPUSER_MODALS_INFO_1007;
  355. //
  356. // Special Values and Constants - User
  357. //
  358. //
  359. // Bit masks for field usriX_flags of USER_INFO_X (X = 0/1).
  360. //
  361. #define UF_SCRIPT 0x0001
  362. #define UF_ACCOUNTDISABLE 0x0002
  363. #define UF_HOMEDIR_REQUIRED 0x0008
  364. #define UF_LOCKOUT 0x0010
  365. #define UF_PASSWD_NOTREQD 0x0020
  366. #define UF_PASSWD_CANT_CHANGE 0x0040
  367. //
  368. // Account type bits as part of usri_flags.
  369. //
  370. #define UF_TEMP_DUPLICATE_ACCOUNT 0x0100
  371. #define UF_NORMAL_ACCOUNT 0x0200
  372. #define UF_INTERDOMAIN_TRUST_ACCOUNT 0x0800
  373. #define UF_WORKSTATION_TRUST_ACCOUNT 0x1000
  374. #define UF_SERVER_TRUST_ACCOUNT 0x2000
  375. #define UF_MACHINE_ACCOUNT_MASK ( UF_INTERDOMAIN_TRUST_ACCOUNT | \
  376. UF_WORKSTATION_TRUST_ACCOUNT | \
  377. UF_SERVER_TRUST_ACCOUNT )
  378. #define UF_ACCOUNT_TYPE_MASK ( \
  379. UF_TEMP_DUPLICATE_ACCOUNT | \
  380. UF_NORMAL_ACCOUNT | \
  381. UF_INTERDOMAIN_TRUST_ACCOUNT | \
  382. UF_WORKSTATION_TRUST_ACCOUNT | \
  383. UF_SERVER_TRUST_ACCOUNT \
  384. )
  385. #define UF_DONT_EXPIRE_PASSWD 0x10000
  386. #define UF_SETTABLE_BITS ( \
  387. UF_SCRIPT | \
  388. UF_ACCOUNTDISABLE | \
  389. UF_LOCKOUT | \
  390. UF_HOMEDIR_REQUIRED | \
  391. UF_PASSWD_NOTREQD | \
  392. UF_PASSWD_CANT_CHANGE | \
  393. UF_ACCOUNT_TYPE_MASK | \
  394. UF_DONT_EXPIRE_PASSWD \
  395. )
  396. //
  397. // bit masks for the NetUserEnum filter parameter.
  398. //
  399. #define FILTER_TEMP_DUPLICATE_ACCOUNT (0x0001)
  400. #define FILTER_NORMAL_ACCOUNT (0x0002)
  401. // #define FILTER_PROXY_ACCOUNT (0x0004)
  402. #define FILTER_INTERDOMAIN_TRUST_ACCOUNT (0x0008)
  403. #define FILTER_WORKSTATION_TRUST_ACCOUNT (0x0010)
  404. #define FILTER_SERVER_TRUST_ACCOUNT (0x0020)
  405. //
  406. // bit masks for the NetUserGetLocalGroups flags
  407. //
  408. #define LG_INCLUDE_INDIRECT (0x0001)
  409. //
  410. // Bit masks for field usri2_auth_flags of USER_INFO_2.
  411. //
  412. #define AF_OP_PRINT 0x1
  413. #define AF_OP_COMM 0x2
  414. #define AF_OP_SERVER 0x4
  415. #define AF_OP_ACCOUNTS 0x8
  416. #define AF_SETTABLE_BITS (AF_OP_PRINT | AF_OP_COMM | \
  417. AF_OP_SERVER | AF_OP_ACCOUNTS)
  418. //
  419. // UAS role manifests under NETLOGON
  420. //
  421. #define UAS_ROLE_STANDALONE 0
  422. #define UAS_ROLE_MEMBER 1
  423. #define UAS_ROLE_BACKUP 2
  424. #define UAS_ROLE_PRIMARY 3
  425. //
  426. // Values for ParmError for NetUserSetInfo.
  427. //
  428. #define USER_NAME_PARMNUM 1
  429. #define USER_PASSWORD_PARMNUM 3
  430. #define USER_PASSWORD_AGE_PARMNUM 4
  431. #define USER_PRIV_PARMNUM 5
  432. #define USER_HOME_DIR_PARMNUM 6
  433. #define USER_COMMENT_PARMNUM 7
  434. #define USER_FLAGS_PARMNUM 8
  435. #define USER_SCRIPT_PATH_PARMNUM 9
  436. #define USER_AUTH_FLAGS_PARMNUM 10
  437. #define USER_FULL_NAME_PARMNUM 11
  438. #define USER_USR_COMMENT_PARMNUM 12
  439. #define USER_PARMS_PARMNUM 13
  440. #define USER_WORKSTATIONS_PARMNUM 14
  441. #define USER_LAST_LOGON_PARMNUM 15
  442. #define USER_LAST_LOGOFF_PARMNUM 16
  443. #define USER_ACCT_EXPIRES_PARMNUM 17
  444. #define USER_MAX_STORAGE_PARMNUM 18
  445. #define USER_UNITS_PER_WEEK_PARMNUM 19
  446. #define USER_LOGON_HOURS_PARMNUM 20
  447. #define USER_PAD_PW_COUNT_PARMNUM 21
  448. #define USER_NUM_LOGONS_PARMNUM 22
  449. #define USER_LOGON_SERVER_PARMNUM 23
  450. #define USER_COUNTRY_CODE_PARMNUM 24
  451. #define USER_CODE_PAGE_PARMNUM 25
  452. #define USER_PRIMARY_GROUP_PARMNUM 51
  453. #define USER_PROFILE 52 // ?? Delete when convenient
  454. #define USER_PROFILE_PARMNUM 52
  455. #define USER_HOME_DIR_DRIVE_PARMNUM 53
  456. //
  457. // the new infolevel counterparts of the old info level + parmnum
  458. //
  459. #define USER_NAME_INFOLEVEL \
  460. (PARMNUM_BASE_INFOLEVEL + USER_NAME_PARMNUM)
  461. #define USER_PASSWORD_INFOLEVEL \
  462. (PARMNUM_BASE_INFOLEVEL + USER_PASSWORD_PARMNUM)
  463. #define USER_PASSWORD_AGE_INFOLEVEL \
  464. (PARMNUM_BASE_INFOLEVEL + USER_PASSWORD_AGE_PARMNUM)
  465. #define USER_PRIV_INFOLEVEL \
  466. (PARMNUM_BASE_INFOLEVEL + USER_PRIV_PARMNUM)
  467. #define USER_HOME_DIR_INFOLEVEL \
  468. (PARMNUM_BASE_INFOLEVEL + USER_HOME_DIR_PARMNUM)
  469. #define USER_COMMENT_INFOLEVEL \
  470. (PARMNUM_BASE_INFOLEVEL + USER_COMMENT_PARMNUM)
  471. #define USER_FLAGS_INFOLEVEL \
  472. (PARMNUM_BASE_INFOLEVEL + USER_FLAGS_PARMNUM)
  473. #define USER_SCRIPT_PATH_INFOLEVEL \
  474. (PARMNUM_BASE_INFOLEVEL + USER_SCRIPT_PATH_PARMNUM)
  475. #define USER_AUTH_FLAGS_INFOLEVEL \
  476. (PARMNUM_BASE_INFOLEVEL + USER_AUTH_FLAGS_PARMNUM)
  477. #define USER_FULL_NAME_INFOLEVEL \
  478. (PARMNUM_BASE_INFOLEVEL + USER_FULL_NAME_PARMNUM)
  479. #define USER_USR_COMMENT_INFOLEVEL \
  480. (PARMNUM_BASE_INFOLEVEL + USER_USR_COMMENT_PARMNUM)
  481. #define USER_PARMS_INFOLEVEL \
  482. (PARMNUM_BASE_INFOLEVEL + USER_PARMS_PARMNUM)
  483. #define USER_WORKSTATIONS_INFOLEVEL \
  484. (PARMNUM_BASE_INFOLEVEL + USER_WORKSTATIONS_PARMNUM)
  485. #define USER_LAST_LOGON_INFOLEVEL \
  486. (PARMNUM_BASE_INFOLEVEL + USER_LAST_LOGON_PARMNUM)
  487. #define USER_LAST_LOGOFF_INFOLEVEL \
  488. (PARMNUM_BASE_INFOLEVEL + USER_LAST_LOGOFF_PARMNUM)
  489. #define USER_ACCT_EXPIRES_INFOLEVEL \
  490. (PARMNUM_BASE_INFOLEVEL + USER_ACCT_EXPIRES_PARMNUM)
  491. #define USER_MAX_STORAGE_INFOLEVEL \
  492. (PARMNUM_BASE_INFOLEVEL + USER_MAX_STORAGE_PARMNUM)
  493. #define USER_UNITS_PER_WEEK_INFOLEVEL \
  494. (PARMNUM_BASE_INFOLEVEL + USER_UNITS_PER_WEEK_PARMNUM)
  495. #define USER_LOGON_HOURS_INFOLEVEL \
  496. (PARMNUM_BASE_INFOLEVEL + USER_LOGON_HOURS_PARMNUM)
  497. #define USER_PAD_PW_COUNT_INFOLEVEL \
  498. (PARMNUM_BASE_INFOLEVEL + USER_PAD_PW_COUNT_PARMNUM)
  499. #define USER_NUM_LOGONS_INFOLEVEL \
  500. (PARMNUM_BASE_INFOLEVEL + USER_NUM_LOGONS_PARMNUM)
  501. #define USER_LOGON_SERVER_INFOLEVEL \
  502. (PARMNUM_BASE_INFOLEVEL + USER_LOGON_SERVER_PARMNUM)
  503. #define USER_COUNTRY_CODE_INFOLEVEL \
  504. (PARMNUM_BASE_INFOLEVEL + USER_COUNTRY_CODE_PARMNUM)
  505. #define USER_CODE_PAGE_INFOLEVEL \
  506. (PARMNUM_BASE_INFOLEVEL + USER_CODE_PAGE_PARMNUM)
  507. #define USER_PRIMARY_GROUP_INFOLEVEL \
  508. (PARMNUM_BASE_INFOLEVEL + USER_PRIMARY_GROUP_PARMNUM)
  509. #define USER_POSIX_ID_INFOLEVEL \
  510. (PARMNUM_BASE_INFOLEVEL + USER_POSIX_ID_PARMNUM)
  511. #define USER_HOME_DIR_DRIVE_INFOLEVEL \
  512. (PARMNUM_BASE_INFOLEVEL + USER_HOME_DIR_DRIVE_PARMNUM)
  513. //
  514. // For SetInfo call (parmnum 0) when password change not required
  515. //
  516. #define NULL_USERSETINFO_PASSWD " "
  517. #define TIMEQ_FOREVER ((unsigned long) -1L)
  518. #define USER_MAXSTORAGE_UNLIMITED ((unsigned long) -1L)
  519. #define USER_NO_LOGOFF ((unsigned long) -1L)
  520. #define UNITS_PER_DAY 24
  521. #define UNITS_PER_WEEK UNITS_PER_DAY * 7
  522. //
  523. // Privilege levels (USER_INFO_X field usriX_priv (X = 0/1)).
  524. //
  525. #define USER_PRIV_MASK 0x3
  526. #define USER_PRIV_GUEST 0
  527. #define USER_PRIV_USER 1
  528. #define USER_PRIV_ADMIN 2
  529. //
  530. // user modals related defaults
  531. //
  532. #define MAX_PASSWD_LEN PWLEN
  533. #define DEF_MIN_PWLEN 6
  534. #define DEF_PWUNIQUENESS 5
  535. #define DEF_MAX_PWHIST 8
  536. #define DEF_MAX_PWAGE TIMEQ_FOREVER // forever
  537. #define DEF_MIN_PWAGE (unsigned long) 0L // 0 days
  538. #define DEF_FORCE_LOGOFF (unsigned long) 0xffffffff // never
  539. #define DEF_MAX_BADPW 0 // no limit
  540. #define ONE_DAY (unsigned long) 01*24*3600 // 01 day
  541. //
  542. // User Logon Validation (codes returned)
  543. //
  544. #define VALIDATED_LOGON 0
  545. #define PASSWORD_EXPIRED 2
  546. #define NON_VALIDATED_LOGON 3
  547. #define VALID_LOGOFF 1
  548. //
  549. // parmnum manifests for user modals
  550. //
  551. #define MODALS_MIN_PASSWD_LEN_PARMNUM 1
  552. #define MODALS_MAX_PASSWD_AGE_PARMNUM 2
  553. #define MODALS_MIN_PASSWD_AGE_PARMNUM 3
  554. #define MODALS_FORCE_LOGOFF_PARMNUM 4
  555. #define MODALS_PASSWD_HIST_LEN_PARMNUM 5
  556. #define MODALS_ROLE_PARMNUM 6
  557. #define MODALS_PRIMARY_PARMNUM 7
  558. #define MODALS_DOMAIN_NAME_PARMNUM 8
  559. #define MODALS_DOMAIN_ID_PARMNUM 9
  560. #define MODALS_LOCKOUT_DURATION_PARMNUM 10
  561. #define MODALS_LOCKOUT_OBSERVATION_WINDOW_PARMNUM 11
  562. #define MODALS_LOCKOUT_THRESHOLD_PARMNUM 12
  563. //
  564. // the new infolevel counterparts of the old info level + parmnum
  565. //
  566. #define MODALS_MIN_PASSWD_LEN_INFOLEVEL \
  567. (PARMNUM_BASE_INFOLEVEL + MODALS_MIN_PASSWD_LEN_PARMNUM)
  568. #define MODALS_MAX_PASSWD_AGE_INFOLEVEL \
  569. (PARMNUM_BASE_INFOLEVEL + MODALS_MAX_PASSWD_AGE_PARMNUM)
  570. #define MODALS_MIN_PASSWD_AGE_INFOLEVEL \
  571. (PARMNUM_BASE_INFOLEVEL + MODALS_MIN_PASSWD_AGE_PARMNUM)
  572. #define MODALS_FORCE_LOGOFF_INFOLEVEL \
  573. (PARMNUM_BASE_INFOLEVEL + MODALS_FORCE_LOGOFF_PARMNUM)
  574. #define MODALS_PASSWD_HIST_LEN_INFOLEVEL \
  575. (PARMNUM_BASE_INFOLEVEL + MODALS_PASSWD_HIST_LEN_PARMNUM)
  576. #define MODALS_ROLE_INFOLEVEL \
  577. (PARMNUM_BASE_INFOLEVEL + MODALS_ROLE_PARMNUM)
  578. #define MODALS_PRIMARY_INFOLEVEL \
  579. (PARMNUM_BASE_INFOLEVEL + MODALS_PRIMARY_PARMNUM)
  580. #define MODALS_DOMAIN_NAME_INFOLEVEL \
  581. (PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_NAME_PARMNUM)
  582. #define MODALS_DOMAIN_ID_INFOLEVEL \
  583. (PARMNUM_BASE_INFOLEVEL + MODALS_DOMAIN_ID_PARMNUM)
  584. #endif // _LMUSER_
  585. //
  586. // Group Class
  587. //
  588. #ifndef _LMGROUP_
  589. #define _LMGROUP_
  590. //
  591. // Function Prototypes
  592. //
  593. NET_API_STATUS NET_API_FUNCTION
  594. NetGroupAdd (
  595. IN LPWSTR servername OPTIONAL,
  596. IN DWORD level,
  597. IN LPBYTE buf,
  598. OUT LPDWORD parm_err OPTIONAL
  599. );
  600. NET_API_STATUS NET_API_FUNCTION
  601. NetGroupAddUser (
  602. IN LPWSTR servername OPTIONAL,
  603. IN LPWSTR GroupName,
  604. IN LPWSTR username
  605. );
  606. NET_API_STATUS NET_API_FUNCTION
  607. NetGroupEnum (
  608. IN LPWSTR servername OPTIONAL,
  609. IN DWORD level,
  610. OUT LPBYTE *bufptr,
  611. IN DWORD prefmaxlen,
  612. OUT LPDWORD entriesread,
  613. OUT LPDWORD totalentries,
  614. IN OUT LPDWORD resume_handle OPTIONAL
  615. );
  616. NET_API_STATUS NET_API_FUNCTION
  617. NetGroupGetInfo (
  618. IN LPWSTR servername OPTIONAL,
  619. IN LPWSTR groupname,
  620. IN DWORD level,
  621. OUT LPBYTE *bufptr
  622. );
  623. NET_API_STATUS NET_API_FUNCTION
  624. NetGroupSetInfo (
  625. IN LPWSTR servername OPTIONAL,
  626. IN LPWSTR groupname,
  627. IN DWORD level,
  628. IN LPBYTE buf,
  629. OUT LPDWORD parm_err OPTIONAL
  630. );
  631. NET_API_STATUS NET_API_FUNCTION
  632. NetGroupDel (
  633. IN LPWSTR servername OPTIONAL,
  634. IN LPWSTR groupname
  635. );
  636. NET_API_STATUS NET_API_FUNCTION
  637. NetGroupDelUser (
  638. IN LPWSTR servername OPTIONAL,
  639. IN LPWSTR GroupName,
  640. IN LPWSTR Username
  641. );
  642. NET_API_STATUS NET_API_FUNCTION
  643. NetGroupGetUsers (
  644. IN LPWSTR servername OPTIONAL,
  645. IN LPWSTR groupname,
  646. IN DWORD level,
  647. OUT LPBYTE *bufptr,
  648. IN DWORD prefmaxlen,
  649. OUT LPDWORD entriesread,
  650. OUT LPDWORD totalentries,
  651. IN OUT LPDWORD ResumeHandle
  652. );
  653. NET_API_STATUS NET_API_FUNCTION
  654. NetGroupSetUsers (
  655. IN LPWSTR servername OPTIONAL,
  656. IN LPWSTR groupname,
  657. IN DWORD level,
  658. IN LPBYTE buf,
  659. IN DWORD totalentries
  660. );
  661. //
  662. // Data Structures - Group
  663. //
  664. typedef struct _GROUP_INFO_0 {
  665. LPWSTR grpi0_name;
  666. }GROUP_INFO_0, *PGROUP_INFO_0, *LPGROUP_INFO_0;
  667. typedef struct _GROUP_INFO_1 {
  668. LPWSTR grpi1_name;
  669. LPWSTR grpi1_comment;
  670. }GROUP_INFO_1, *PGROUP_INFO_1, *LPGROUP_INFO_1;
  671. typedef struct _GROUP_INFO_2 {
  672. LPWSTR grpi2_name;
  673. LPWSTR grpi2_comment;
  674. DWORD grpi2_group_id;
  675. DWORD grpi2_attributes;
  676. }GROUP_INFO_2, *PGROUP_INFO_2;
  677. typedef struct _GROUP_INFO_1002 {
  678. LPWSTR grpi1002_comment;
  679. } GROUP_INFO_1002, *PGROUP_INFO_1002, *LPGROUP_INFO_1002;
  680. typedef struct _GROUP_INFO_1005 {
  681. DWORD grpi1005_attributes;
  682. } GROUP_INFO_1005, *PGROUP_INFO_1005, *LPGROUP_INFO_1005;
  683. typedef struct _GROUP_USERS_INFO_0 {
  684. LPWSTR grui0_name;
  685. } GROUP_USERS_INFO_0, *PGROUP_USERS_INFO_0, *LPGROUP_USERS_INFO_0;
  686. typedef struct _GROUP_USERS_INFO_1 {
  687. LPWSTR grui1_name;
  688. DWORD grui1_attributes;
  689. } GROUP_USERS_INFO_1, *PGROUP_USERS_INFO_1, *LPGROUP_USERS_INFO_1;
  690. //
  691. // Special Values and Constants - Group
  692. //
  693. #define GROUPIDMASK 0x8000 // MSB set if uid refers
  694. // to a group
  695. //
  696. // Predefined group for all normal users, administrators and guests
  697. // LOCAL is a special group for pinball local security.
  698. //
  699. #define GROUP_SPECIALGRP_USERS L"USERS"
  700. #define GROUP_SPECIALGRP_ADMINS L"ADMINS"
  701. #define GROUP_SPECIALGRP_GUESTS L"GUESTS"
  702. #define GROUP_SPECIALGRP_LOCAL L"LOCAL"
  703. //
  704. // parmnum manifests for SetInfo calls (only comment is settable)
  705. //
  706. #define GROUP_ALL_PARMNUM 0
  707. #define GROUP_NAME_PARMNUM 1
  708. #define GROUP_COMMENT_PARMNUM 2
  709. #define GROUP_ATTRIBUTES_PARMNUM 3
  710. //
  711. // the new infolevel counterparts of the old info level + parmnum
  712. //
  713. #define GROUP_ALL_INFOLEVEL \
  714. (PARMNUM_BASE_INFOLEVEL + GROUP_ALL_PARMNUM)
  715. #define GROUP_NAME_INFOLEVEL \
  716. (PARMNUM_BASE_INFOLEVEL + GROUP_NAME_PARMNUM)
  717. #define GROUP_COMMENT_INFOLEVEL \
  718. (PARMNUM_BASE_INFOLEVEL + GROUP_COMMENT_PARMNUM)
  719. #define GROUP_ATTRIBUTES_INFOLEVEL \
  720. (PARMNUM_BASE_INFOLEVEL + GROUP_ATTRIBUTES_PARMNUM)
  721. #define GROUP_POSIX_ID_INFOLEVEL \
  722. (PARMNUM_BASE_INFOLEVEL + GROUP_POSIX_ID_PARMNUM)
  723. #endif // _LMGROUP_
  724. //
  725. // LocalGroup Class
  726. //
  727. #ifndef _LMLOCALGROUP_
  728. #define _LMLOCALGROUP_
  729. //
  730. // Function Prototypes
  731. //
  732. NET_API_STATUS NET_API_FUNCTION
  733. NetLocalGroupAdd (
  734. IN LPWSTR servername OPTIONAL,
  735. IN DWORD level,
  736. IN LPBYTE buf,
  737. OUT LPDWORD parm_err OPTIONAL
  738. );
  739. NET_API_STATUS NET_API_FUNCTION
  740. NetLocalGroupAddMember (
  741. IN LPWSTR servername OPTIONAL,
  742. IN LPWSTR groupname,
  743. IN PSID membersid
  744. );
  745. NET_API_STATUS NET_API_FUNCTION
  746. NetLocalGroupEnum (
  747. IN LPWSTR servername OPTIONAL,
  748. IN DWORD level,
  749. OUT LPBYTE *bufptr,
  750. IN DWORD prefmaxlen,
  751. OUT LPDWORD entriesread,
  752. OUT LPDWORD totalentries,
  753. IN OUT LPDWORD resumehandle OPTIONAL
  754. );
  755. NET_API_STATUS NET_API_FUNCTION
  756. NetLocalGroupGetInfo (
  757. IN LPWSTR servername OPTIONAL,
  758. IN LPWSTR groupname,
  759. IN DWORD level,
  760. OUT LPBYTE *bufptr
  761. );
  762. NET_API_STATUS NET_API_FUNCTION
  763. NetLocalGroupSetInfo (
  764. IN LPWSTR servername OPTIONAL,
  765. IN LPWSTR groupname,
  766. IN DWORD level,
  767. IN LPBYTE buf,
  768. OUT LPDWORD parm_err OPTIONAL
  769. );
  770. NET_API_STATUS NET_API_FUNCTION
  771. NetLocalGroupDel (
  772. IN LPWSTR servername OPTIONAL,
  773. IN LPWSTR groupname
  774. );
  775. NET_API_STATUS NET_API_FUNCTION
  776. NetLocalGroupDelMember (
  777. IN LPWSTR servername OPTIONAL,
  778. IN LPWSTR groupname,
  779. IN PSID membersid
  780. );
  781. NET_API_STATUS NET_API_FUNCTION
  782. NetLocalGroupGetMembers (
  783. IN LPWSTR servername OPTIONAL,
  784. IN LPWSTR localgroupname,
  785. IN DWORD level,
  786. OUT LPBYTE *bufptr,
  787. IN DWORD prefmaxlen,
  788. OUT LPDWORD entriesread,
  789. OUT LPDWORD totalentries,
  790. IN OUT LPDWORD resumehandle
  791. );
  792. NET_API_STATUS NET_API_FUNCTION
  793. NetLocalGroupSetMembers (
  794. IN LPWSTR servername OPTIONAL,
  795. IN LPWSTR groupname,
  796. IN DWORD level,
  797. IN LPBYTE buf,
  798. IN DWORD totalentries
  799. );
  800. NET_API_STATUS NET_API_FUNCTION
  801. NetLocalGroupAddMembers (
  802. IN LPWSTR servername OPTIONAL,
  803. IN LPWSTR groupname,
  804. IN DWORD level,
  805. IN LPBYTE buf,
  806. IN DWORD totalentries
  807. );
  808. NET_API_STATUS NET_API_FUNCTION
  809. NetLocalGroupDelMembers (
  810. IN LPWSTR servername OPTIONAL,
  811. IN LPWSTR groupname,
  812. IN DWORD level,
  813. IN LPBYTE buf,
  814. IN DWORD totalentries
  815. );
  816. //
  817. // Data Structures - LocalGroup
  818. //
  819. typedef struct _LOCALGROUP_INFO_0 {
  820. LPWSTR lgrpi0_name;
  821. }LOCALGROUP_INFO_0, *PLOCALGROUP_INFO_0, *LPLOCALGROUP_INFO_0;
  822. typedef struct _LOCALGROUP_INFO_1 {
  823. LPWSTR lgrpi1_name;
  824. LPWSTR lgrpi1_comment;
  825. }LOCALGROUP_INFO_1, *PLOCALGROUP_INFO_1, *LPLOCALGROUP_INFO_1;
  826. typedef struct _LOCALGROUP_INFO_1002 {
  827. LPWSTR lgrpi1002_comment;
  828. }LOCALGROUP_INFO_1002, *PLOCALGROUP_INFO_1002, *LPLOCALGROUP_INFO_1002;
  829. typedef struct _LOCALGROUP_MEMBERS_INFO_0 {
  830. PSID lgrmi0_sid;
  831. } LOCALGROUP_MEMBERS_INFO_0, *PLOCALGROUP_MEMBERS_INFO_0,
  832. *LPLOCALGROUP_MEMBERS_INFO_0;
  833. typedef struct _LOCALGROUP_MEMBERS_INFO_1 {
  834. PSID lgrmi1_sid;
  835. SID_NAME_USE lgrmi1_sidusage;
  836. LPWSTR lgrmi1_name;
  837. } LOCALGROUP_MEMBERS_INFO_1, *PLOCALGROUP_MEMBERS_INFO_1,
  838. *LPLOCALGROUP_MEMBERS_INFO_1;
  839. typedef struct _LOCALGROUP_MEMBERS_INFO_2 {
  840. PSID lgrmi2_sid;
  841. SID_NAME_USE lgrmi2_sidusage;
  842. LPWSTR lgrmi2_domainandname;
  843. } LOCALGROUP_MEMBERS_INFO_2, *PLOCALGROUP_MEMBERS_INFO_2,
  844. *LPLOCALGROUP_MEMBERS_INFO_2;
  845. typedef struct _LOCALGROUP_MEMBERS_INFO_3 {
  846. LPWSTR lgrmi3_domainandname;
  847. } LOCALGROUP_MEMBERS_INFO_3, *PLOCALGROUP_MEMBERS_INFO_3,
  848. *LPLOCALGROUP_MEMBERS_INFO_3;
  849. typedef struct _LOCALGROUP_USERS_INFO_0 {
  850. LPWSTR lgrui0_name;
  851. } LOCALGROUP_USERS_INFO_0, *PLOCALGROUP_USERS_INFO_0,
  852. *LPLOCALGROUP_USERS_INFO_0;
  853. #define LOCALGROUP_NAME_PARMNUM 1
  854. #define LOCALGROUP_COMMENT_PARMNUM 2
  855. //
  856. // Display Information APIs
  857. //
  858. NET_API_STATUS NET_API_FUNCTION
  859. NetQueryDisplayInformation(
  860. IN LPWSTR ServerName OPTIONAL,
  861. IN DWORD Level,
  862. IN DWORD Index,
  863. IN DWORD EntriesRequested,
  864. IN DWORD PreferredMaximumLength,
  865. OUT LPDWORD ReturnedEntryCount,
  866. OUT PVOID *SortedBuffer );
  867. NET_API_STATUS NET_API_FUNCTION
  868. NetGetDisplayInformationIndex(
  869. IN LPWSTR ServerName OPTIONAL,
  870. IN DWORD Level,
  871. IN LPWSTR Prefix,
  872. OUT LPDWORD Index );
  873. //
  874. // QueryDisplayInformation levels
  875. typedef struct _NET_DISPLAY_USER {
  876. LPWSTR usri1_name;
  877. LPWSTR usri1_comment;
  878. DWORD usri1_flags;
  879. LPWSTR usri1_full_name;
  880. DWORD usri1_user_id;
  881. DWORD usri1_next_index;
  882. } NET_DISPLAY_USER, *PNET_DISPLAY_USER;
  883. typedef struct _NET_DISPLAY_MACHINE {
  884. LPWSTR usri2_name;
  885. LPWSTR usri2_comment;
  886. DWORD usri2_flags;
  887. DWORD usri2_user_id;
  888. DWORD usri2_next_index;
  889. } NET_DISPLAY_MACHINE, *PNET_DISPLAY_MACHINE;
  890. typedef struct _NET_DISPLAY_GROUP {
  891. LPWSTR grpi3_name;
  892. LPWSTR grpi3_comment;
  893. DWORD grpi3_group_id;
  894. DWORD grpi3_attributes;
  895. DWORD grpi3_next_index;
  896. } NET_DISPLAY_GROUP, *PNET_DISPLAY_GROUP;
  897. #endif // _LMLOCALGROUP_
  898. //
  899. // Access Class
  900. //
  901. #ifndef _LMACCESS_
  902. #define _LMACCESS_
  903. //
  904. // Function Prototypes - Access
  905. //
  906. //
  907. // The NetAccess APIs are only available to downlevel
  908. //
  909. #define NetAccessAdd RxNetAccessAdd
  910. NET_API_STATUS NET_API_FUNCTION
  911. NetAccessAdd (
  912. IN LPTSTR servername OPTIONAL,
  913. IN DWORD level,
  914. IN LPBYTE buf,
  915. OUT LPDWORD parm_err OPTIONAL
  916. );
  917. #define NetAccessEnum RxNetAccessEnum
  918. NET_API_STATUS NET_API_FUNCTION
  919. NetAccessEnum (
  920. IN LPTSTR servername OPTIONAL,
  921. IN LPTSTR BasePath,
  922. IN DWORD Recursive,
  923. IN DWORD level,
  924. OUT LPBYTE *bufptr,
  925. IN DWORD prefmaxlen,
  926. OUT LPDWORD entriesread,
  927. OUT LPDWORD totalentries,
  928. IN OUT LPDWORD resume_handle OPTIONAL
  929. );
  930. #define NetAccessGetInfo RxNetAccessGetInfo
  931. NET_API_STATUS NET_API_FUNCTION
  932. NetAccessGetInfo (
  933. IN LPTSTR servername OPTIONAL,
  934. IN LPTSTR resource,
  935. IN DWORD level,
  936. OUT LPBYTE *bufptr
  937. );
  938. #define NetAccessSetInfo RxNetAccessSetInfo
  939. NET_API_STATUS NET_API_FUNCTION
  940. NetAccessSetInfo (
  941. IN LPTSTR servername OPTIONAL,
  942. IN LPTSTR resource,
  943. IN DWORD level,
  944. IN LPBYTE buf,
  945. OUT LPDWORD parm_err OPTIONAL
  946. );
  947. #define NetAccessDel RxNetAccessDel
  948. NET_API_STATUS NET_API_FUNCTION
  949. NetAccessDel (
  950. IN LPTSTR servername OPTIONAL,
  951. IN LPTSTR resource
  952. );
  953. #define NetAccessGetUserPerms RxNetAccessGetUserPerms
  954. NET_API_STATUS NET_API_FUNCTION
  955. NetAccessGetUserPerms (
  956. IN LPTSTR servername OPTIONAL,
  957. IN LPTSTR UGname,
  958. IN LPTSTR resource,
  959. OUT LPDWORD Perms
  960. );
  961. //
  962. // Data Structures - Access
  963. //
  964. typedef struct _ACCESS_INFO_0 {
  965. LPTSTR acc0_resource_name;
  966. }ACCESS_INFO_0, *PACCESS_INFO_0, *LPACCESS_INFO_0;
  967. typedef struct _ACCESS_INFO_1 {
  968. LPTSTR acc1_resource_name;
  969. DWORD acc1_attr;
  970. DWORD acc1_count;
  971. }ACCESS_INFO_1, *PACCESS_INFO_1, *LPACCESS_INFO_1;
  972. typedef struct _ACCESS_INFO_1002 {
  973. DWORD acc1002_attr;
  974. } ACCESS_INFO_1002, *PACCESS_INFO_1002, *LPACCESS_INFO_1002;
  975. typedef struct _ACCESS_LIST {
  976. LPTSTR acl_ugname;
  977. DWORD acl_access;
  978. }ACCESS_LIST, *PACCESS_LIST, *LPACCESS_LIST;
  979. //
  980. // Special Values and Constants - Access
  981. //
  982. //
  983. // Maximum number of permission entries for each resource.
  984. //
  985. #define MAXPERMENTRIES 64
  986. //
  987. // Bit values for the access permissions. ACCESS_ALL is a handy
  988. // way to specify maximum permissions. These are used in
  989. // acl_access field of access_list structures.
  990. //
  991. #define ACCESS_NONE 0
  992. #define ACCESS_ALL ( ACCESS_READ | \
  993. ACCESS_WRITE | \
  994. ACCESS_CREATE | \
  995. ACCESS_EXEC | \
  996. ACCESS_DELETE | \
  997. ACCESS_ATRIB | \
  998. ACCESS_PERM \
  999. )
  1000. #define ACCESS_READ 0x01
  1001. #define ACCESS_WRITE 0x02
  1002. #define ACCESS_CREATE 0x04
  1003. #define ACCESS_EXEC 0x08
  1004. #define ACCESS_DELETE 0x10
  1005. #define ACCESS_ATRIB 0x20
  1006. #define ACCESS_PERM 0x40
  1007. #define ACCESS_GROUP 0x8000
  1008. //
  1009. // Bit values for the acc1_attr field of the ACCESS_INFO_1 structure.
  1010. //
  1011. #define ACCESS_AUDIT 0x1
  1012. #define ACCESS_SUCCESS_OPEN 0x10
  1013. #define ACCESS_SUCCESS_WRITE 0x20
  1014. #define ACCESS_SUCCESS_DELETE 0x40
  1015. #define ACCESS_SUCCESS_ACL 0x80
  1016. #define ACCESS_SUCCESS_MASK 0xF0
  1017. #define ACCESS_FAIL_OPEN 0x100
  1018. #define ACCESS_FAIL_WRITE 0x200
  1019. #define ACCESS_FAIL_DELETE 0x400
  1020. #define ACCESS_FAIL_ACL 0x800
  1021. #define ACCESS_FAIL_MASK 0xF00
  1022. #define ACCESS_FAIL_SHIFT 4
  1023. //
  1024. // Parmnum value for NetAccessSetInfo.
  1025. //
  1026. #define ACCESS_RESOURCE_NAME_PARMNUM 1
  1027. #define ACCESS_ATTR_PARMNUM 2
  1028. #define ACCESS_COUNT_PARMNUM 3
  1029. #define ACCESS_ACCESS_LIST_PARMNUM 4
  1030. //
  1031. // the new infolevel counterparts of the old info level + parmnum
  1032. //
  1033. #define ACCESS_RESOURCE_NAME_INFOLEVEL \
  1034. (PARMNUM_BASE_INFOLEVEL + ACCESS_RESOURCE_NAME_PARMNUM)
  1035. #define ACCESS_ATTR_INFOLEVEL \
  1036. (PARMNUM_BASE_INFOLEVEL + ACCESS_ATTR_PARMNUM)
  1037. #define ACCESS_COUNT_INFOLEVEL \
  1038. (PARMNUM_BASE_INFOLEVEL + ACCESS_COUNT_PARMNUM)
  1039. #define ACCESS_ACCESS_LIST_INFOLEVEL \
  1040. (PARMNUM_BASE_INFOLEVEL + ACCESS_ACCESS_LIST_PARMNUM)
  1041. //
  1042. // ACCESS_LETTERS defines a letter for each bit position in
  1043. // the acl_access field of struct access_list. Note that some
  1044. // bits have a corresponding letter of ' ' (space).
  1045. //
  1046. #define ACCESS_LETTERS "RWCXDAP "
  1047. #endif // _LMACCESS_
  1048. //
  1049. // Domain Class
  1050. //
  1051. #ifndef _LMDOMAIN_
  1052. #define _LMDOMAIN_
  1053. //
  1054. // Function Prototypes - Domain
  1055. //
  1056. NET_API_STATUS NET_API_FUNCTION
  1057. NetGetDCName (
  1058. IN LPWSTR servername OPTIONAL,
  1059. IN LPWSTR domainname OPTIONAL,
  1060. OUT LPBYTE *bufptr
  1061. );
  1062. NET_API_STATUS NET_API_FUNCTION
  1063. NetGetAnyDCName (
  1064. IN LPWSTR servername OPTIONAL,
  1065. IN LPWSTR domainname OPTIONAL,
  1066. OUT LPBYTE *bufptr
  1067. );
  1068. NET_API_STATUS NET_API_FUNCTION
  1069. I_NetLogonControl(
  1070. IN LPWSTR ServerName OPTIONAL,
  1071. IN DWORD FunctionCode,
  1072. IN DWORD QueryLevel,
  1073. OUT LPBYTE *Buffer
  1074. );
  1075. NET_API_STATUS NET_API_FUNCTION
  1076. I_NetLogonControl2(
  1077. IN LPWSTR ServerName OPTIONAL,
  1078. IN DWORD FunctionCode,
  1079. IN DWORD QueryLevel,
  1080. IN LPBYTE Data,
  1081. OUT LPBYTE *Buffer
  1082. );
  1083. //
  1084. // Special Values and Constants - Domain
  1085. //
  1086. //
  1087. // FunctionCode values for I_NetLogonControl.
  1088. //
  1089. // NOTE : if you change the following NETLOGON_CONTROL_* values,
  1090. // change them in net\svcdlls\logonsrv\logon.idl file also.
  1091. //
  1092. #define NETLOGON_CONTROL_QUERY 1 // No-op: just query
  1093. #define NETLOGON_CONTROL_REPLICATE 2 // Force replicate on BDC
  1094. #define NETLOGON_CONTROL_SYNCHRONIZE 3 // Force synchronize on BDC
  1095. #define NETLOGON_CONTROL_PDC_REPLICATE 4 // Force PDC to broadcast change
  1096. #define NETLOGON_CONTROL_REDISCOVER 5 // Force to re-discover trusted domain DCs
  1097. #define NETLOGON_CONTROL_TC_QUERY 6 // Query status of specified trusted channel status
  1098. // Debug function codes
  1099. #define NETLOGON_CONTROL_BACKUP_CHANGE_LOG 0xFFFC
  1100. #define NETLOGON_CONTROL_TRUNCATE_LOG 0xFFFD
  1101. #define NETLOGON_CONTROL_SET_DBFLAG 0xFFFE
  1102. #define NETLOGON_CONTROL_BREAKPOINT 0xFFFF
  1103. //
  1104. // Query level 1 for I_NetLogonControl
  1105. //
  1106. typedef struct _NETLOGON_INFO_1 {
  1107. DWORD netlog1_flags;
  1108. NET_API_STATUS netlog1_pdc_connection_status;
  1109. } NETLOGON_INFO_1, *PNETLOGON_INFO_1;
  1110. typedef struct _NETLOGON_INFO_2 {
  1111. DWORD netlog2_flags;
  1112. NET_API_STATUS netlog2_pdc_connection_status;
  1113. #ifdef MIDL_PASS
  1114. [string] wchar_t * netlog2_trusted_dc_name;
  1115. #else
  1116. LPWSTR netlog2_trusted_dc_name;
  1117. #endif // MIDL_PASS
  1118. NET_API_STATUS netlog2_tc_connection_status;
  1119. } NETLOGON_INFO_2, *PNETLOGON_INFO_2;
  1120. typedef struct _NETLOGON_INFO_3 {
  1121. DWORD netlog3_flags;
  1122. DWORD netlog3_logon_attempts;
  1123. DWORD netlog3_reserved1;
  1124. DWORD netlog3_reserved2;
  1125. DWORD netlog3_reserved3;
  1126. DWORD netlog3_reserved4;
  1127. DWORD netlog3_reserved5;
  1128. } NETLOGON_INFO_3, *PNETLOGON_INFO_3;
  1129. //
  1130. // Values of netlog1_flags
  1131. //
  1132. #define NETLOGON_REPLICATION_NEEDED 0x01 // Database is out of date
  1133. #define NETLOGON_REPLICATION_IN_PROGRESS 0x02 // Replication is happening now
  1134. #define NETLOGON_FULL_SYNC_REPLICATION 0x04 // full sync replication required/progress
  1135. #define NETLOGON_REDO_NEEDED 0x08 // Redo of previous replication needed
  1136. #ifdef __cplusplus
  1137. }
  1138. #endif
  1139. #endif // _LMDOMAIN_