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