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.

199 lines
4.5 KiB

  1. #ifndef _TRACE_H
  2. #define _TRACE_H
  3. /*++
  4. Copyright (c) 2000 Microsoft Corporation
  5. Module Name:
  6. trace.h
  7. Abstract:
  8. Include file to contain variables required for event tracing
  9. for NTLM
  10. Author:
  11. 15-June-2000 Jason Clark
  12. Revision History:
  13. --*/
  14. //
  15. //
  16. //
  17. #include <nt.h>
  18. #include <ntrtl.h>
  19. #include <nturtl.h>
  20. #include <windows.h>
  21. #include <wtypes.h>
  22. #ifdef __cplusplus
  23. extern "C"
  24. {
  25. #endif // __cplusplus
  26. #include <wmistr.h>
  27. #include <evntrace.h>
  28. #ifdef __cplusplus
  29. }
  30. #endif // __cplusplus
  31. EXTERN_C BOOL NtlmGlobalEventTraceFlag;
  32. EXTERN_C TRACEHANDLE NtlmGlobalTraceRegistrationHandle;
  33. EXTERN_C TRACEHANDLE NtlmGlobalTraceLoggerHandle;
  34. EXTERN_C
  35. ULONG
  36. NtlmInitializeTrace();
  37. // Helper macros for populating the trace
  38. #define SET_TRACE_DATA(TraceVar, MofNum, Data) \
  39. { \
  40. TraceVar.eventInfo[MofNum].DataPtr = (ULONGLONG) &Data; \
  41. TraceVar.eventInfo[MofNum].Length = sizeof(Data); \
  42. }
  43. #define SET_TRACE_DATAPTR(TraceVar, MofNum, Data) \
  44. { \
  45. TraceVar.eventInfo[MofNum].DataPtr = (ULONGLONG) Data; \
  46. TraceVar.eventInfo[MofNum].Length = sizeof(*Data); \
  47. }
  48. #define SET_TRACE_USTRING(TraceVar, MofNum, UString) \
  49. { \
  50. TraceVar.eventInfo[MofNum].DataPtr = (ULONGLONG) &UString.Length; \
  51. TraceVar.eventInfo[MofNum].Length = sizeof(UString.Length) ; \
  52. TraceVar.eventInfo[MofNum+1].DataPtr = (ULONGLONG) UString.Buffer; \
  53. TraceVar.eventInfo[MofNum+1].Length = UString.Length ; \
  54. }
  55. #define SET_TRACE_HEADER(TraceVar, TheGuid, TheType, TheFlags, NumMofs) \
  56. { \
  57. TraceVar.EventTrace.Guid = TheGuid; \
  58. TraceVar.EventTrace.Class.Type = TheType; \
  59. TraceVar.EventTrace.Flags = TheFlags; \
  60. TraceVar.EventTrace.Size = sizeof(EVENT_TRACE_HEADER)+ \
  61. sizeof(MOF_FIELD) * NumMofs ; \
  62. }
  63. // Helper defines for populating the Init/Accept trace
  64. #define TRACE_INITACC_STAGEHINT 0
  65. #define TRACE_INITACC_INCONTEXT 1
  66. #define TRACE_INITACC_OUTCONTEXT 2
  67. #define TRACE_INITACC_STATUS 3
  68. #define TRACE_INITACC_CLIENTNAME 4
  69. #define TRACE_INITACC_CLIENTDOMAIN 6
  70. #define TRACE_INITACC_WORKSTATION 8
  71. // Helper defines for populating the Logon trace
  72. #define TRACE_LOGON_STATUS 0
  73. #define TRACE_LOGON_TYPE 1
  74. #define TRACE_LOGON_USERNAME 2
  75. #define TRACE_LOGON_DOMAINNAME 4
  76. // Helper defines for populating the Validate trace
  77. #define TRACE_VALIDATE_SUCCESS 0
  78. #define TRACE_VALIDATE_SERVER 1
  79. #define TRACE_VALIDATE_DOMAIN 3
  80. #define TRACE_VALIDATE_USERNAME 5
  81. #define TRACE_VALIDATE_WORKSTATION 7
  82. // Helper defines for populating the Passthrough trace
  83. #define TRACE_PASSTHROUGH_DOMAIN 0
  84. #define TRACE_PASSTHROUGH_PACKAGE 2
  85. // Accept stage hints
  86. #define TRACE_ACCEPT_NEGOTIATE 1
  87. #define TRACE_ACCEPT_AUTHENTICATE 2
  88. #define TRACE_ACCEPT_INFO 3
  89. // Init stage hints
  90. #define TRACE_INIT_FIRST 1
  91. #define TRACE_INIT_CHALLENGE 2
  92. // The current limit is 16 MOF fields.
  93. // Each UNICODE strings needs two MOF fields.
  94. typedef struct _NTLM_TRACE_INFO
  95. {
  96. EVENT_TRACE_HEADER EventTrace;
  97. MOF_FIELD eventInfo[MAX_MOF_FIELDS];
  98. } NTLM_TRACE_INFO, *PNTLM_TRACE_INFO;
  99. //
  100. // This is the control Guid for the group of Guids traced below
  101. //
  102. DEFINE_GUID( // {C92CF544-91B3-4dc0-8E11-C580339A0BF8}
  103. NtlmControlGuid,
  104. 0xc92cf544,
  105. 0x91b3,
  106. 0x4dc0,
  107. 0x8e, 0x11, 0xc5, 0x80, 0x33, 0x9a, 0xb, 0xf8);
  108. //
  109. // This is the Accept guid
  110. //
  111. DEFINE_GUID( // {94D4C9EB-0D01-41ae-99E8-15B26B593A83}
  112. NtlmAcceptGuid,
  113. 0x94d4c9eb,
  114. 0xd01,
  115. 0x41ae,
  116. 0x99, 0xe8, 0x15, 0xb2, 0x6b, 0x59, 0x3a, 0x83);
  117. //
  118. // This is the Initialize guid
  119. //
  120. DEFINE_GUID( // {6DF28B22-73BE-45cc-BA80-8B332B35A21D}
  121. NtlmInitializeGuid,
  122. 0x6df28b22,
  123. 0x73be,
  124. 0x45cc,
  125. 0xba, 0x80, 0x8b, 0x33, 0x2b, 0x35, 0xa2, 0x1d);
  126. //
  127. // This is the LogonUser guid
  128. //
  129. DEFINE_GUID( // {19196B33-A302-4c12-9D5A-EAC149E93C46}
  130. NtlmLogonGuid,
  131. 0x19196b33,
  132. 0xa302,
  133. 0x4c12,
  134. 0x9d, 0x5a, 0xea, 0xc1, 0x49, 0xe9, 0x3c, 0x46);
  135. //
  136. // This is the NTLM Password Validate
  137. //
  138. DEFINE_GUID( // {34D84181-C28A-41d8-BB9E-995190DF83DF}
  139. NtlmValidateGuid,
  140. 0x34d84181,
  141. 0xc28a,
  142. 0x41d8,
  143. 0xbb, 0x9e, 0x99, 0x51, 0x90, 0xdf, 0x83, 0xdf);
  144. //
  145. // This is the GenericPassthrough Trace Guid
  146. //
  147. DEFINE_GUID( // {21ABB5D9-8EEC-46e4-9D1C-F09DD57CF70B}
  148. NtlmGenericPassthroughGuid,
  149. 0x21abb5d9,
  150. 0x8eec,
  151. 0x46e4,
  152. 0x9d, 0x1c, 0xf0, 0x9d, 0xd5, 0x7c, 0xf7, 0xb);
  153. #endif /* _TRACE_H */