lmaudit.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _LMAUDIT_
  7. #define _LMAUDIT_
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #ifndef _LMHLOGDEFINED_
  12. #define _LMHLOGDEFINED_
  13. typedef struct _HLOG {
  14. DWORD time;
  15. DWORD last_flags;
  16. DWORD offset;
  17. DWORD rec_offset;
  18. } HLOG,*PHLOG,*LPHLOG;
  19. #define LOGFLAGS_FORWARD 0
  20. #define LOGFLAGS_BACKWARD 0x1
  21. #define LOGFLAGS_SEEK 0x2
  22. #endif
  23. DWORD WINAPI NetAuditClear(LPCWSTR server,LPCWSTR backupfile,LPCWSTR service);
  24. DWORD WINAPI NetAuditRead(LPCWSTR server,LPCWSTR service,LPHLOG auditloghandle,DWORD offset,LPDWORD reserved1,DWORD reserved2,DWORD offsetflag,LPBYTE *bufptr,DWORD prefmaxlen,LPDWORD bytesread,LPDWORD totalavailable);
  25. DWORD WINAPI NetAuditWrite(DWORD type,LPBYTE buf,DWORD numbytes,LPCWSTR service,LPBYTE reserved);
  26. typedef struct _AUDIT_ENTRY {
  27. DWORD ae_len;
  28. DWORD ae_reserved;
  29. DWORD ae_time;
  30. DWORD ae_type;
  31. DWORD ae_data_offset;
  32. DWORD ae_data_size;
  33. } AUDIT_ENTRY,*PAUDIT_ENTRY,*LPAUDIT_ENTRY;
  34. #define REVISED_AUDIT_ENTRY_STRUCT
  35. typedef struct _AE_SRVSTATUS {
  36. DWORD ae_sv_status;
  37. } AE_SRVSTATUS,*PAE_SRVSTATUS,*LPAE_SRVSTATUS;
  38. typedef struct _AE_SESSLOGON {
  39. DWORD ae_so_compname;
  40. DWORD ae_so_username;
  41. DWORD ae_so_privilege;
  42. } AE_SESSLOGON,*PAE_SESSLOGON,*LPAE_SESSLOGON;
  43. typedef struct _AE_SESSLOGOFF {
  44. DWORD ae_sf_compname;
  45. DWORD ae_sf_username;
  46. DWORD ae_sf_reason;
  47. } AE_SESSLOGOFF,*PAE_SESSLOGOFF,*LPAE_SESSLOGOFF;
  48. typedef struct _AE_SESSPWERR {
  49. DWORD ae_sp_compname;
  50. DWORD ae_sp_username;
  51. } AE_SESSPWERR,*PAE_SESSPWERR,*LPAE_SESSPWERR;
  52. typedef struct _AE_CONNSTART {
  53. DWORD ae_ct_compname;
  54. DWORD ae_ct_username;
  55. DWORD ae_ct_netname;
  56. DWORD ae_ct_connid;
  57. } AE_CONNSTART,*PAE_CONNSTART,*LPAE_CONNSTART;
  58. typedef struct _AE_CONNSTOP {
  59. DWORD ae_cp_compname;
  60. DWORD ae_cp_username;
  61. DWORD ae_cp_netname;
  62. DWORD ae_cp_connid;
  63. DWORD ae_cp_reason;
  64. } AE_CONNSTOP,*PAE_CONNSTOP,*LPAE_CONNSTOP;
  65. typedef struct _AE_CONNREJ {
  66. DWORD ae_cr_compname;
  67. DWORD ae_cr_username;
  68. DWORD ae_cr_netname;
  69. DWORD ae_cr_reason;
  70. } AE_CONNREJ,*PAE_CONNREJ,*LPAE_CONNREJ;
  71. typedef struct _AE_RESACCESS {
  72. DWORD ae_ra_compname;
  73. DWORD ae_ra_username;
  74. DWORD ae_ra_resname;
  75. DWORD ae_ra_operation;
  76. DWORD ae_ra_returncode;
  77. DWORD ae_ra_restype;
  78. DWORD ae_ra_fileid;
  79. } AE_RESACCESS,*PAE_RESACCESS,*LPAE_RESACCESS;
  80. typedef struct _AE_RESACCESSREJ {
  81. DWORD ae_rr_compname;
  82. DWORD ae_rr_username;
  83. DWORD ae_rr_resname;
  84. DWORD ae_rr_operation;
  85. } AE_RESACCESSREJ,*PAE_RESACCESSREJ,*LPAE_RESACCESSREJ;
  86. typedef struct _AE_CLOSEFILE {
  87. DWORD ae_cf_compname;
  88. DWORD ae_cf_username;
  89. DWORD ae_cf_resname;
  90. DWORD ae_cf_fileid;
  91. DWORD ae_cf_duration;
  92. DWORD ae_cf_reason;
  93. } AE_CLOSEFILE,*PAE_CLOSEFILE,*LPAE_CLOSEFILE;
  94. typedef struct _AE_SERVICESTAT {
  95. DWORD ae_ss_compname;
  96. DWORD ae_ss_username;
  97. DWORD ae_ss_svcname;
  98. DWORD ae_ss_status;
  99. DWORD ae_ss_code;
  100. DWORD ae_ss_text;
  101. DWORD ae_ss_returnval;
  102. } AE_SERVICESTAT,*PAE_SERVICESTAT,*LPAE_SERVICESTAT;
  103. typedef struct _AE_ACLMOD {
  104. DWORD ae_am_compname;
  105. DWORD ae_am_username;
  106. DWORD ae_am_resname;
  107. DWORD ae_am_action;
  108. DWORD ae_am_datalen;
  109. } AE_ACLMOD,*PAE_ACLMOD,*LPAE_ACLMOD;
  110. typedef struct _AE_UASMOD {
  111. DWORD ae_um_compname;
  112. DWORD ae_um_username;
  113. DWORD ae_um_resname;
  114. DWORD ae_um_rectype;
  115. DWORD ae_um_action;
  116. DWORD ae_um_datalen;
  117. } AE_UASMOD,*PAE_UASMOD,*LPAE_UASMOD;
  118. typedef struct _AE_NETLOGON {
  119. DWORD ae_no_compname;
  120. DWORD ae_no_username;
  121. DWORD ae_no_privilege;
  122. DWORD ae_no_authflags;
  123. } AE_NETLOGON,*PAE_NETLOGON,*LPAE_NETLOGON;
  124. typedef struct _AE_NETLOGOFF {
  125. DWORD ae_nf_compname;
  126. DWORD ae_nf_username;
  127. DWORD ae_nf_reserved1;
  128. DWORD ae_nf_reserved2;
  129. } AE_NETLOGOFF,*PAE_NETLOGOFF,*LPAE_NETLOGOFF;
  130. typedef struct _AE_ACCLIM {
  131. DWORD ae_al_compname;
  132. DWORD ae_al_username;
  133. DWORD ae_al_resname;
  134. DWORD ae_al_limit;
  135. } AE_ACCLIM,*PAE_ACCLIM,*LPAE_ACCLIM;
  136. #define ACTION_LOCKOUT 00
  137. #define ACTION_ADMINUNLOCK 01
  138. typedef struct _AE_LOCKOUT {
  139. DWORD ae_lk_compname;
  140. DWORD ae_lk_username;
  141. DWORD ae_lk_action;
  142. DWORD ae_lk_bad_pw_count;
  143. } AE_LOCKOUT,*PAE_LOCKOUT,*LPAE_LOCKOUT;
  144. typedef struct _AE_GENERIC {
  145. DWORD ae_ge_msgfile;
  146. DWORD ae_ge_msgnum;
  147. DWORD ae_ge_params;
  148. DWORD ae_ge_param1;
  149. DWORD ae_ge_param2;
  150. DWORD ae_ge_param3;
  151. DWORD ae_ge_param4;
  152. DWORD ae_ge_param5;
  153. DWORD ae_ge_param6;
  154. DWORD ae_ge_param7;
  155. DWORD ae_ge_param8;
  156. DWORD ae_ge_param9;
  157. } AE_GENERIC,*PAE_GENERIC,*LPAE_GENERIC;
  158. #define AE_SRVSTATUS 0
  159. #define AE_SESSLOGON 1
  160. #define AE_SESSLOGOFF 2
  161. #define AE_SESSPWERR 3
  162. #define AE_CONNSTART 4
  163. #define AE_CONNSTOP 5
  164. #define AE_CONNREJ 6
  165. #define AE_RESACCESS 7
  166. #define AE_RESACCESSREJ 8
  167. #define AE_CLOSEFILE 9
  168. #define AE_SERVICESTAT 11
  169. #define AE_ACLMOD 12
  170. #define AE_UASMOD 13
  171. #define AE_NETLOGON 14
  172. #define AE_NETLOGOFF 15
  173. #define AE_NETLOGDENIED 16
  174. #define AE_ACCLIMITEXCD 17
  175. #define AE_RESACCESS2 18
  176. #define AE_ACLMODFAIL 19
  177. #define AE_LOCKOUT 20
  178. #define AE_GENERIC_TYPE 21
  179. #define AE_SRVSTART 0
  180. #define AE_SRVPAUSED 1
  181. #define AE_SRVCONT 2
  182. #define AE_SRVSTOP 3
  183. #define AE_GUEST 0
  184. #define AE_USER 1
  185. #define AE_ADMIN 2
  186. #define AE_NORMAL 0
  187. #define AE_USERLIMIT 0
  188. #define AE_GENERAL 0
  189. #define AE_ERROR 1
  190. #define AE_SESSDIS 1
  191. #define AE_BADPW 1
  192. #define AE_AUTODIS 2
  193. #define AE_UNSHARE 2
  194. #define AE_ADMINPRIVREQD 2
  195. #define AE_ADMINDIS 3
  196. #define AE_NOACCESSPERM 3
  197. #define AE_ACCRESTRICT 4
  198. #define AE_NORMAL_CLOSE 0
  199. #define AE_SES_CLOSE 1
  200. #define AE_ADMIN_CLOSE 2
  201. #define AE_LIM_UNKNOWN 0
  202. #define AE_LIM_LOGONHOURS 1
  203. #define AE_LIM_EXPIRED 2
  204. #define AE_LIM_INVAL_WKSTA 3
  205. #define AE_LIM_DISABLED 4
  206. #define AE_LIM_DELETED 5
  207. #define AE_MOD 0
  208. #define AE_DELETE 1
  209. #define AE_ADD 2
  210. #define AE_UAS_USER 0
  211. #define AE_UAS_GROUP 1
  212. #define AE_UAS_MODALS 2
  213. #define SVAUD_SERVICE 0x1
  214. #define SVAUD_GOODSESSLOGON 0x6
  215. #define SVAUD_BADSESSLOGON 0x18
  216. #define SVAUD_SESSLOGON (SVAUD_GOODSESSLOGON | SVAUD_BADSESSLOGON)
  217. #define SVAUD_GOODNETLOGON 0x60
  218. #define SVAUD_BADNETLOGON 0x180
  219. #define SVAUD_NETLOGON (SVAUD_GOODNETLOGON | SVAUD_BADNETLOGON)
  220. #define SVAUD_LOGON (SVAUD_NETLOGON | SVAUD_SESSLOGON)
  221. #define SVAUD_GOODUSE 0x600
  222. #define SVAUD_BADUSE 0x1800
  223. #define SVAUD_USE (SVAUD_GOODUSE | SVAUD_BADUSE)
  224. #define SVAUD_USERLIST 0x2000
  225. #define SVAUD_PERMISSIONS 0x4000
  226. #define SVAUD_RESOURCE 0x8000
  227. #define SVAUD_LOGONLIM 0x00010000
  228. #define AA_AUDIT_ALL 0x0001
  229. #define AA_A_OWNER 0x0004
  230. #define AA_CLOSE 0x0008
  231. #define AA_S_OPEN 0x0010
  232. #define AA_S_WRITE 0x0020
  233. #define AA_S_CREATE 0x0020
  234. #define AA_S_DELETE 0x0040
  235. #define AA_S_ACL 0x0080
  236. #define AA_S_ALL (AA_S_OPEN | AA_S_WRITE | AA_S_DELETE | AA_S_ACL)
  237. #define AA_F_OPEN 0x0100
  238. #define AA_F_WRITE 0x0200
  239. #define AA_F_CREATE 0x0200
  240. #define AA_F_DELETE 0x0400
  241. #define AA_F_ACL 0x0800
  242. #define AA_F_ALL (AA_F_OPEN | AA_F_WRITE | AA_F_DELETE | AA_F_ACL)
  243. #define AA_A_OPEN 0x1000
  244. #define AA_A_WRITE 0x2000
  245. #define AA_A_CREATE 0x2000
  246. #define AA_A_DELETE 0x4000
  247. #define AA_A_ACL 0x8000
  248. #define AA_A_ALL (AA_F_OPEN | AA_F_WRITE | AA_F_DELETE | AA_F_ACL)
  249. #ifdef __cplusplus
  250. }
  251. #endif
  252. #endif