Windows NT 4.0 source code leak
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.

189 lines
3.9 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. adt.h
  5. Abstract:
  6. Auditing - Defines, Fuction Prototypes and Macro Functions.
  7. These are public to the Security Component only.
  8. Author:
  9. Scott Birrell (ScottBi) January 17, 1991
  10. Environment:
  11. Revision History:
  12. --*/
  13. #include <ntlsa.h>
  14. //////////////////////////////////////////////////////////////////////////////
  15. // //
  16. // Auditing Routines visible to rest of Security Component outside Auditing //
  17. // subcomponent. //
  18. // //
  19. //////////////////////////////////////////////////////////////////////////////
  20. /*++
  21. BOOLEAN
  22. SepAdtEventOnSuccess(
  23. IN POLICY_AUDIT_EVENT_TYPE AuditEventType
  24. )
  25. Routine Description:
  26. This macro function checks if a given Audit Event Type is enabled for
  27. Auditing of successful occurrences of the Event.
  28. Arguments:
  29. AuditEventType - Specifies the type of the Audit Event to be checked.
  30. Return Value:
  31. BOOLEAN - TRUE if the event type is enabled for auditing of successful
  32. occurrences of the event, else FALSE
  33. --*/
  34. #define SepAdtEventOnSuccess(AuditEventType) \
  35. (SepAdtState.EventAuditingOptions[AuditEventType] & \
  36. POLICY_AUDIT_EVENT_SUCCESS)
  37. /*++
  38. BOOLEAN
  39. SepAdtEventOnFailure(
  40. IN POLICY_AUDIT_EVENT_TYPE AuditEventType
  41. )
  42. Routine Description:
  43. This macro function checks if a given Audit Event Type is enabled for
  44. Auditing of unsuccessful attempts to cause an event of the given type
  45. to occur.
  46. Arguments:
  47. AuditEventType - Specifies the type of the Audit Event to be checked.
  48. Return Value:
  49. BOOLEAN - TRUE if the event type is enabled for auditing of unsuccessful
  50. attempts to make the event type occur, else FALSE
  51. --*/
  52. #define SepAdtEventOnFailure(AuditEventType) \
  53. (SepAdtState.EventAuditingOptions[AuditEventType] & \
  54. POLICY_AUDIT_EVENT_FAILURE)
  55. /*++
  56. BOOLEAN
  57. SepAdtAuditingEvent(
  58. IN POLICY_AUDIT_EVENT_TYPE AuditEventType
  59. )
  60. Routine Description:
  61. This macro function checks if a given Audit Event Type is enabled for
  62. Auditing.
  63. Arguments:
  64. AuditEventType - Specifies the type of the Audit Event to be checked.
  65. Return Value:
  66. BOOLEAN - TRUE if the event type is enabled for auditing, else FALSE.
  67. --*/
  68. #define SepAdtAuditingEvent(AuditEventType) \
  69. (SepAdtEventOnSuccess(AuditEventType) || \
  70. (SepAdtEventOnFailure(AuditEventType))
  71. /*++
  72. BOOLEAN
  73. SepAdtAuditingEnabled()
  74. Routine Description:
  75. This macro function tests if auditing is enabled.
  76. Arguments:
  77. None.
  78. Return Value:
  79. BOOLEAN - TRUE if auditing is enabled, else FALSE
  80. --*/
  81. #define SepAdtAuditingEnabled() (SepAdtState.AuditingMode == TRUE)
  82. /*++
  83. BOOLEAN
  84. SepAdtAuditingDisabled()
  85. Routine Description:
  86. This macro function tests if auditing is disabled.
  87. Arguments:
  88. None.
  89. Return Value:
  90. BOOLEAN - TRUE if auditing is disabled, else FALSE
  91. --*/
  92. #define SepAdtAuditingDisabled() (!SepAdtAuditingEnabled)
  93. //
  94. // Audit Event Information array. Although internal to the Auditing
  95. // Subcomponent, this structure is exported to all of Security so that the
  96. // above macro functions can be used to access it efficiently from there.
  97. //
  98. extern POLICY_AUDIT_EVENTS_INFO SepAdtState;
  99. BOOLEAN
  100. SepAdtInitializePhase0();
  101. BOOLEAN
  102. SepAdtInitializePhase1();
  103. //VOID
  104. //SepAdtLogAuditRecord(
  105. // IN POLICY_AUDIT_EVENT_TYPE AuditEventType,
  106. // IN PVOID AuditInformation
  107. // );
  108. VOID
  109. SepAdtLogAuditRecord(
  110. IN PSE_ADT_PARAMETER_ARRAY AuditParameters
  111. );
  112. NTSTATUS
  113. SepAdtCopyToLsaSharedMemory(
  114. IN HANDLE LsaProcessHandle,
  115. IN PVOID Buffer,
  116. IN ULONG BufferLength,
  117. OUT PVOID *LsaBufferAddress
  118. );