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.

1318 lines
36 KiB

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