1 /**
2  * Windows API header module
3  *
4  * Translated from MinGW Windows headers
5  *
6  * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
7  * Source: $(DRUNTIMESRC core/sys/windows/_lmaudit.d)
8  */
9 // COMMENT: This file may be deprecated.
10 module core.sys.windows.lmaudit;
11 version (Windows):
12 
13 import core.sys.windows.lmcons, core.sys.windows.windef;
14 
15 enum LOGFLAGS_FORWARD  = 0;
16 enum LOGFLAGS_BACKWARD = 1;
17 enum LOGFLAGS_SEEK     = 2;
18 
19 enum ACTION_LOCKOUT     = 0;
20 enum ACTION_ADMINUNLOCK = 1;
21 
22 enum AE_GUEST=0;
23 enum AE_USER=1;
24 enum AE_ADMIN=2;
25 enum AE_NORMAL=0;
26 enum AE_USERLIMIT=0;
27 enum AE_GENERAL=0;
28 enum AE_ERROR=1;
29 enum AE_SESSDIS=1;
30 enum AE_BADPW=1;
31 enum AE_AUTODIS=2;
32 enum AE_UNSHARE=2;
33 enum AE_ADMINPRIVREQD=2;
34 enum AE_ADMINDIS=3;
35 enum AE_NOACCESSPERM=3;
36 enum AE_ACCRESTRICT=4;
37 enum AE_NORMAL_CLOSE=0;
38 enum AE_SES_CLOSE=1;
39 enum AE_ADMIN_CLOSE=2;
40 enum AE_LIM_UNKNOWN=0;
41 enum AE_LIM_LOGONHOURS=1;
42 enum AE_LIM_EXPIRED=2;
43 enum AE_LIM_INVAL_WKSTA=3;
44 enum AE_LIM_DISABLED=4;
45 enum AE_LIM_DELETED=5;
46 enum AE_MOD=0;
47 enum AE_DELETE=1;
48 enum AE_ADD=2;
49 
50 enum AE_UAS_USER   = 0;
51 enum AE_UAS_GROUP  = 1;
52 enum AE_UAS_MODALS = 2;
53 
54 enum SVAUD_SERVICE       = 1;
55 enum SVAUD_GOODSESSLOGON = 6;
56 enum SVAUD_BADSESSLOGON  = 24;
57 enum SVAUD_SESSLOGON     = SVAUD_GOODSESSLOGON|SVAUD_BADSESSLOGON;
58 enum SVAUD_GOODNETLOGON  = 96;
59 enum SVAUD_BADNETLOGON   = 384;
60 enum SVAUD_NETLOGON      = SVAUD_GOODNETLOGON|SVAUD_BADNETLOGON;
61 enum SVAUD_LOGON         = SVAUD_NETLOGON|SVAUD_SESSLOGON;
62 enum SVAUD_GOODUSE       = 0x600;
63 enum SVAUD_BADUSE        = 0x1800;
64 enum SVAUD_USE           = SVAUD_GOODUSE|SVAUD_BADUSE;
65 enum SVAUD_USERLIST      = 8192;
66 enum SVAUD_PERMISSIONS   = 16384;
67 enum SVAUD_RESOURCE      = 32768;
68 enum SVAUD_LOGONLIM      = 65536;
69 
70 enum AA_AUDIT_ALL=1;
71 enum AA_A_OWNER=4;
72 enum AA_CLOSE=8;
73 enum AA_S_OPEN=16;
74 enum AA_S_WRITE=32;
75 enum AA_S_CREATE=32;
76 enum AA_S_DELETE=64;
77 enum AA_S_ACL=128;
78 enum AA_S_ALL=253;
79 enum AA_F_OPEN=256;
80 enum AA_F_WRITE=512;
81 enum AA_F_CREATE=512;
82 enum AA_F_DELETE=1024;
83 enum AA_F_ACL=2048;
84 enum AA_F_ALL = AA_F_OPEN|AA_F_WRITE|AA_F_DELETE|AA_F_ACL;
85 enum AA_A_OPEN=2048;
86 enum AA_A_WRITE=4096;
87 enum AA_A_CREATE=8192;
88 enum AA_A_DELETE=16384;
89 enum AA_A_ACL=32768;
90 enum AA_A_ALL = AA_F_OPEN|AA_F_WRITE|AA_F_DELETE|AA_F_ACL;
91 
92 struct AUDIT_ENTRY{
93     DWORD ae_len;
94     DWORD ae_reserved;
95     DWORD ae_time;
96     DWORD ae_type;
97     DWORD ae_data_offset;
98     DWORD ae_data_size;
99 }
100 alias AUDIT_ENTRY* PAUDIT_ENTRY, LPAUDIT_ENTRY;
101 
102 struct HLOG{
103     DWORD time;
104     DWORD last_flags;
105     DWORD offset;
106     DWORD rec_offset;
107 }
108 alias HLOG* PHLOG, LPHLOG;
109 
110 struct AE_SRVSTATUS{
111     DWORD ae_sv_status;
112 }
113 alias AE_SRVSTATUS* PAE_SRVSTATUS, LPAE_SRVSTATUS;
114 
115 struct AE_SESSLOGON{
116     DWORD ae_so_compname;
117     DWORD ae_so_username;
118     DWORD ae_so_privilege;
119 }
120 alias AE_SESSLOGON* PAE_SESSLOGON, LPAE_SESSLOGON;
121 
122 struct AE_SESSLOGOFF{
123     DWORD ae_sf_compname;
124     DWORD ae_sf_username;
125     DWORD ae_sf_reason;
126 }
127 alias AE_SESSLOGOFF* PAE_SESSLOGOFF, LPAE_SESSLOGOFF;
128 
129 struct AE_SESSPWERR{
130     DWORD ae_sp_compname;
131     DWORD ae_sp_username;
132 }
133 alias AE_SESSPWERR* PAE_SESSPWERR, LPAE_SESSPWERR;
134 
135 struct AE_CONNSTART{
136     DWORD ae_ct_compname;
137     DWORD ae_ct_username;
138     DWORD ae_ct_netname;
139     DWORD ae_ct_connid;
140 }
141 alias AE_CONNSTART* PAE_CONNSTART, LPAE_CONNSTART;
142 
143 struct AE_CONNSTOP{
144     DWORD ae_cp_compname;
145     DWORD ae_cp_username;
146     DWORD ae_cp_netname;
147     DWORD ae_cp_connid;
148     DWORD ae_cp_reason;
149 }
150 alias AE_CONNSTOP* PAE_CONNSTOP, LPAE_CONNSTOP;
151 
152 struct AE_CONNREJ{
153     DWORD ae_cr_compname;
154     DWORD ae_cr_username;
155     DWORD ae_cr_netname;
156     DWORD ae_cr_reason;
157 }
158 alias AE_CONNREJ* PAE_CONNREJ, LPAE_CONNREJ;
159 
160 struct AE_RESACCESS{
161     DWORD ae_ra_compname;
162     DWORD ae_ra_username;
163     DWORD ae_ra_resname;
164     DWORD ae_ra_operation;
165     DWORD ae_ra_returncode;
166     DWORD ae_ra_restype;
167     DWORD ae_ra_fileid;
168 }
169 alias AE_RESACCESS* PAE_RESACCESS, LPAE_RESACCESS;
170 
171 struct AE_RESACCESSREJ{
172     DWORD ae_rr_compname;
173     DWORD ae_rr_username;
174     DWORD ae_rr_resname;
175     DWORD ae_rr_operation;
176 }
177 alias AE_RESACCESSREJ* PAE_RESACCESSREJ, LPAE_RESACCESSREJ;
178 
179 struct AE_CLOSEFILE{
180     DWORD ae_cf_compname;
181     DWORD ae_cf_username;
182     DWORD ae_cf_resname;
183     DWORD ae_cf_fileid;
184     DWORD ae_cf_duration;
185     DWORD ae_cf_reason;
186 }
187 alias AE_CLOSEFILE* PAE_CLOSEFILE, LPAE_CLOSEFILE;
188 
189 struct AE_SERVICESTAT{
190     DWORD ae_ss_compname;
191     DWORD ae_ss_username;
192     DWORD ae_ss_svcname;
193     DWORD ae_ss_status;
194     DWORD ae_ss_code;
195     DWORD ae_ss_text;
196     DWORD ae_ss_returnval;
197 }
198 alias AE_SERVICESTAT* PAE_SERVICESTAT, LPAE_SERVICESTAT;
199 
200 struct AE_ACLMOD{
201     DWORD ae_am_compname;
202     DWORD ae_am_username;
203     DWORD ae_am_resname;
204     DWORD ae_am_action;
205     DWORD ae_am_datalen;
206 }
207 alias AE_ACLMOD* PAE_ACLMOD, LPAE_ACLMOD;
208 
209 struct AE_UASMOD{
210     DWORD ae_um_compname;
211     DWORD ae_um_username;
212     DWORD ae_um_resname;
213     DWORD ae_um_rectype;
214     DWORD ae_um_action;
215     DWORD ae_um_datalen;
216 }
217 alias AE_UASMOD* PAE_UASMOD, LPAE_UASMOD;
218 
219 struct AE_NETLOGON{
220     DWORD ae_no_compname;
221     DWORD ae_no_username;
222     DWORD ae_no_privilege;
223     DWORD ae_no_authflags;
224 }
225 alias AE_NETLOGON* PAE_NETLOGON, LPAE_NETLOGON;
226 
227 struct AE_NETLOGOFF{
228     DWORD ae_nf_compname;
229     DWORD ae_nf_username;
230     DWORD ae_nf_reserved1;
231     DWORD ae_nf_reserved2;
232 }
233 alias AE_NETLOGOFF* PAE_NETLOGOFF, LPAE_NETLOGOFF;
234 
235 struct AE_ACCLIM{
236     DWORD ae_al_compname;
237     DWORD ae_al_username;
238     DWORD ae_al_resname;
239     DWORD ae_al_limit;
240 }
241 alias AE_ACCLIM* PAE_ACCLIM, LPAE_ACCLIM;
242 
243 struct AE_LOCKOUT{
244     DWORD ae_lk_compname;
245     DWORD ae_lk_username;
246     DWORD ae_lk_action;
247     DWORD ae_lk_bad_pw_count;
248 }
249 alias AE_LOCKOUT* PAE_LOCKOUT, LPAE_LOCKOUT;
250 
251 struct AE_GENERIC{
252     DWORD ae_ge_msgfile;
253     DWORD ae_ge_msgnum;
254     DWORD ae_ge_params;
255     DWORD ae_ge_param1;
256     DWORD ae_ge_param2;
257     DWORD ae_ge_param3;
258     DWORD ae_ge_param4;
259     DWORD ae_ge_param5;
260     DWORD ae_ge_param6;
261     DWORD ae_ge_param7;
262     DWORD ae_ge_param8;
263     DWORD ae_ge_param9;
264 }
265 alias AE_GENERIC* PAE_GENERIC, LPAE_GENERIC;
266 
267 extern (Windows) {
268 deprecated {
269 NET_API_STATUS NetAuditClear(LPCWSTR,LPCWSTR,LPCWSTR);
270 NET_API_STATUS NetAuditRead(LPTSTR,LPTSTR,LPHLOG,DWORD,PDWORD,DWORD,DWORD,PBYTE*,DWORD,PDWORD,PDWORD);
271 NET_API_STATUS NetAuditWrite(DWORD,PBYTE,DWORD,LPTSTR,PBYTE);
272 }
273 }
274 
275 /+
276 /* MinGW: These conflict with struct typedefs, why? */
277 enum AE_SRVSTATUS=0;
278 enum AE_SESSLOGON=1;
279 enum AE_SESSLOGOFF=2;
280 enum AE_SESSPWERR=3;
281 enum AE_CONNSTART=4;
282 enum AE_CONNSTOP=5;
283 enum AE_CONNREJ=6;
284 enum AE_RESACCESS=7;
285 enum AE_RESACCESSREJ=8;
286 enum AE_CLOSEFILE=9;
287 enum AE_SERVICESTAT=11;
288 enum AE_ACLMOD=12;
289 enum AE_UASMOD=13;
290 enum AE_NETLOGON=14;
291 enum AE_NETLOGOFF=15;
292 enum AE_NETLOGDENIED=16;
293 enum AE_ACCLIMITEXCD=17;
294 enum AE_RESACCESS2=18;
295 enum AE_ACLMODFAIL=19;
296 enum AE_LOCKOUT=20;
297 enum AE_GENERIC_TYPE=21;
298 enum AE_SRVSTART=0;
299 enum AE_SRVPAUSED=1;
300 enum AE_SRVCONT=2;
301 enum AE_SRVSTOP=3;
302 +/