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.

84 lines
2.4 KiB

  1. `**********************************************************************`
  2. `* This is an include template file for tracewpp preprocessor. *`
  3. `* *`
  4. `* Copyright 1999-2000 Microsoft Corporation. All Rights Reserved. *`
  5. `**********************************************************************`
  6. // template `TemplateFile`
  7. `* Dump defintions specified via -D on the command line to WPP *`
  8. `FORALL def IN MacroDefinitions`
  9. #define `def.Name` `def.Alias`
  10. `ENDFOR`
  11. #define WPP_THIS_FILE `SourceFile.CanonicalName`
  12. #include <windows.h>
  13. #pragma warning(disable: 4201)
  14. #include <wmistr.h>
  15. #include <evntrace.h>
  16. #ifndef WPP_TRACE
  17. #define WPP_TRACE TraceMessage
  18. #endif
  19. #ifndef WPP_TRACE_W2K_COMPATABILITY
  20. __inline TRACEHANDLE WppQueryLogger(PCWSTR LoggerName)
  21. {
  22. ULONG status;
  23. EVENT_TRACE_PROPERTIES LoggerInfo;
  24. ZeroMemory(&LoggerInfo, sizeof(LoggerInfo));
  25. LoggerInfo.Wnode.BufferSize = sizeof(LoggerInfo);
  26. LoggerInfo.Wnode.Flags = WNODE_FLAG_TRACED_GUID;
  27. status = QueryTraceW(0, LoggerName ? LoggerName : L"stdout", &LoggerInfo);
  28. if (status == ERROR_SUCCESS || status == ERROR_MORE_DATA) {
  29. return (TRACEHANDLE) LoggerInfo.Wnode.HistoricalContext;
  30. }
  31. return 0;
  32. }
  33. #endif // #ifdef WPP_TRACE_W2K_COMPATABILITY
  34. enum {
  35. WPP_VER_WIN2K_CB_FORWARD_PTR = 0x01,
  36. WPP_VER_WHISTLER_CB_FORWARD_PTR = 0x02
  37. };
  38. // LEGACY: This structure was used by Win2k RpcRt4 and cluster tracing
  39. typedef struct _WPP_WIN2K_CONTROL_BLOCK {
  40. TRACEHANDLE Logger;
  41. ULONG Flags;
  42. ULONG Level;
  43. } WPP_WIN2K_CONTROL_BLOCK, *PWPP_WIN2K_CONTROL_BLOCK;
  44. #pragma warning(push)
  45. #pragma warning(disable:4201) // nonstandard extension used nameless struct/union
  46. typedef struct _WPP_TRACE_CONTROL_BLOCK
  47. {
  48. struct _WPP_TRACE_CONTROL_BLOCK *Next;
  49. TRACEHANDLE UmRegistrationHandle;
  50. union {
  51. TRACEHANDLE Logger;
  52. PWPP_WIN2K_CONTROL_BLOCK Win2kCb;
  53. PVOID Ptr;
  54. struct _WPP_TRACE_CONTROL_BLOCK *Cb;
  55. };
  56. UCHAR FlagsLen; UCHAR Level; USHORT Options;
  57. ULONG Flags[1];
  58. } WPP_TRACE_CONTROL_BLOCK, *PWPP_TRACE_CONTROL_BLOCK;
  59. #pragma warning(pop)
  60. typedef struct _WPP_REGISTRATION_BLOCK
  61. {
  62. struct _WPP_REGISTRATION_BLOCK *Next;
  63. LPCGUID ControlGuid;
  64. LPCWSTR FriendlyName;
  65. LPCWSTR BitNames;
  66. UCHAR FlagsLen, RegBlockLen; USHORT Options;
  67. PVOID Ptr;
  68. } WPP_REGISTRATION_BLOCK, *PWPP_REGISTRATION_BLOCK;