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.

97 lines
2.7 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 the definitions 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 <stddef.h>
  13. #include <stdarg.h>
  14. #include <wmistr.h>
  15. #if defined(WPP_TRACE_W2K_COMPATABILITY)
  16. DEFINE_GUID(WPP_TRACE_CONTROL_NULL_GUID, 0x00000000L, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
  17. #endif
  18. #if !defined(_NTRTL_)
  19. // fake RTL_TIME_ZONE_INFORMATION //
  20. typedef int RTL_TIME_ZONE_INFORMATION;
  21. # define _WMIKM_
  22. #endif
  23. #ifndef WPP_TRACE
  24. #define WPP_TRACE WmiTraceMessage
  25. #endif
  26. __inline TRACEHANDLE WppQueryLogger(PWSTR LoggerName)
  27. {
  28. #ifndef WPP_TRACE_W2K_COMPATABILITY
  29. ULONG ReturnLength ;
  30. NTSTATUS Status ;
  31. TRACEHANDLE TraceHandle ;
  32. UNICODE_STRING Buffer ;
  33. if (!LoggerName) {
  34. LoggerName = L"stdout";
  35. }
  36. RtlInitUnicodeString(&Buffer, LoggerName);
  37. if ((Status = WmiQueryTraceInformation(TraceHandleByNameClass,
  38. (PVOID)&TraceHandle,
  39. sizeof(TraceHandle),
  40. &ReturnLength,
  41. (PVOID)&Buffer)) != STATUS_SUCCESS) {
  42. return 0 ;
  43. }
  44. return TraceHandle ;
  45. #else
  46. return (TRACEHANDLE) 0 ;
  47. #endif // #ifdef WPP_TRACE_W2K_COMPATABILITY
  48. }
  49. typedef NTSTATUS (*WMIENTRY_NEW)(
  50. IN UCHAR ActionCode,
  51. IN PVOID DataPath,
  52. IN ULONG BufferSize,
  53. IN OUT PVOID Buffer,
  54. IN PVOID Context,
  55. OUT PULONG Size
  56. );
  57. typedef struct _WPP_TRACE_CONTROL_BLOCK
  58. {
  59. WMIENTRY_NEW Callback;
  60. struct _WPP_TRACE_CONTROL_BLOCK *Next;
  61. __int64 Logger;
  62. UCHAR FlagsLen; UCHAR Level; USHORT Reserved;
  63. ULONG Flags[1];
  64. } WPP_TRACE_CONTROL_BLOCK, *PWPP_TRACE_CONTROL_BLOCK;
  65. typedef struct _WPP_REGISTRATION_BLOCK
  66. {
  67. WMIENTRY_NEW Callback;
  68. struct _WPP_REGISTRATION_BLOCK *Next;
  69. LPCGUID ControlGuid;
  70. LPCWSTR FriendlyName;
  71. LPCWSTR BitNames;
  72. PUNICODE_STRING RegistryPath;
  73. UCHAR FlagsLen, RegBlockLen;
  74. } WPP_REGISTRATION_BLOCK, *PWPP_REGISTRATION_BLOCK;