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.

231 lines
5.8 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. ntrmlsa.h
  5. Abstract:
  6. Local Security Authority - Reference Monitor Communication Types
  7. Author:
  8. Scott Birrell (ScottBi) March 18, 1991
  9. Environment:
  10. Revision History:
  11. --*/
  12. #include <ntlsa.h>
  13. #ifndef _NTRMLSA_
  14. #define _NTRMLSA_
  15. //
  16. // Memory type. This defines the type of memory used for a record
  17. // passed between the RM and LSA.
  18. //
  19. // SepRmLsaPortMemory - Memory allocated via RtlAllocateHeap()
  20. // from the shared memory section associated with the
  21. // Lsa command Port.
  22. //
  23. // SepRmLsaVirtualMemory - Memory allocated via ZwAllocateVirtualMemory()
  24. //
  25. // SepRmLsaUnreadableMemory - Memory not readable by the LSA. This
  26. // memory must be copied to another format
  27. // before passage over the link.
  28. //
  29. // SepRmLsaLPCBufferMemory - Memory contained within the LPC buffer
  30. // itself
  31. //
  32. typedef enum _SEP_RM_LSA_MEMORY_TYPE {
  33. SepRmNoMemory = 0,
  34. SepRmImmediateMemory,
  35. SepRmLsaCommandPortSharedMemory,
  36. SepRmLsaCustomSharedMemory,
  37. SepRmPagedPoolMemory,
  38. SepRmUnspecifiedMemory
  39. } SEP_RM_LSA_MEMORY_TYPE, *PSEP_RM_LSA_MEMORY_TYPE;
  40. //
  41. // Reference Monitor Command Message Structure. This structure is used
  42. // by the Local Security Authority to send commands to the Reference Monitor
  43. // via the Reference Monitor Server Command LPC Port.
  44. //
  45. #define RmMinimumCommand RmAuditSetCommand
  46. #define RmMaximumCommand RmDeleteLogonSession
  47. //
  48. // Keep this in sync with SEP_RM_COMMAND_WORKER in se\rmmain.c
  49. //
  50. typedef enum _RM_COMMAND_NUMBER {
  51. RmDummyCommand = 0,
  52. RmAuditSetCommand,
  53. RmCreateLogonSession,
  54. RmDeleteLogonSession
  55. } RM_COMMAND_NUMBER;
  56. #define RM_MAXIMUM_COMMAND_PARAM_SIZE \
  57. ((ULONG) PORT_MAXIMUM_MESSAGE_LENGTH - sizeof(PORT_MESSAGE) - \
  58. sizeof(RM_COMMAND_NUMBER))
  59. typedef struct _RM_COMMAND_MESSAGE {
  60. PORT_MESSAGE MessageHeader;
  61. RM_COMMAND_NUMBER CommandNumber;
  62. UCHAR CommandParams[RM_MAXIMUM_COMMAND_PARAM_SIZE];
  63. } RM_COMMAND_MESSAGE, *PRM_COMMAND_MESSAGE;
  64. //
  65. // Reference Monitor Command Reply Message Structure.
  66. //
  67. #define RM_MAXIMUM_REPLY_BUFFER_SIZE \
  68. ((ULONG) PORT_MAXIMUM_MESSAGE_LENGTH - sizeof(PORT_MESSAGE) - \
  69. sizeof(RM_COMMAND_NUMBER))
  70. typedef struct _RM_REPLY_MESSAGE {
  71. PORT_MESSAGE MessageHeader;
  72. NTSTATUS ReturnedStatus;
  73. UCHAR ReplyBuffer[RM_MAXIMUM_REPLY_BUFFER_SIZE];
  74. } RM_REPLY_MESSAGE, *PRM_REPLY_MESSAGE;
  75. #define RM_COMMAND_MESSAGE_HEADER_SIZE \
  76. (sizeof(PORT_MESSAGE) + sizeof(NTSTATUS) + sizeof(RM_COMMAND_NUMBER))
  77. //
  78. // Local Security Authority Command Message Structure. This structure is
  79. // used by the Reference Monitor to send commands to the Local Security
  80. // Authority via the LSA Server Command LPC Port.
  81. //
  82. #define LsapMinimumCommand LsapWriteAuditMessageCommand
  83. #define LsapMaximumCommand LsapLogonSessionDeletedCommand
  84. typedef enum _LSA_COMMAND_NUMBER {
  85. LsapDummyCommand = 0,
  86. LsapWriteAuditMessageCommand,
  87. LsapComponentTestCommand,
  88. LsapLogonSessionDeletedCommand
  89. } LSA_COMMAND_NUMBER;
  90. #define LSA_MAXIMUM_COMMAND_PARAM_SIZE \
  91. ((ULONG) PORT_MAXIMUM_MESSAGE_LENGTH - sizeof(PORT_MESSAGE) - \
  92. sizeof(LSA_COMMAND_NUMBER) - sizeof(SEP_RM_LSA_MEMORY_TYPE))
  93. typedef struct _LSA_COMMAND_MESSAGE {
  94. PORT_MESSAGE MessageHeader;
  95. LSA_COMMAND_NUMBER CommandNumber;
  96. SEP_RM_LSA_MEMORY_TYPE CommandParamsMemoryType;
  97. UCHAR CommandParams[LSA_MAXIMUM_COMMAND_PARAM_SIZE];
  98. } LSA_COMMAND_MESSAGE, *PLSA_COMMAND_MESSAGE;
  99. //
  100. // LSA Command Reply Message Structure.
  101. //
  102. #define LSA_MAXIMUM_REPLY_BUFFER_SIZE \
  103. ((ULONG) PORT_MAXIMUM_MESSAGE_LENGTH - sizeof(PORT_MESSAGE) - \
  104. sizeof(LSA_COMMAND_NUMBER))
  105. typedef struct _LSA_REPLY_MESSAGE {
  106. PORT_MESSAGE MessageHeader;
  107. NTSTATUS ReturnedStatus;
  108. UCHAR ReplyBuffer[LSA_MAXIMUM_REPLY_BUFFER_SIZE];
  109. } LSA_REPLY_MESSAGE, *PLSA_REPLY_MESSAGE;
  110. //
  111. // Command Parameter format for the special RmSendCommandToLsaCommand
  112. //
  113. typedef struct _RM_SEND_COMMAND_TO_LSA_PARAMS {
  114. LSA_COMMAND_NUMBER LsaCommandNumber;
  115. ULONG LsaCommandParamsLength;
  116. UCHAR LsaCommandParams[LSA_MAXIMUM_COMMAND_PARAM_SIZE];
  117. } RM_SEND_COMMAND_TO_LSA_PARAMS, *PRM_SEND_COMMAND_TO_LSA_PARAMS;
  118. //
  119. // Command Values for the LSA and RM Component Test Commands
  120. //
  121. #define LSA_CT_COMMAND_PARAM_VALUE 0x00823543
  122. #define RM_CT_COMMAND_PARAM_VALUE 0x33554432
  123. //
  124. // Audit Record Pointer Field Type
  125. //
  126. typedef enum _SE_ADT_POINTER_FIELD_TYPE {
  127. NullFieldType,
  128. UnicodeStringType,
  129. SidType,
  130. PrivilegeSetType,
  131. MiscFieldType
  132. } SE_ADT_POINTER_FIELD_TYPE, *PSE_ADT_POINTER_FIELD_TYPE;
  133. //
  134. // Hardwired Audit Event Type counts
  135. //
  136. #define AuditEventMinType (AuditCategorySystem)
  137. #define AuditEventMaxType (AuditCategoryAccountLogon)
  138. #define POLICY_AUDIT_EVENT_TYPE_COUNT \
  139. ((ULONG) AuditEventMaxType - AuditEventMinType + 1)
  140. #define LSARM_AUDIT_EVENT_OPTIONS_SIZE \
  141. (((ULONG)(POLICY_AUDIT_EVENT_TYPE_COUNT) * sizeof (POLICY_AUDIT_EVENT_OPTIONS)))
  142. //
  143. // Self-Relative form of POLICY_AUDIT_EVENTS_INFO
  144. //
  145. typedef struct _LSARM_POLICY_AUDIT_EVENTS_INFO {
  146. BOOLEAN AuditingMode;
  147. POLICY_AUDIT_EVENT_OPTIONS EventAuditingOptions[POLICY_AUDIT_EVENT_TYPE_COUNT];
  148. ULONG MaximumAuditEventCount;
  149. } LSARM_POLICY_AUDIT_EVENTS_INFO, *PLSARM_POLICY_AUDIT_EVENTS_INFO;
  150. //
  151. // The following symbol defines the value containing whether or not we're supposed
  152. // to crash when an audit fails. It is used in the se and lsasrv directories.
  153. //
  154. #define CRASH_ON_AUDIT_FAIL_VALUE L"CrashOnAuditFail"
  155. //
  156. // These are the possible values for the CrashOnAuditFail flag.
  157. //
  158. #define LSAP_CRASH_ON_AUDIT_FAIL 1
  159. #define LSAP_ALLOW_ADIMIN_LOGONS_ONLY 2
  160. #endif // _NTRMLSA_