Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
4.5 KiB

  1. //
  2. // Macros for setting fields in an SE_AUDIT_PARAMETERS array.
  3. //
  4. // These must be kept in sync with identical macros in ds\security\base\lsa\server\adtp.h.
  5. //
  6. #define LsapSetParmTypeSid( AuditParameters, Index, Sid ) \
  7. { \
  8. if( Sid ) { \
  9. \
  10. (AuditParameters).Parameters[(Index)].Type = SeAdtParmTypeSid; \
  11. (AuditParameters).Parameters[(Index)].Length = RtlLengthSid( (Sid) ); \
  12. (AuditParameters).Parameters[(Index)].Address = (Sid); \
  13. \
  14. } else { \
  15. \
  16. (AuditParameters).Parameters[(Index)].Type = SeAdtParmTypeNone; \
  17. (AuditParameters).Parameters[(Index)].Length = 0; \
  18. (AuditParameters).Parameters[(Index)].Address = NULL; \
  19. \
  20. } \
  21. }
  22. #define LsapSetParmTypeAccessMask( AuditParameters, Index, AccessMask, ObjectTypeIndex ) \
  23. { \
  24. (AuditParameters).Parameters[(Index)].Type = SeAdtParmTypeAccessMask; \
  25. (AuditParameters).Parameters[(Index)].Length = sizeof( ACCESS_MASK ); \
  26. (AuditParameters).Parameters[(Index)].Data[0] = (AccessMask); \
  27. (AuditParameters).Parameters[(Index)].Data[1] = (ObjectTypeIndex); \
  28. }
  29. #define LsapSetParmTypeString( AuditParameters, Index, String ) \
  30. { \
  31. (AuditParameters).Parameters[(Index)].Type = SeAdtParmTypeString; \
  32. (AuditParameters).Parameters[(Index)].Length = \
  33. sizeof(UNICODE_STRING)+(String)->Length; \
  34. (AuditParameters).Parameters[(Index)].Address = (String); \
  35. }
  36. #define LsapSetParmTypeUlong( AuditParameters, Index, Ulong ) \
  37. { \
  38. (AuditParameters).Parameters[(Index)].Type = SeAdtParmTypeUlong; \
  39. (AuditParameters).Parameters[(Index)].Length = sizeof( (Ulong) ); \
  40. (AuditParameters).Parameters[(Index)].Data[0] = (ULONG)(Ulong); \
  41. }
  42. #define LsapSetParmTypeHexUlong( AuditParameters, Index, Ulong ) \
  43. { \
  44. (AuditParameters).Parameters[(Index)].Type = SeAdtParmTypeHexUlong; \
  45. (AuditParameters).Parameters[(Index)].Length = sizeof( (Ulong) ); \
  46. (AuditParameters).Parameters[(Index)].Data[0] = (ULONG)(Ulong); \
  47. }
  48. #define LsapSetParmTypeNoLogon( AuditParameters, Index ) \
  49. { \
  50. (AuditParameters).Parameters[(Index)].Type = SeAdtParmTypeNoLogonId; \
  51. }
  52. #define LsapSetParmTypeLogonId( AuditParameters, Index, LogonId ) \
  53. { \
  54. PLUID TmpLuid; \
  55. \
  56. (AuditParameters).Parameters[(Index)].Type = SeAdtParmTypeLogonId; \
  57. (AuditParameters).Parameters[(Index)].Length = sizeof( (LogonId) ); \
  58. TmpLuid = (PLUID)(&(AuditParameters).Parameters[(Index)].Data[0]); \
  59. *TmpLuid = (LogonId); \
  60. }
  61. #define LsapSetParmTypePrivileges( AuditParameters, Index, Privileges ) \
  62. { \
  63. (AuditParameters).Parameters[(Index)].Type = SeAdtParmTypePrivs; \
  64. (AuditParameters).Parameters[(Index)].Length = LsapPrivilegeSetSize( (Privileges) ); \
  65. (AuditParameters).Parameters[(Index)].Address = (Privileges); \
  66. }