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