2 * Copyright 2002 Andriy Palamarchuk
4 * User information Net API.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_LMACCESS_H
22 #define __WINE_LMACCESS_H
30 #define UF_SCRIPT 0x000001
31 #define UF_ACCOUNTDISABLE 0x000002
32 #define UF_HOMEDIR_REQUIRED 0x000008
33 #define UF_LOCKOUT 0x000010
34 #define UF_PASSWD_NOTREQD 0x000020
35 #define UF_PASSWD_CANT_CHANGE 0x000040
36 #define UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED 0x000080
37 #define UF_TEMP_DUPLICATE_ACCOUNT 0x000100
38 #define UF_NORMAL_ACCOUNT 0x000200
39 #define UF_INTERDOMAIN_TRUST_ACCOUNT 0x000800
40 #define UF_WORKSTATION_TRUST_ACCOUNT 0x001000
41 #define UF_SERVER_TRUST_ACCOUNT 0x002000
42 #define UF_DONT_EXPIRE_PASSWD 0x010000
43 #define UF_MNS_LOGON_ACCOUNT 0x020000
44 #define UF_SMARTCARD_REQUIRED 0x040000
45 #define UF_TRUSTED_FOR_DELEGATION 0x080000
46 #define UF_NOT_DELEGATED 0x100000
47 #define UF_USE_DES_KEY_ONLY 0x200000
48 #define UF_DONT_REQUIRE_PREAUTH 0x400000
49 #define UF_PASSWORD_EXPIRED 0x800000
52 #define UF_MACHINE_ACCOUNT_MASK ( \
53 UF_INTERDOMAIN_TRUST_ACCOUNT | \
54 UF_WORKSTATION_TRUST_ACCOUNT | \
55 UF_SERVER_TRUST_ACCOUNT)
57 #define UF_ACCOUNT_TYPE_MASK ( \
58 UF_TEMP_DUPLICATE_ACCOUNT | \
60 UF_INTERDOMAIN_TRUST_ACCOUNT | \
61 UF_WORKSTATION_TRUST_ACCOUNT | \
62 UF_SERVER_TRUST_ACCOUNT)
64 #define UF_SETTABLE_BITS ( \
68 UF_HOMEDIR_REQUIRED | \
70 UF_PASSWD_CANT_CHANGE | \
71 UF_ACCOUNT_TYPE_MASK | \
72 UF_DONT_EXPIRE_PASSWD | \
73 UF_MNS_LOGON_ACCOUNT |\
74 UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED |\
75 UF_SMARTCARD_REQUIRED | \
76 UF_TRUSTED_FOR_DELEGATION | \
78 UF_USE_DES_KEY_ONLY | \
79 UF_DONT_REQUIRE_PREAUTH |\
83 # define GROUP_SPECIALGRP_USERS (const WCHAR []){ 'U','S','E','R','S',0 }
84 #elif defined(_MSC_VER)
85 # define GROUP_SPECIALGRP_USERS L"USERS"
87 static const WCHAR GROUP_SPECIALGRP_USERS
[] = { 'U','S','E','R','S',0 };
91 # define GROUP_SPECIALGRP_ADMINS (const WCHAR []){ 'A','D','M','I','N','S',0 }
92 #elif defined(_MSC_VER)
93 # define GROUP_SPECIALGRP_ADMINS L"ADMINS"
95 static const WCHAR GROUP_SPECIALGRP_ADMINS
[] = { 'A','D','M','I','N','S',0 };
99 # define GROUP_SPECIALGRP_GUESTS (const WCHAR []){ 'G','U','E','S','T','S',0 }
100 #elif defined(_MSC_VER)
101 # define GROUP_SPECIALGRP_GUESTS L"GUESTS"
103 static const WCHAR GROUP_SPECIALGRP_GUESTS
[] = { 'G','U','E','S','T','S',0 };
106 #if defined(__GNUC__)
107 # define GROUP_SPECIALGRP_LOCAL (const WCHAR []){ 'L','O','C','A','L',0 }
108 #elif defined(_MSC_VER)
109 # define GROUP_SPECIALGRP_LOCAL L"LOCAL"
111 static const WCHAR GROUP_SPECIALGRP_LOCAL
[] = { 'L','O','C','A','L',0 };
114 /* NetGetUserInfo structures */
115 typedef struct _USER_INFO_0
{
117 } USER_INFO_0
, *PUSER_INFO_0
, *LPUSER_INFO_0
;
119 typedef struct _USER_INFO_1
{
121 LPWSTR usri1_password
;
122 DWORD usri1_password_age
;
124 LPWSTR usri1_home_dir
;
125 LPWSTR usri1_comment
;
127 LPWSTR usri1_script_path
;
128 } USER_INFO_1
, *PUSER_INFO_1
, *LPUSER_INFO_1
;
130 typedef struct _USER_INFO_2
{
132 LPWSTR usri2_password
;
133 DWORD usri2_password_age
;
135 LPWSTR usri2_home_dir
;
136 LPWSTR usri2_comment
;
138 LPWSTR usri2_script_path
;
139 DWORD usri2_auth_flags
;
140 LPWSTR usri2_full_name
;
141 LPWSTR usri2_usr_comment
;
143 LPWSTR usri2_workstations
;
144 DWORD usri2_last_logon
;
145 DWORD usri2_last_logoff
;
146 DWORD usri2_acct_expires
;
147 DWORD usri2_max_storage
;
148 DWORD usri2_units_per_week
;
149 PBYTE usri2_logon_hours
;
150 DWORD usri2_bad_pw_count
;
151 DWORD usri2_num_logons
;
152 LPWSTR usri2_logon_server
;
153 DWORD usri2_country_code
;
154 DWORD usri2_code_page
;
155 } USER_INFO_2
, *PUSER_INFO_2
, *LPUSER_INFO_2
;
157 typedef struct _USER_INFO_3
{
159 LPWSTR usri3_password
;
160 DWORD usri3_password_age
;
162 LPWSTR usri3_home_dir
;
163 LPWSTR usri3_comment
;
165 LPWSTR usri3_script_path
;
166 DWORD usri3_auth_flags
;
167 LPWSTR usri3_full_name
;
168 LPWSTR usri3_usr_comment
;
170 LPWSTR usri3_workstations
;
171 DWORD usri3_last_logon
;
172 DWORD usri3_last_logoff
;
173 DWORD usri3_acct_expires
;
174 DWORD usri3_max_storage
;
175 DWORD usri3_units_per_week
;
176 PBYTE usri3_logon_hours
;
177 DWORD usri3_bad_pw_count
;
178 DWORD usri3_num_logons
;
179 LPWSTR usri3_logon_server
;
180 DWORD usri3_country_code
;
181 DWORD usri3_code_page
;
183 DWORD usri3_primary_group_id
;
184 LPWSTR usri3_profile
;
185 LPWSTR usri3_home_dir_drive
;
186 DWORD usri3_password_expired
;
187 } USER_INFO_3
, *PUSER_INFO_3
, *LPUSER_INFO_3
;
189 typedef struct _USER_INFO_4
{
191 LPWSTR usri4_password
;
192 DWORD usri4_password_age
;
194 LPWSTR usri4_home_dir
;
195 LPWSTR usri4_comment
;
197 LPWSTR usri4_script_path
;
198 DWORD usri4_auth_flags
;
199 LPWSTR usri4_full_name
;
200 LPWSTR usri4_usr_comment
;
202 LPWSTR usri4_workstations
;
203 DWORD usri4_last_logon
;
204 DWORD usri4_last_logoff
;
205 DWORD usri4_acct_expires
;
206 DWORD usri4_max_storage
;
207 DWORD usri4_units_per_week
;
208 PBYTE usri4_logon_hours
;
209 DWORD usri4_bad_pw_count
;
210 DWORD usri4_num_logons
;
211 LPWSTR usri4_logon_server
;
212 DWORD usri4_country_code
;
213 DWORD usri4_code_page
;
215 DWORD usri4_primary_group_id
;
216 LPWSTR usri4_profile
;
217 LPWSTR usri4_home_dir_drive
;
218 DWORD usri4_password_expired
;
219 } USER_INFO_4
, *PUSER_INFO_4
, *LPUSER_INFO_4
;
221 typedef struct _USER_INFO_10
{
223 LPWSTR usri10_comment
;
224 LPWSTR usri10_usr_comment
;
225 LPWSTR usri10_full_name
;
226 } USER_INFO_10
, *PUSER_INFO_10
, *LPUSER_INFO_10
;
228 typedef struct _USER_INFO_11
{
230 LPWSTR usri11_comment
;
231 LPWSTR usri11_usr_comment
;
232 LPWSTR usri11_full_name
;
234 DWORD usri11_auth_flags
;
235 DWORD usri11_password_age
;
236 LPWSTR usri11_home_dir
;
238 DWORD usri11_last_logon
;
239 DWORD usri11_last_logoff
;
240 DWORD usri11_bad_pw_count
;
241 DWORD usri11_num_logons
;
242 LPWSTR usri11_logon_server
;
243 DWORD usri11_country_code
;
244 LPWSTR usri11_workstations
;
245 DWORD usri11_max_storage
;
246 DWORD usri11_units_per_week
;
247 PBYTE usri11_logon_hours
;
248 DWORD usri11_code_page
;
249 } USER_INFO_11
, *PUSER_INFO_11
, *LPUSER_INFO_11
;
251 typedef struct _USER_INFO_20
{
253 LPWSTR usri20_full_name
;
254 LPWSTR usri20_comment
;
256 DWORD usri20_user_id
;
257 } USER_INFO_20
, *PUSER_INFO_20
, *LPUSER_INFO_20
;
259 typedef struct _USER_INFO_23
{
261 LPWSTR usri23_full_name
;
262 LPWSTR usri23_comment
;
264 PSID usri23_user_sid
;
265 } USER_INFO_23
, *PUSER_INFO_23
, *LPUSER_INFO_23
;
267 typedef struct _USER_INFO_1003
{
268 LPWSTR usri1003_password
;
269 } USER_INFO_1003
, *PUSER_INFO_1003
, *LPUSER_INFO_1003
;
271 typedef struct _USER_INFO_1005
{
273 } USER_INFO_1005
, *PUSER_INFO_1005
, *LPUSER_INFO_1005
;
275 typedef struct _USER_INFO_1006
{
276 LPWSTR usri1006_home_dir
;
277 } USER_INFO_1006
, *PUSER_INFO_1006
, *LPUSER_INFO_1006
;
279 typedef struct _USER_INFO_1007
{
280 LPWSTR usri1007_comment
;
281 } 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
;
287 typedef struct _USER_INFO_1009
{
288 LPWSTR usri1009_script_path
;
289 } USER_INFO_1009
, *PUSER_INFO_1009
, *LPUSER_INFO_1009
;
291 typedef struct _USER_INFO_1010
{
292 DWORD usri1010_auth_flags
;
293 } USER_INFO_1010
, *PUSER_INFO_1010
, *LPUSER_INFO_1010
;
295 typedef struct _USER_INFO_1011
{
296 LPWSTR usri1011_full_name
;
297 } USER_INFO_1011
, *PUSER_INFO_1011
, *LPUSER_INFO_1011
;
299 typedef struct _USER_INFO_1012
{
300 LPWSTR usri1012_usr_comment
;
301 } USER_INFO_1012
, *PUSER_INFO_1012
, *LPUSER_INFO_1012
;
303 typedef struct _USER_INFO_1013
{
304 LPWSTR usri1013_parms
;
305 } USER_INFO_1013
, *PUSER_INFO_1013
, *LPUSER_INFO_1013
;
307 typedef struct _USER_INFO_1014
{
308 LPWSTR usri1014_workstations
;
309 } USER_INFO_1014
, *PUSER_INFO_1014
, *LPUSER_INFO_1014
;
311 typedef struct _USER_INFO_1017
{
312 DWORD usri1017_acct_expires
;
313 } USER_INFO_1017
, *PUSER_INFO_1017
, *LPUSER_INFO_1017
;
315 typedef struct _USER_INFO_1018
{
316 DWORD usri1018_max_storage
;
317 } USER_INFO_1018
, *PUSER_INFO_1018
, *LPUSER_INFO_1018
;
319 typedef struct _USER_INFO_1020
{
320 DWORD usri1020_units_per_week
;
321 LPBYTE usri1020_logon_hours
;
322 } USER_INFO_1020
, *PUSER_INFO_1020
, *LPUSER_INFO_1020
;
324 typedef struct _USER_INFO_1023
{
325 LPWSTR usri1023_logon_server
;
326 } USER_INFO_1023
, *PUSER_INFO_1023
, *LPUSER_INFO_1023
;
328 typedef struct _USER_INFO_1024
{
329 DWORD usri1024_country_code
;
330 } USER_INFO_1024
, *PUSER_INFO_1024
, *LPUSER_INFO_1024
;
332 typedef struct _USER_INFO_1025
{
333 DWORD usri1025_code_page
;
334 } USER_INFO_1025
, *PUSER_INFO_1025
, *LPUSER_INFO_1025
;
336 typedef struct _USER_INFO_1051
{
337 DWORD usri1051_primary_group_id
;
338 } USER_INFO_1051
, *PUSER_INFO_1051
, *LPUSER_INFO_1051
;
340 typedef struct _USER_INFO_1052
{
341 LPWSTR usri1052_profile
;
342 } USER_INFO_1052
, *PUSER_INFO_1052
, *LPUSER_INFO_1052
;
344 typedef struct _USER_INFO_1053
{
345 LPWSTR usri1053_home_dir_drive
;
346 } USER_INFO_1053
, *PUSER_INFO_1053
, *LPUSER_INFO_1053
;
348 typedef struct _USER_MODALS_INFO_0
{
349 DWORD usrmod0_min_passwd_len
;
350 DWORD usrmod0_max_passwd_age
;
351 DWORD usrmod0_min_passwd_age
;
352 DWORD usrmod0_force_logoff
;
353 DWORD usrmod0_password_hist_len
;
354 } USER_MODALS_INFO_0
, *PUSER_MODALS_INFO_0
, *LPUSER_MODALS_INFO_0
;
356 typedef struct _USER_MODALS_INFO_1
{
358 LPWSTR usrmod1_primary
;
359 } USER_MODALS_INFO_1
, *PUSER_MODALS_INFO_1
, *LPUSER_MODALS_INFO_1
;
361 typedef struct _USER_MODALS_INFO_2
{
362 LPWSTR usrmod2_domain_name
;
363 PSID usrmod2_domain_id
;
364 } USER_MODALS_INFO_2
, *PUSER_MODALS_INFO_2
, *LPUSER_MODALS_INFO_2
;
366 typedef struct _USER_MODALS_INFO_3
{
367 DWORD usrmod3_lockout_duration
;
368 DWORD usrmod3_lockout_observation_window
;
369 DWORD usrmod3_lockout_threshold
;
370 } USER_MODALS_INFO_3
, *PUSER_MODALS_INFO_3
, *LPUSER_MODALS_INFO_3
;
372 typedef struct _NET_DISPLAY_USER
{
374 LPWSTR usri1_comment
;
376 LPWSTR usri1_full_name
;
378 DWORD usri1_next_index
;
379 } NET_DISPLAY_USER
, *PNET_DISPLAY_USER
;
381 typedef struct _NET_DISPLAY_MACHINE
{
383 LPWSTR usri2_comment
;
386 DWORD usri2_next_index
;
387 } NET_DISPLAY_MACHINE
, *PNET_DISPLAY_MACHINE
;
389 typedef struct _NET_DISPLAY_GROUP
{
391 LPWSTR grpi3_comment
;
392 DWORD grpi3_group_id
;
393 DWORD grpi3_attributes
;
394 DWORD grpi3_next_index
;
395 } NET_DISPLAY_GROUP
, *PNET_DISPLAY_GROUP
;
397 NET_API_STATUS WINAPI
NetUserGetInfo(LPCWSTR servername
, LPCWSTR username
,
398 DWORD level
, LPBYTE
* bufptr
);
400 NET_API_STATUS WINAPI
NetQueryDisplayInformation(
401 LPWSTR ServerName
, DWORD Level
, DWORD Index
, DWORD EntriesRequested
,
402 DWORD PreferredMaximumLength
, LPDWORD ReturnedEntryCount
,
403 PVOID
*SortedBuffer
);