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.

146 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. wmimap.h
  5. Abstract:
  6. ACPI to WMI mapping layer
  7. Author:
  8. Alan Warwick
  9. Environment:
  10. Kernel mode
  11. Revision History:
  12. --*/
  13. #if DBG
  14. extern ULONG WmiAcpiDebug;
  15. #define WmiAcpiPrint(l,m) if(l & WmiAcpiDebug) DbgPrint m
  16. #else
  17. #define WmiAcpiPrint(l,m)
  18. #endif
  19. #define WmiAcpiError 0x00000001
  20. #define WmiAcpiWarning 0x00000002
  21. #define WmiAcpiBasicTrace 0x00000004
  22. #define WmiAcpiQueryTrace 0x00000010
  23. #define WmiAcpiSetTrace 0x00000020
  24. #define WmiAcpiMethodTrace 0x00000040
  25. #define WmiAcpiEventTrace 0x00000080
  26. #define WmiAcpiFncCtlTrace 0x00000100
  27. #define WmiAcpiRegInfoTrace 0x00000200
  28. #define WmiAcpiEvalTrace 0x00001000
  29. #define ACPI_EVAL_OUTPUT_FUDGE sizeof(ACPI_EVAL_OUTPUT_BUFFER)
  30. #define WmiAcpiPoolTag 'AimW'
  31. typedef struct
  32. {
  33. GUID Guid;
  34. union
  35. {
  36. CHAR ObjectId[2];
  37. struct
  38. {
  39. UCHAR NotificationValue;
  40. UCHAR Reserved;
  41. } NotifyId;
  42. };
  43. USHORT Flags;
  44. } WMIACPIMAPINFO, *PWMIACPIMAPINFO;
  45. #define WmiAcpiMethodToMethodAsUlong(c1, c2, c3, c4) \
  46. ((ULONG)( c1 | (c2 << 8) | (c3 << 16) | (c4 << 24)))
  47. #define _WDGMethodAsULONG (WmiAcpiMethodToMethodAsUlong('_','W','D','G'))
  48. #define _WEDMethodAsULONG (WmiAcpiMethodToMethodAsUlong('_','W','E','D'))
  49. typedef struct
  50. {
  51. GUID Guid; // Guid that names data block
  52. union
  53. {
  54. CHAR ObjectId[2]; // 2 character ACPI id for Data Blocks and Methods
  55. struct
  56. {
  57. UCHAR NotificationValue; // Byte value passed by event handler control method
  58. UCHAR Reserved[1];
  59. } NotifyId;
  60. };
  61. UCHAR InstanceCount;
  62. UCHAR Flags;
  63. } WMIACPIGUIDMAP, *PWMIACPIGUIDMAP;
  64. // Set this flag if the WCxx control method should be run to whenever
  65. // the first data consumer is interested in collecting the data block
  66. // and whenever the last data consumer is no longer interested.
  67. #define WMIACPI_REGFLAG_EXPENSIVE 0x1
  68. // Set this flag if the guid represents a set of WMI method calls and
  69. // not a data block
  70. #define WMIACPI_REGFLAG_METHOD 0x2
  71. // Set this flag if the data block is wholly composed of a string
  72. // and should be translated from ASCIZ to UNICODE in returning queries
  73. // and from UNICODE to ASCIZ when
  74. // passing sets
  75. #define WMIACPI_REGFLAG_STRING 0x04
  76. // Set this flag if the guid maps to an event rather than a data block
  77. // or method
  78. #define WMIACPI_REGFLAG_EVENT 0x08
  79. typedef struct
  80. {
  81. WORK_QUEUE_ITEM WorkQueueItem;
  82. PVOID CallerContext;
  83. PWORKER_THREAD_ROUTINE CallerWorkItemRoutine;
  84. PDEVICE_OBJECT DeviceObject;
  85. ULONG Status;
  86. PUCHAR OutBuffer;
  87. ULONG OutBufferSize;
  88. } IRP_CONTEXT_BLOCK, *PIRP_CONTEXT_BLOCK;
  89. //
  90. // This defines the maximum size for the data returned from the _WED method
  91. // and thus the maximum size of the data associated with an event
  92. #define _WEDBufferSize 512
  93. //
  94. // Device extension for WMI acpi mapping devices
  95. typedef struct
  96. {
  97. PDEVICE_OBJECT LowerDeviceObject;
  98. PDEVICE_OBJECT LowerPDO;
  99. ULONG GuidMapCount;
  100. PWMIACPIMAPINFO WmiAcpiMapInfo;
  101. ULONG Flags;
  102. WMILIB_CONTEXT WmilibContext;
  103. ACPI_INTERFACE_STANDARD WmiAcpiDirectInterface;
  104. BOOLEAN AcpiNotificationEnabled;
  105. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  106. //
  107. // If this flag is set that means that the device has been removed from the
  108. // system and any requests sent to it should be rejected. The only memory
  109. // that can be relied upon is the DeviceExtension, but nothing that the
  110. // device extension points to.
  111. #define DEVFLAG_REMOVED 0x00000001
  112. //
  113. // If this flag is set then the device has successfully registered with WMI
  114. #define DEVFLAG_WMIREGED 0x00000002