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.

87 lines
2.6 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_W2K_COMPATABILITY
  17. #include <sddl.h>
  18. #endif
  19. #ifndef WPP_TRACE
  20. #define WPP_TRACE TraceMessage
  21. #endif
  22. #ifndef WPP_TRACE_W2K_COMPATABILITY
  23. __inline TRACEHANDLE WppQueryLogger(PCWSTR LoggerName)
  24. {
  25. ULONG status;
  26. EVENT_TRACE_PROPERTIES LoggerInfo;
  27. ZeroMemory(&LoggerInfo, sizeof(LoggerInfo));
  28. LoggerInfo.Wnode.BufferSize = sizeof(LoggerInfo);
  29. LoggerInfo.Wnode.Flags = WNODE_FLAG_TRACED_GUID;
  30. status = QueryTraceW(0, LoggerName ? LoggerName : L"stdout", &LoggerInfo);
  31. if (status == ERROR_SUCCESS || status == ERROR_MORE_DATA) {
  32. return (TRACEHANDLE) LoggerInfo.Wnode.HistoricalContext;
  33. }
  34. return 0;
  35. }
  36. #endif // #ifdef WPP_TRACE_W2K_COMPATABILITY
  37. enum {
  38. WPP_VER_WIN2K_CB_FORWARD_PTR = 0x01,
  39. WPP_VER_WHISTLER_CB_FORWARD_PTR = 0x02
  40. };
  41. // LEGACY: This structure was used by Win2k RpcRt4 and cluster tracing
  42. typedef struct _WPP_WIN2K_CONTROL_BLOCK {
  43. TRACEHANDLE Logger;
  44. ULONG Flags;
  45. ULONG Level;
  46. } WPP_WIN2K_CONTROL_BLOCK, *PWPP_WIN2K_CONTROL_BLOCK;
  47. #pragma warning(push)
  48. #pragma warning(disable:4201) // nonstandard extension used nameless struct/union
  49. typedef struct _WPP_TRACE_CONTROL_BLOCK
  50. {
  51. struct _WPP_TRACE_CONTROL_BLOCK *Next;
  52. TRACEHANDLE UmRegistrationHandle;
  53. union {
  54. TRACEHANDLE Logger;
  55. PWPP_WIN2K_CONTROL_BLOCK Win2kCb;
  56. PVOID Ptr;
  57. struct _WPP_TRACE_CONTROL_BLOCK *Cb;
  58. };
  59. UCHAR FlagsLen; UCHAR Level; USHORT Options;
  60. ULONG Flags[1];
  61. } WPP_TRACE_CONTROL_BLOCK, *PWPP_TRACE_CONTROL_BLOCK;
  62. #pragma warning(pop)
  63. typedef struct _WPP_REGISTRATION_BLOCK
  64. {
  65. struct _WPP_REGISTRATION_BLOCK *Next;
  66. LPCGUID ControlGuid;
  67. LPCWSTR FriendlyName;
  68. LPCWSTR BitNames;
  69. UCHAR FlagsLen, RegBlockLen; USHORT Options;
  70. PVOID Ptr;
  71. } WPP_REGISTRATION_BLOCK, *PWPP_REGISTRATION_BLOCK;