source: trunk/include/lmaccess.h@ 21393

Last change on this file since 21393 was 21368, checked in by vladest, 16 years ago
  • Added headers, required for secur32 building
File size: 15.2 KB
Line 
1/*
2 * Copyright 2002 Andriy Palamarchuk
3 *
4 * User information Net API.
5 *
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.
10 *
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.
15 *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#ifndef __WINE_LMACCESS_H
22#define __WINE_LMACCESS_H
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28#include <lmcons.h>
29
30
31#define UF_SCRIPT 0x000001
32#define UF_ACCOUNTDISABLE 0x000002
33#define UF_HOMEDIR_REQUIRED 0x000008
34#define UF_LOCKOUT 0x000010
35#define UF_PASSWD_NOTREQD 0x000020
36#define UF_PASSWD_CANT_CHANGE 0x000040
37#define UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED 0x000080
38#define UF_TEMP_DUPLICATE_ACCOUNT 0x000100
39#define UF_NORMAL_ACCOUNT 0x000200
40#define UF_INTERDOMAIN_TRUST_ACCOUNT 0x000800
41#define UF_WORKSTATION_TRUST_ACCOUNT 0x001000
42#define UF_SERVER_TRUST_ACCOUNT 0x002000
43#define UF_DONT_EXPIRE_PASSWD 0x010000
44#define UF_MNS_LOGON_ACCOUNT 0x020000
45#define UF_SMARTCARD_REQUIRED 0x040000
46#define UF_TRUSTED_FOR_DELEGATION 0x080000
47#define UF_NOT_DELEGATED 0x100000
48#define UF_USE_DES_KEY_ONLY 0x200000
49#define UF_DONT_REQUIRE_PREAUTH 0x400000
50#define UF_PASSWORD_EXPIRED 0x800000
51
52
53#define UF_MACHINE_ACCOUNT_MASK ( \
54 UF_INTERDOMAIN_TRUST_ACCOUNT | \
55 UF_WORKSTATION_TRUST_ACCOUNT | \
56 UF_SERVER_TRUST_ACCOUNT)
57
58#define UF_ACCOUNT_TYPE_MASK ( \
59 UF_TEMP_DUPLICATE_ACCOUNT | \
60 UF_NORMAL_ACCOUNT | \
61 UF_INTERDOMAIN_TRUST_ACCOUNT | \
62 UF_WORKSTATION_TRUST_ACCOUNT | \
63 UF_SERVER_TRUST_ACCOUNT)
64
65#define UF_SETTABLE_BITS ( \
66 UF_SCRIPT | \
67 UF_ACCOUNTDISABLE | \
68 UF_LOCKOUT | \
69 UF_HOMEDIR_REQUIRED | \
70 UF_PASSWD_NOTREQD | \
71 UF_PASSWD_CANT_CHANGE | \
72 UF_ACCOUNT_TYPE_MASK | \
73 UF_DONT_EXPIRE_PASSWD | \
74 UF_MNS_LOGON_ACCOUNT |\
75 UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED |\
76 UF_SMARTCARD_REQUIRED | \
77 UF_TRUSTED_FOR_DELEGATION | \
78 UF_NOT_DELEGATED | \
79 UF_USE_DES_KEY_ONLY | \
80 UF_DONT_REQUIRE_PREAUTH |\
81 UF_PASSWORD_EXPIRED)
82
83#if defined(__GNUC__)
84# define GROUP_SPECIALGRP_USERS (const WCHAR []){ 'U','S','E','R','S',0 }
85#elif defined(_MSC_VER)
86# define GROUP_SPECIALGRP_USERS L"USERS"
87#else
88static const WCHAR GROUP_SPECIALGRP_USERS[] = { 'U','S','E','R','S',0 };
89#endif
90
91#if defined(__GNUC__)
92# define GROUP_SPECIALGRP_ADMINS (const WCHAR []){ 'A','D','M','I','N','S',0 }
93#elif defined(_MSC_VER)
94# define GROUP_SPECIALGRP_ADMINS L"ADMINS"
95#else
96static const WCHAR GROUP_SPECIALGRP_ADMINS[] = { 'A','D','M','I','N','S',0 };
97#endif
98
99#if defined(__GNUC__)
100# define GROUP_SPECIALGRP_GUESTS (const WCHAR []){ 'G','U','E','S','T','S',0 }
101#elif defined(_MSC_VER)
102# define GROUP_SPECIALGRP_GUESTS L"GUESTS"
103#else
104static const WCHAR GROUP_SPECIALGRP_GUESTS[] = { 'G','U','E','S','T','S',0 };
105#endif
106
107#if defined(__GNUC__)
108# define GROUP_SPECIALGRP_LOCAL (const WCHAR []){ 'L','O','C','A','L',0 }
109#elif defined(_MSC_VER)
110# define GROUP_SPECIALGRP_LOCAL L"LOCAL"
111#else
112static const WCHAR GROUP_SPECIALGRP_LOCAL[] = { 'L','O','C','A','L',0 };
113#endif
114
115#ifndef WINE_NTSTATUS_DECLARED
116#define WINE_NTSTATUS_DECLARED
117typedef LONG NTSTATUS;
118#endif
119#ifndef WINE_PNTSTATUS_DECLARED
120#define WINE_PNTSTATUS_DECLARED
121typedef NTSTATUS *PNTSTATUS;
122#endif
123
124/* NetGetUserInfo structures */
125typedef struct _USER_INFO_0 {
126 LPWSTR usri0_name;
127} USER_INFO_0, *PUSER_INFO_0, *LPUSER_INFO_0;
128
129typedef struct _USER_INFO_1 {
130 LPWSTR usri1_name;
131 LPWSTR usri1_password;
132 DWORD usri1_password_age;
133 DWORD usri1_priv;
134 LPWSTR usri1_home_dir;
135 LPWSTR usri1_comment;
136 DWORD usri1_flags;
137 LPWSTR usri1_script_path;
138} USER_INFO_1, *PUSER_INFO_1, *LPUSER_INFO_1;
139
140typedef struct _USER_INFO_2 {
141 LPWSTR usri2_name;
142 LPWSTR usri2_password;
143 DWORD usri2_password_age;
144 DWORD usri2_priv;
145 LPWSTR usri2_home_dir;
146 LPWSTR usri2_comment;
147 DWORD usri2_flags;
148 LPWSTR usri2_script_path;
149 DWORD usri2_auth_flags;
150 LPWSTR usri2_full_name;
151 LPWSTR usri2_usr_comment;
152 LPWSTR usri2_parms;
153 LPWSTR usri2_workstations;
154 DWORD usri2_last_logon;
155 DWORD usri2_last_logoff;
156 DWORD usri2_acct_expires;
157 DWORD usri2_max_storage;
158 DWORD usri2_units_per_week;
159 PBYTE usri2_logon_hours;
160 DWORD usri2_bad_pw_count;
161 DWORD usri2_num_logons;
162 LPWSTR usri2_logon_server;
163 DWORD usri2_country_code;
164 DWORD usri2_code_page;
165} USER_INFO_2, *PUSER_INFO_2, *LPUSER_INFO_2;
166
167typedef struct _USER_INFO_3 {
168 LPWSTR usri3_name;
169 LPWSTR usri3_password;
170 DWORD usri3_password_age;
171 DWORD usri3_priv;
172 LPWSTR usri3_home_dir;
173 LPWSTR usri3_comment;
174 DWORD usri3_flags;
175 LPWSTR usri3_script_path;
176 DWORD usri3_auth_flags;
177 LPWSTR usri3_full_name;
178 LPWSTR usri3_usr_comment;
179 LPWSTR usri3_parms;
180 LPWSTR usri3_workstations;
181 DWORD usri3_last_logon;
182 DWORD usri3_last_logoff;
183 DWORD usri3_acct_expires;
184 DWORD usri3_max_storage;
185 DWORD usri3_units_per_week;
186 PBYTE usri3_logon_hours;
187 DWORD usri3_bad_pw_count;
188 DWORD usri3_num_logons;
189 LPWSTR usri3_logon_server;
190 DWORD usri3_country_code;
191 DWORD usri3_code_page;
192 DWORD usri3_user_id;
193 DWORD usri3_primary_group_id;
194 LPWSTR usri3_profile;
195 LPWSTR usri3_home_dir_drive;
196 DWORD usri3_password_expired;
197} USER_INFO_3, *PUSER_INFO_3, *LPUSER_INFO_3;
198
199typedef struct _USER_INFO_4 {
200 LPWSTR usri4_name;
201 LPWSTR usri4_password;
202 DWORD usri4_password_age;
203 DWORD usri4_priv;
204 LPWSTR usri4_home_dir;
205 LPWSTR usri4_comment;
206 DWORD usri4_flags;
207 LPWSTR usri4_script_path;
208 DWORD usri4_auth_flags;
209 LPWSTR usri4_full_name;
210 LPWSTR usri4_usr_comment;
211 LPWSTR usri4_parms;
212 LPWSTR usri4_workstations;
213 DWORD usri4_last_logon;
214 DWORD usri4_last_logoff;
215 DWORD usri4_acct_expires;
216 DWORD usri4_max_storage;
217 DWORD usri4_units_per_week;
218 PBYTE usri4_logon_hours;
219 DWORD usri4_bad_pw_count;
220 DWORD usri4_num_logons;
221 LPWSTR usri4_logon_server;
222 DWORD usri4_country_code;
223 DWORD usri4_code_page;
224 PSID usri4_user_sid;
225 DWORD usri4_primary_group_id;
226 LPWSTR usri4_profile;
227 LPWSTR usri4_home_dir_drive;
228 DWORD usri4_password_expired;
229} USER_INFO_4, *PUSER_INFO_4, *LPUSER_INFO_4;
230
231typedef struct _USER_INFO_10 {
232 LPWSTR usri10_name;
233 LPWSTR usri10_comment;
234 LPWSTR usri10_usr_comment;
235 LPWSTR usri10_full_name;
236} USER_INFO_10, *PUSER_INFO_10, *LPUSER_INFO_10;
237
238typedef struct _USER_INFO_11 {
239 LPWSTR usri11_name;
240 LPWSTR usri11_comment;
241 LPWSTR usri11_usr_comment;
242 LPWSTR usri11_full_name;
243 DWORD usri11_priv;
244 DWORD usri11_auth_flags;
245 DWORD usri11_password_age;
246 LPWSTR usri11_home_dir;
247 LPWSTR usri11_parms;
248 DWORD usri11_last_logon;
249 DWORD usri11_last_logoff;
250 DWORD usri11_bad_pw_count;
251 DWORD usri11_num_logons;
252 LPWSTR usri11_logon_server;
253 DWORD usri11_country_code;
254 LPWSTR usri11_workstations;
255 DWORD usri11_max_storage;
256 DWORD usri11_units_per_week;
257 PBYTE usri11_logon_hours;
258 DWORD usri11_code_page;
259} USER_INFO_11, *PUSER_INFO_11, *LPUSER_INFO_11;
260
261typedef struct _USER_INFO_20 {
262 LPWSTR usri20_name;
263 LPWSTR usri20_full_name;
264 LPWSTR usri20_comment;
265 DWORD usri20_flags;
266 DWORD usri20_user_id;
267} USER_INFO_20, *PUSER_INFO_20, *LPUSER_INFO_20;
268
269typedef struct _USER_INFO_23 {
270 LPWSTR usri23_name;
271 LPWSTR usri23_full_name;
272 LPWSTR usri23_comment;
273 DWORD usri23_flags;
274 PSID usri23_user_sid;
275} USER_INFO_23, *PUSER_INFO_23, *LPUSER_INFO_23;
276
277typedef struct _USER_INFO_1003 {
278 LPWSTR usri1003_password;
279} USER_INFO_1003, *PUSER_INFO_1003, *LPUSER_INFO_1003;
280
281typedef struct _USER_INFO_1005 {
282 DWORD usri1005_priv;
283} USER_INFO_1005, *PUSER_INFO_1005, *LPUSER_INFO_1005;
284
285typedef struct _USER_INFO_1006 {
286 LPWSTR usri1006_home_dir;
287} USER_INFO_1006, *PUSER_INFO_1006, *LPUSER_INFO_1006;
288
289typedef struct _USER_INFO_1007 {
290 LPWSTR usri1007_comment;
291} USER_INFO_1007, *PUSER_INFO_1007, *LPUSER_INFO_1007;
292
293typedef struct _USER_INFO_1008 {
294 DWORD usri1008_flags;
295} USER_INFO_1008, *PUSER_INFO_1008, *LPUSER_INFO_1008;
296
297typedef struct _USER_INFO_1009 {
298 LPWSTR usri1009_script_path;
299} USER_INFO_1009, *PUSER_INFO_1009, *LPUSER_INFO_1009;
300
301typedef struct _USER_INFO_1010 {
302 DWORD usri1010_auth_flags;
303} USER_INFO_1010, *PUSER_INFO_1010, *LPUSER_INFO_1010;
304
305typedef struct _USER_INFO_1011 {
306 LPWSTR usri1011_full_name;
307} USER_INFO_1011, *PUSER_INFO_1011, *LPUSER_INFO_1011;
308
309typedef struct _USER_INFO_1012 {
310 LPWSTR usri1012_usr_comment;
311} USER_INFO_1012, *PUSER_INFO_1012, *LPUSER_INFO_1012;
312
313typedef struct _USER_INFO_1013 {
314 LPWSTR usri1013_parms;
315} USER_INFO_1013, *PUSER_INFO_1013, *LPUSER_INFO_1013;
316
317typedef struct _USER_INFO_1014 {
318 LPWSTR usri1014_workstations;
319} USER_INFO_1014, *PUSER_INFO_1014, *LPUSER_INFO_1014;
320
321typedef struct _USER_INFO_1017 {
322 DWORD usri1017_acct_expires;
323} USER_INFO_1017, *PUSER_INFO_1017, *LPUSER_INFO_1017;
324
325typedef struct _USER_INFO_1018 {
326 DWORD usri1018_max_storage;
327} USER_INFO_1018, *PUSER_INFO_1018, *LPUSER_INFO_1018;
328
329typedef struct _USER_INFO_1020 {
330 DWORD usri1020_units_per_week;
331 LPBYTE usri1020_logon_hours;
332} USER_INFO_1020, *PUSER_INFO_1020, *LPUSER_INFO_1020;
333
334typedef struct _USER_INFO_1023 {
335 LPWSTR usri1023_logon_server;
336} USER_INFO_1023, *PUSER_INFO_1023, *LPUSER_INFO_1023;
337
338typedef struct _USER_INFO_1024 {
339 DWORD usri1024_country_code;
340} USER_INFO_1024, *PUSER_INFO_1024, *LPUSER_INFO_1024;
341
342typedef struct _USER_INFO_1025 {
343 DWORD usri1025_code_page;
344} USER_INFO_1025, *PUSER_INFO_1025, *LPUSER_INFO_1025;
345
346typedef struct _USER_INFO_1051 {
347 DWORD usri1051_primary_group_id;
348} USER_INFO_1051, *PUSER_INFO_1051, *LPUSER_INFO_1051;
349
350typedef struct _USER_INFO_1052 {
351 LPWSTR usri1052_profile;
352} USER_INFO_1052, *PUSER_INFO_1052, *LPUSER_INFO_1052;
353
354typedef struct _USER_INFO_1053 {
355 LPWSTR usri1053_home_dir_drive;
356} USER_INFO_1053, *PUSER_INFO_1053, *LPUSER_INFO_1053;
357
358typedef struct _USER_MODALS_INFO_0 {
359 DWORD usrmod0_min_passwd_len;
360 DWORD usrmod0_max_passwd_age;
361 DWORD usrmod0_min_passwd_age;
362 DWORD usrmod0_force_logoff;
363 DWORD usrmod0_password_hist_len;
364} USER_MODALS_INFO_0, *PUSER_MODALS_INFO_0, *LPUSER_MODALS_INFO_0;
365
366typedef struct _USER_MODALS_INFO_1 {
367 DWORD usrmod1_role;
368 LPWSTR usrmod1_primary;
369} USER_MODALS_INFO_1, *PUSER_MODALS_INFO_1, *LPUSER_MODALS_INFO_1;
370
371typedef struct _USER_MODALS_INFO_2 {
372 LPWSTR usrmod2_domain_name;
373 PSID usrmod2_domain_id;
374} USER_MODALS_INFO_2, *PUSER_MODALS_INFO_2, *LPUSER_MODALS_INFO_2;
375
376typedef struct _USER_MODALS_INFO_3 {
377 DWORD usrmod3_lockout_duration;
378 DWORD usrmod3_lockout_observation_window;
379 DWORD usrmod3_lockout_threshold;
380} USER_MODALS_INFO_3, *PUSER_MODALS_INFO_3, *LPUSER_MODALS_INFO_3;
381
382typedef struct _NET_DISPLAY_USER {
383 LPWSTR usri1_name;
384 LPWSTR usri1_comment;
385 DWORD usri1_flags;
386 LPWSTR usri1_full_name;
387 DWORD usri1_user_id;
388 DWORD usri1_next_index;
389} NET_DISPLAY_USER, *PNET_DISPLAY_USER;
390
391typedef struct _NET_DISPLAY_MACHINE {
392 LPWSTR usri2_name;
393 LPWSTR usri2_comment;
394 DWORD usri2_flags;
395 DWORD usri2_user_id;
396 DWORD usri2_next_index;
397} NET_DISPLAY_MACHINE, *PNET_DISPLAY_MACHINE;
398
399typedef struct _NET_DISPLAY_GROUP {
400 LPWSTR grpi3_name;
401 LPWSTR grpi3_comment;
402 DWORD grpi3_group_id;
403 DWORD grpi3_attributes;
404 DWORD grpi3_next_index;
405} NET_DISPLAY_GROUP, *PNET_DISPLAY_GROUP;
406
407typedef struct _LOCALGROUP_INFO_0 {
408 LPWSTR lgrpi0_name;
409} LOCALGROUP_INFO_0, *PLOCALGROUP_INFO_0, *LPLOCALGROUP_INFO_0;
410
411typedef struct _LOCALGROUP_INFO_1 {
412 LPWSTR lgrpi1_name;
413 LPWSTR lgrpi1_comment;
414} LOCALGROUP_INFO_1, *PLOCALGROUP_INFO_1, *LPLOCALGROUP_INFO_1;
415
416typedef struct _LOCALGROUP_INFO_1002 {
417 LPWSTR lgrpi1002_comment;
418} LOCALGROUP_INFO_1002, *PLOCALGROUP_INFO_1002, *LPLOCALGROUP_INFO_1002;
419
420typedef struct _LOCALGROUP_MEMBERS_INFO_0 {
421 PSID lgrmi0_sid;
422} LOCALGROUP_MEMBERS_INFO_0, *PLOCALGROUP_MEMBERS_INFO_0, *LPLOCALGROUP_MEMBERS_INFO_0;
423
424typedef struct _LOCALGROUP_MEMBERS_INFO_1 {
425 PSID lgrmi1_sid;
426 SID_NAME_USE lgrmi1_sidusage;
427 LPWSTR lgrmi1_name;
428} LOCALGROUP_MEMBERS_INFO_1, *PLOCALGROUP_MEMBERS_INFO_1, *LPLOCALGROUP_MEMBERS_INFO_1;
429
430typedef struct _LOCALGROUP_MEMBERS_INFO_2 {
431 PSID lgrmi2_sid;
432 SID_NAME_USE lgrmi2_sidusage;
433 LPWSTR lgrmi2_domainandname;
434} LOCALGROUP_MEMBERS_INFO_2, *PLOCALGROUP_MEMBERS_INFO_2, *LPLOCALGROUP_MEMBERS_INFO_2;
435
436typedef struct _LOCALGROUP_MEMBERS_INFO_3 {
437 LPWSTR lgrmi3_domainandname;
438} LOCALGROUP_MEMBERS_INFO_3, *PLOCALGROUP_MEMBERS_INFO_3, *LPLOCALGROUP_MEMBERS_INFO_3;
439
440typedef struct _LOCALGROUP_USERS_INFO_0 {
441 LPWSTR lgrui0_name;
442} LOCALGROUP_USERS_INFO_0, *PLOCALGROUP_USERS_INFO_0, *LPLOCALGROUP_USERS_INFO_0;
443
444#define USER_PRIV_GUEST 0
445#define USER_PRIV_USER 1
446#define USER_PRIV_ADMIN 2
447#define USER_PRIV_MASK 3
448
449#define LOCALGROUP_NAME_PARMNUM 1
450#define LOCALGROUP_COMMENT_PARMNUM 2
451
452NET_API_STATUS WINAPI NetGetDCName(LPCWSTR,LPCWSTR,LPBYTE*);
453NET_API_STATUS WINAPI NetGroupEnum(LPCWSTR,DWORD,LPBYTE*,DWORD,LPDWORD,LPDWORD,LPDWORD);
454NET_API_STATUS WINAPI NetLocalGroupAdd(LPCWSTR,DWORD,LPBYTE,LPDWORD);
455NET_API_STATUS WINAPI NetLocalGroupAddMember(LPCWSTR,LPCWSTR,PSID);
456NET_API_STATUS WINAPI NetLocalGroupAddMembers(LPCWSTR,LPCWSTR,DWORD,LPBYTE,DWORD);
457NET_API_STATUS WINAPI NetLocalGroupDel(LPCWSTR,LPCWSTR);
458NET_API_STATUS WINAPI NetLocalGroupDelMember(LPCWSTR,LPCWSTR,PSID);
459NET_API_STATUS WINAPI NetLocalGroupDelMembers(LPCWSTR,LPCWSTR,DWORD,LPBYTE,DWORD);
460NET_API_STATUS WINAPI NetLocalGroupEnum(LPCWSTR,DWORD,LPBYTE*,DWORD,LPDWORD,LPDWORD,PDWORD_PTR);
461NET_API_STATUS WINAPI NetLocalGroupGetInfo(LPCWSTR,LPCWSTR,DWORD,LPBYTE*);
462NET_API_STATUS WINAPI NetLocalGroupGetMembers(LPCWSTR,LPCWSTR,DWORD,LPBYTE*,DWORD,LPDWORD,LPDWORD,PDWORD_PTR);
463NET_API_STATUS WINAPI NetLocalGroupSetInfo(LPCWSTR,LPCWSTR,DWORD,LPBYTE,LPDWORD);
464NET_API_STATUS WINAPI NetLocalGroupSetMembers(LPCWSTR,LPCWSTR,DWORD,LPBYTE,DWORD);
465NET_API_STATUS WINAPI NetQueryDisplayInformation(LPCWSTR,DWORD,DWORD,DWORD,DWORD,LPDWORD,PVOID*);
466NET_API_STATUS WINAPI NetUserAdd(LPCWSTR,DWORD,LPBYTE,LPDWORD);
467NET_API_STATUS WINAPI NetUserChangePassword(LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR);
468NET_API_STATUS WINAPI NetUserDel(LPCWSTR,LPCWSTR);
469NET_API_STATUS WINAPI NetUserEnum(LPCWSTR,DWORD,DWORD,LPBYTE*,DWORD,LPDWORD,LPDWORD,LPDWORD);
470NET_API_STATUS WINAPI NetUserGetInfo(LPCWSTR,LPCWSTR,DWORD,LPBYTE*);
471NET_API_STATUS WINAPI NetUserGetLocalGroups(LPCWSTR,LPCWSTR,DWORD,DWORD,LPBYTE*,DWORD,LPDWORD,LPDWORD);
472NET_API_STATUS WINAPI NetUserModalsGet(LPCWSTR,DWORD,LPBYTE*);
473
474#ifdef __cplusplus
475}
476#endif
477
478#endif
Note: See TracBrowser for help on using the repository browser.