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.

311 lines
8.2 KiB

  1. #ifndef _LSAWMI_H
  2. #define _LSAWMI_H
  3. /*++
  4. copyright (c) 1998 Microsoft Corporation
  5. Module Name:
  6. LSAWMI.H
  7. Abstract:
  8. Implement LSA server event trace by using WMI trace infrastructure.
  9. Author:
  10. 16-March-1999 kumarp
  11. Revision History:
  12. --*/
  13. #include <wmistr.h>
  14. #include <evntrace.h>
  15. extern ULONG LsapEventTraceFlag;
  16. extern TRACEHANDLE LsapTraceRegistrationHandle;
  17. extern TRACEHANDLE LsapTraceLoggerHandle;
  18. //
  19. // The following "typedef enum" actually is the index of
  20. // TRACE_GUID_REGISTRATION struct entry in the array LsapTraceGuids[].
  21. // Each enum defines an event that is to be traced using WMI tracing.
  22. //
  23. // To add WMI tracing to a function Foo do the following steps:
  24. // - add an entry (LsaTraceEvent_Foo) to LSA_TRACE_EVENT_TYPE below
  25. // - generate a new guid using uuidgen.exe -s
  26. // - add a DEFINE_GUID entry at the end of this file using this guid
  27. // - add a corresponding entry (LsaTraceEventGuid_Foo) to LsapTraceGuids[]
  28. // - add a corresponding entry to lsasrv.mof file
  29. // - at the beginning of function Foo insert the following call:
  30. // LsapTraceEvent(EVENT_TRACE_TYPE_START, LsaTraceEvent_Foo);
  31. // - at the end of function Foo insert the following call:
  32. // LsapTraceEvent(EVENT_TRACE_TYPE_END, LsaTraceEvent_Foo);
  33. //
  34. // Make sure that Foo returns only from one location, otherwise the
  35. // LsapTraceEvent calls will not be balanced.
  36. //
  37. typedef enum _LSA_TRACE_EVENT_TYPE {
  38. LsaTraceEvent_QuerySecret=0,
  39. LsaTraceEvent_Close,
  40. LsaTraceEvent_OpenPolicy,
  41. LsaTraceEvent_QueryInformationPolicy,
  42. LsaTraceEvent_SetInformationPolicy,
  43. LsaTraceEvent_EnumerateTrustedDomains,
  44. LsaTraceEvent_LookupNames,
  45. LsaTraceEvent_LookupSids,
  46. LsaTraceEvent_OpenTrustedDomain,
  47. LsaTraceEvent_QueryInfoTrustedDomain,
  48. LsaTraceEvent_SetInformationTrustedDomain,
  49. // LsaTraceEvent_QueryInformationPolicy2,
  50. // LsaTraceEvent_SetInformationPolicy2,
  51. LsaTraceEvent_QueryTrustedDomainInfoByName,
  52. LsaTraceEvent_SetTrustedDomainInfoByName,
  53. LsaTraceEvent_EnumerateTrustedDomainsEx,
  54. LsaTraceEvent_CreateTrustedDomainEx,
  55. LsaTraceEvent_QueryDomainInformationPolicy,
  56. LsaTraceEvent_SetDomainInformationPolicy,
  57. LsaTraceEvent_OpenTrustedDomainByName,
  58. LsaTraceEvent_QueryForestTrustInformation,
  59. LsaTraceEvent_SetForestTrustInformation,
  60. LsaTraceEvent_LookupIsolatedNameInTrustedDomains,
  61. } LSA_TRACE_EVENT_TYPE;
  62. NTSTATUS
  63. LsapStartWmiTraceInitThread(void);
  64. #ifdef __cplusplus
  65. extern "C" {
  66. #endif // __cplusplus
  67. VOID
  68. LsapTraceEvent(
  69. IN ULONG WmiEventType,
  70. IN LSA_TRACE_EVENT_TYPE LsaTraceEventType
  71. );
  72. VOID
  73. LsapTraceEventWithData(
  74. IN ULONG WmiEventType,
  75. IN LSA_TRACE_EVENT_TYPE LsaTraceEventType,
  76. IN ULONG ItemCount,
  77. IN PUNICODE_STRING Items OPTIONAL
  78. );
  79. LPWSTR
  80. LsapGetClientNetworkAddress(
  81. VOID
  82. );
  83. #ifdef __cplusplus
  84. }
  85. #endif // __cplusplus
  86. //
  87. // Control GUID for the group of GUIDs that define LSA WMI tracing
  88. //
  89. DEFINE_GUID ( /* cc85922f-db41-11d2-9244-006008269001 */
  90. LsapTraceControlGuid,
  91. 0xcc85922f,
  92. 0xdb41,
  93. 0x11d2,
  94. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  95. );
  96. DEFINE_GUID ( /* cc85922e-db41-11d2-9244-006008269001 */
  97. LsapTraceEventGuid_QuerySecret,
  98. 0xcc85922e,
  99. 0xdb41,
  100. 0x11d2,
  101. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  102. );
  103. DEFINE_GUID ( /* 2306fe3b-dbf6-11d2-9244-006008269001 */
  104. LsaTraceEventGuid_Close,
  105. 0x2306fe3b,
  106. 0xdbf6,
  107. 0x11d2,
  108. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  109. );
  110. DEFINE_GUID ( /* 2306fe3a-dbf6-11d2-9244-006008269001 */
  111. LsaTraceEventGuid_OpenPolicy,
  112. 0x2306fe3a,
  113. 0xdbf6,
  114. 0x11d2,
  115. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  116. );
  117. DEFINE_GUID ( /* 2306fe39-dbf6-11d2-9244-006008269001 */
  118. LsaTraceEventGuid_QueryInformationPolicy,
  119. 0x2306fe39,
  120. 0xdbf6,
  121. 0x11d2,
  122. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  123. );
  124. DEFINE_GUID ( /* 2306fe38-dbf6-11d2-9244-006008269001 */
  125. LsaTraceEventGuid_SetInformationPolicy,
  126. 0x2306fe38,
  127. 0xdbf6,
  128. 0x11d2,
  129. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  130. );
  131. DEFINE_GUID ( /* 2306fe37-dbf6-11d2-9244-006008269001 */
  132. LsaTraceEventGuid_EnumerateTrustedDomains,
  133. 0x2306fe37,
  134. 0xdbf6,
  135. 0x11d2,
  136. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  137. );
  138. DEFINE_GUID ( /* 2306fe36-dbf6-11d2-9244-006008269001 */
  139. LsaTraceEventGuid_LookupNames,
  140. 0x2306fe36,
  141. 0xdbf6,
  142. 0x11d2,
  143. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  144. );
  145. DEFINE_GUID ( /* 2306fe35-dbf6-11d2-9244-006008269001 */
  146. LsaTraceEventGuid_LookupSids,
  147. 0x2306fe35,
  148. 0xdbf6,
  149. 0x11d2,
  150. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  151. );
  152. DEFINE_GUID ( /* 2306fe34-dbf6-11d2-9244-006008269001 */
  153. LsaTraceEventGuid_OpenTrustedDomain,
  154. 0x2306fe34,
  155. 0xdbf6,
  156. 0x11d2,
  157. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  158. );
  159. DEFINE_GUID ( /* 2306fe33-dbf6-11d2-9244-006008269001 */
  160. LsaTraceEventGuid_QueryInfoTrustedDomain,
  161. 0x2306fe33,
  162. 0xdbf6,
  163. 0x11d2,
  164. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  165. );
  166. DEFINE_GUID ( /* 2306fe32-dbf6-11d2-9244-006008269001 */
  167. LsaTraceEventGuid_SetInformationTrustedDomain,
  168. 0x2306fe32,
  169. 0xdbf6,
  170. 0x11d2,
  171. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  172. );
  173. // DEFINE_GUID ( /* 2306fe31-dbf6-11d2-9244-006008269001 */
  174. // LsaTraceEventGuid_QueryInformationPolicy2,
  175. // 0x2306fe31,
  176. // 0xdbf6,
  177. // 0x11d2,
  178. // 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  179. // );
  180. // DEFINE_GUID ( /* 2306fe30-dbf6-11d2-9244-006008269001 */
  181. // LsaTraceEventGuid_SetInformationPolicy2,
  182. // 0x2306fe30,
  183. // 0xdbf6,
  184. // 0x11d2,
  185. // 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  186. // );
  187. DEFINE_GUID ( /* 2306fe2f-dbf6-11d2-9244-006008269001 */
  188. LsaTraceEventGuid_QueryTrustedDomainInfoByName,
  189. 0x2306fe2f,
  190. 0xdbf6,
  191. 0x11d2,
  192. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  193. );
  194. DEFINE_GUID ( /* 2306fe2e-dbf6-11d2-9244-006008269001 */
  195. LsaTraceEventGuid_SetTrustedDomainInfoByName,
  196. 0x2306fe2e,
  197. 0xdbf6,
  198. 0x11d2,
  199. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  200. );
  201. DEFINE_GUID ( /* 2306fe2d-dbf6-11d2-9244-006008269001 */
  202. LsaTraceEventGuid_EnumerateTrustedDomainsEx,
  203. 0x2306fe2d,
  204. 0xdbf6,
  205. 0x11d2,
  206. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  207. );
  208. DEFINE_GUID ( /* 2306fe2c-dbf6-11d2-9244-006008269001 */
  209. LsaTraceEventGuid_CreateTrustedDomainEx,
  210. 0x2306fe2c,
  211. 0xdbf6,
  212. 0x11d2,
  213. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  214. );
  215. DEFINE_GUID ( /* 2306fe2b-dbf6-11d2-9244-006008269001 */
  216. LsaTraceEventGuid_QueryDomainInformationPolicy,
  217. 0x2306fe2b,
  218. 0xdbf6,
  219. 0x11d2,
  220. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  221. );
  222. DEFINE_GUID ( /* 2306fe2a-dbf6-11d2-9244-006008269001 */
  223. LsaTraceEventGuid_SetDomainInformationPolicy,
  224. 0x2306fe2a,
  225. 0xdbf6,
  226. 0x11d2,
  227. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  228. );
  229. DEFINE_GUID ( /* 2306fe29-dbf6-11d2-9244-006008269001 */
  230. LsaTraceEventGuid_OpenTrustedDomainByName,
  231. 0x2306fe29,
  232. 0xdbf6,
  233. 0x11d2,
  234. 0x92, 0x44, 0x00, 0x60, 0x08, 0x26, 0x90, 0x01
  235. );
  236. DEFINE_GUID ( /* e28ee0eb-6181-49df-b859-2f3fd289a2d1 */
  237. LsaTraceEventGuid_QueryForestTrustInformation,
  238. 0xe28ee0eb,
  239. 0x6181,
  240. 0x49df,
  241. 0xb8, 0x59, 0x2f, 0x3f, 0xd2, 0x89, 0xa2, 0xd1
  242. );
  243. DEFINE_GUID ( /* 3d2c9e3e-bb19-4617-8489-cabb9787de7d */
  244. LsaTraceEventGuid_SetForestTrustInformation,
  245. 0x3d2c9e3e,
  246. 0xbb19,
  247. 0x4617,
  248. 0x84, 0x89, 0xca, 0xbb, 0x97, 0x87, 0xde, 0x7d
  249. );
  250. DEFINE_GUID ( /* 2484dc26-49d3-4085-a6e4-4972115cb3c0 */
  251. LsaTraceEventGuid_LookupIsolatedNameInTrustedDomains,
  252. 0x2484dc26,
  253. 0x49d3,
  254. 0x4085,
  255. 0xa6, 0xe4, 0x49, 0x72, 0x11, 0x5c, 0xb3, 0xc0
  256. );
  257. #endif /* _LSAWMI_H */