Leaked source code of windows server 2003
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.

129 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. rmaudit.c
  5. Abstract:
  6. This module contains the Reference Monitor Auditing Command Workers.
  7. These workers call functions in the Auditing sub-component to do the real
  8. work.
  9. Author:
  10. Scott Birrell (ScottBi) November 14,1991
  11. Environment:
  12. Kernel mode only.
  13. Revision History:
  14. --*/
  15. #include "pch.h"
  16. #pragma hdrstop
  17. VOID
  18. SepRmSetAuditLogWrkr(
  19. IN PRM_COMMAND_MESSAGE CommandMessage,
  20. OUT PRM_REPLY_MESSAGE ReplyMessage
  21. );
  22. #ifdef ALLOC_PRAGMA
  23. #pragma alloc_text(PAGE,SepRmSetAuditEventWrkr)
  24. #endif
  25. VOID
  26. SepRmSetAuditEventWrkr(
  27. IN PRM_COMMAND_MESSAGE CommandMessage,
  28. OUT PRM_REPLY_MESSAGE ReplyMessage
  29. )
  30. /*++
  31. Routine Description:
  32. This function carries out the Reference Monitor Set Audit Event
  33. Command. This command enables or disables auditing and optionally
  34. sets the auditing events.
  35. Arguments:
  36. CommandMessage - Pointer to structure containing RM command message
  37. information consisting of an LPC PORT_MESSAGE structure followed
  38. by the command number (RmSetAuditStateCommand) and a single command
  39. parameter in structure form.
  40. ReplyMessage - Pointer to structure containing RM reply message
  41. information consisting of an LPC PORT_MESSAGE structure followed
  42. by the command ReturnedStatus field in which a status code from the
  43. command will be returned.
  44. Return Value:
  45. VOID
  46. --*/
  47. {
  48. PPOLICY_AUDIT_EVENT_OPTIONS EventAuditingOptions;
  49. POLICY_AUDIT_EVENT_TYPE EventType;
  50. PAGED_CODE();
  51. SepAdtInitializeBounds();
  52. ReplyMessage->ReturnedStatus = STATUS_SUCCESS;
  53. //
  54. // Strict check that command is correct one for this worker.
  55. //
  56. ASSERT( CommandMessage->CommandNumber == RmAuditSetCommand );
  57. //
  58. // Extract the AuditingMode flag and put it in the right place.
  59. //
  60. SepAdtAuditingEnabled = (((PLSARM_POLICY_AUDIT_EVENTS_INFO) CommandMessage->CommandParams)->
  61. AuditingMode);
  62. //
  63. // For each element in the passed array, process changes to audit
  64. // nothing, and then success or failure flags.
  65. //
  66. EventAuditingOptions = ((PLSARM_POLICY_AUDIT_EVENTS_INFO) CommandMessage->CommandParams)->
  67. EventAuditingOptions;
  68. for ( EventType=AuditEventMinType;
  69. EventType <= AuditEventMaxType;
  70. EventType++ ) {
  71. SeAuditingState[EventType].AuditOnSuccess = FALSE;
  72. SeAuditingState[EventType].AuditOnFailure = FALSE;
  73. if ( EventAuditingOptions[EventType] & POLICY_AUDIT_EVENT_SUCCESS ) {
  74. SeAuditingState[EventType].AuditOnSuccess = TRUE;
  75. }
  76. if ( EventAuditingOptions[EventType] & POLICY_AUDIT_EVENT_FAILURE ) {
  77. SeAuditingState[EventType].AuditOnFailure = TRUE;
  78. }
  79. }
  80. return;
  81. }