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.

273 lines
7.7 KiB

  1. /*++
  2. Copyright (c) 1991-1999 Microsoft Corporation
  3. Module Name:
  4. ntddapmt.h
  5. Abstract:
  6. Public interface definitions for APMTEST.SYS, the
  7. Advanced Power Management UI test device driver.
  8. --*/
  9. #ifndef _NTDDAPMT_
  10. #define _NTDDAPMT_
  11. #if _MSC_VER > 1000
  12. #pragma once
  13. #endif
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. // APM_IOCTL_GET_VERSION
  18. // Gets the version of the installed APM device.
  19. //
  20. // lpvInBuffer: Not used for this operation, set to NULL.
  21. // lpvOutBuffer: Pointer to DWORD to receive the APM version.
  22. // Returned by APM_IOCTL_GET_VERSION
  23. #define APM_DRIVER_VERSION 0x0400
  24. #define APM_IOCTL_GET_VERSION 0x80FF0004
  25. // APM_IOCTL_GET_APM_BIOS_VERSION
  26. // Gets the version of the APM BIOS that APM has detected.
  27. //
  28. // lpvInBuffer: Not used for this operation, set to NULL.
  29. // lpvOutBuffer: Pointer to DWORD to receive the APM BIOS version.
  30. #define APM_IOCTL_GET_APM_BIOS_VERSION 0x80FF0008
  31. // APM_IOCTL_GET_PM_LEVEL
  32. // Gets the level of power management interaction between APM and the
  33. // APM BIOS.
  34. //
  35. // lpvInBuffer: Not used for this operation, set to NULL.
  36. // lpvOutBuffer: Pointer to DWORD to receive the current power management
  37. // level.
  38. #define APM_IOCTL_GET_PM_LEVEL 0x80FF000C
  39. // APM_IOCTL_SET_PM_LEVEL
  40. // Sets the level of power management interaction between APM and the
  41. // APM BIOS.
  42. //
  43. // lpvInBuffer: Pointer to APM_SET_PM_LEVEL_PARAM structure.
  44. // lpvOutBuffer: Pointer to DWORD to receive the APM return code.
  45. #define APM_IOCTL_SET_PM_LEVEL 0x80FF0010
  46. #define PMLEVEL_ADVANCED 0x0001
  47. typedef struct _APM_SET_PM_LEVEL_PARAM {
  48. DWORD PowerManagementLevel;
  49. } APM_SET_PM_LEVEL_PARAM;
  50. // APM_IOCTL_SET_DEVICE_STATE
  51. // Sets the power state (e.g., OFF) of the specified device ID. Not valid
  52. // for the system device (all devices power managed by the APM BIOS).
  53. //
  54. // lpvInBuffer: Pointer to APM_SET_DEVICE_PARAM structure.
  55. // lpvOutBuffer: Pointer to DWORD to receive the APM return code.
  56. #define APM_IOCTL_SET_DEVICE_STATE 0x80FF0014
  57. //
  58. // Power device ID type and standard IDs as defined by the APM 1.1
  59. // specification.
  60. //
  61. typedef DWORD POWER_DEVICE_ID;
  62. #define PDI_APM_BIOS 0x0000
  63. #define PDI_MANAGED_BY_APM_BIOS 0x0001
  64. #define PDI_MANAGED_BY_APM_BIOS_OLD 0xFFFF
  65. //
  66. // Power state type and standard power states as defined by the APM 1.1
  67. // specification.
  68. //
  69. #define PSTATE_APM_ENABLED 0x0000
  70. #define PSTATE_STANDBY 0x0001
  71. #define PSTATE_SUSPEND 0x0002
  72. #define PSTATE_OFF 0x0003
  73. typedef struct _APM_SET_DEVICE_PARAM {
  74. POWER_DEVICE_ID PowerDeviceID;
  75. DWORD PowerState;
  76. } APM_SET_DEVICE_PARAM;
  77. // APM_IOCTL_RESTORE_DEFAULTS
  78. // Reinitializes all APM BIOS power-on defaults.
  79. //
  80. // lpvInBuffer: Not used for this operation, set to NULL.
  81. // lpvOutBuffer: Pointer to DWORD to receive the APM return code.
  82. #define APM_IOCTL_RESTORE_DEFAULTS 0x80FF001C
  83. // APM_IOCTL_GET_STATUS
  84. // Gets the current power status of the specified device ID.
  85. //
  86. // lpvInBuffer: Pointer to APM_GET_STATUS_PARAM structure.
  87. // lpvOutBuffer: Pointer to DWORD to receive the APM return code.
  88. #define APM_IOCTL_GET_STATUS 0x80FF0020
  89. typedef struct _POWER_STATUS {
  90. BYTE PS_AC_Line_Status;
  91. BYTE PS_Battery_Status;
  92. BYTE PS_Battery_Flag;
  93. BYTE PS_Battery_Life_Percentage;
  94. WORD PS_Battery_Life_Time;
  95. } POWER_STATUS;
  96. typedef POWER_STATUS *LPPOWER_STATUS;
  97. typedef struct _APM_GET_STATUS_PARAM {
  98. POWER_DEVICE_ID PowerDeviceID;
  99. LPPOWER_STATUS lpPowerStatus;
  100. } APM_GET_STATUS_PARAM;
  101. // APM_IOCTL_GET_STATE
  102. // Gets the power state (e.g., OFF) of the specified device ID.
  103. //
  104. // lpvInBuffer: Pointer to APM_GET_STATE_PARAM structure.
  105. // lpvOutBuffer: Pointer to DWORD to receive the APM return code.
  106. #define APM_IOCTL_GET_STATE 0x80FF0024
  107. typedef struct _APM_GET_STATE_PARAM {
  108. POWER_DEVICE_ID PowerDeviceID;
  109. LPDWORD lpPowerState;
  110. } GET_STATE_PARAM;
  111. // APM_IOCTL_OEM_APM_FUNCTION
  112. // Calls an OEM defined APM BIOS extension.
  113. //
  114. // lpvInBuffer: Pointer to APM_OEM_APM_FUNCTION_PARAM structure.
  115. // lpvOutBuffer: Pointer to DWORD to receive the APM return code.
  116. #define APM_IOCTL_OEM_APM_FUNCTION 0x80FF0028
  117. //
  118. // OEM APM Register Structure used by _APM_OEM_APM_Function.
  119. //
  120. struct _OEM_APM_BYTE_REGS {
  121. WORD OEMAPM_Reserved1[6];
  122. BYTE OEMAPM_BL;
  123. BYTE OEMAPM_BH;
  124. WORD OEMAPM_Reserved2;
  125. BYTE OEMAPM_DL;
  126. BYTE OEMAPM_DH;
  127. WORD OEMAPM_Reserved3;
  128. BYTE OEMAPM_CL;
  129. BYTE OEMAPM_CH;
  130. WORD OEMAPM_Reserved4;
  131. BYTE OEMAPM_AL;
  132. BYTE OEMAPM_AH;
  133. WORD OEMAPM_Reserved5;
  134. BYTE OEMAPM_Flags;
  135. BYTE OEMAPM_Reserved6[3];
  136. };
  137. struct _OEM_APM_WORD_REGS {
  138. WORD OEMAPM_DI;
  139. WORD OEMAPM_Reserved7;
  140. WORD OEMAPM_SI;
  141. WORD OEMAPM_Reserved8;
  142. WORD OEMAPM_BP;
  143. WORD OEMAPM_Reserved9;
  144. WORD OEMAPM_BX;
  145. WORD OEMAPM_Reserved10;
  146. WORD OEMAPM_DX;
  147. WORD OEMAPM_Reserved11;
  148. WORD OEMAPM_CX;
  149. WORD OEMAPM_Reserved12;
  150. WORD OEMAPM_AX;
  151. WORD OEMAPM_Reserved13[3];
  152. };
  153. struct _OEM_APM_DWORD_REGS {
  154. DWORD OEMAPM_EDI;
  155. DWORD OEMAPM_ESI;
  156. DWORD OEMAPM_EBP;
  157. DWORD OEMAPM_EBX;
  158. DWORD OEMAPM_EDX;
  159. DWORD OEMAPM_ECX;
  160. DWORD OEMAPM_EAX;
  161. DWORD OEMAPM_Reserved14;
  162. };
  163. typedef union _OEM_APM_REGS {
  164. struct _OEM_APM_BYTE_REGS ByteRegs;
  165. struct _OEM_APM_WORD_REGS WordRegs;
  166. struct _OEM_APM_DWORD_REGS DwordRegs;
  167. } OEM_APM_REGS, *LPOEM_APM_REGS;
  168. typedef struct _APM_OEM_APM_FUNCTION_PARAM {
  169. LPOEM_APM_REGS lpOemApmRegs;
  170. } APM_OEM_APM_FUNCTION_PARAM;
  171. // APM_IOCTL_W32_GET_SYSTEM_STATUS
  172. // Gets the current power status of the system. Follows the Win32
  173. // GetSystemPowerStatus API convention.
  174. //
  175. // lpvInBuffer: Pointer to APM_W32_GET_SYSTEM_STATUS_PARAM structure.
  176. // lpvOutBuffer: Pointer to DWORD to receive the boolean return code.
  177. #define APM_IOCTL_W32_GET_SYSTEM_STATUS 0x80FF0034
  178. // APM_CAPABILITIES, Capabilities flags:
  179. #define CAPS_SUPPORTS_STANDBY 1
  180. #define CAPS_SUPPORTS_SUSPEND 2
  181. #define CAPS_SUPPORTS_HIBERNATE 4
  182. typedef struct APM_CAPABILITIES_S {
  183. WORD Capabilities;
  184. BYTE BatteryCount;
  185. BYTE Reserved;
  186. }APM_CAPABILITIES, *PAPM_CAPABILITIES;
  187. typedef struct _WIN32_SYSTEM_POWER_STATUS {
  188. BYTE W32PS_AC_Line_Status;
  189. BYTE W32PS_Battery_Flag;
  190. BYTE W32PS_Battery_Life_Percent;
  191. BYTE W32PS_Reserved1;
  192. DWORD W32PS_Battery_Life_Time;
  193. DWORD W32PS_Battery_Full_Life_Time;
  194. } WIN32_SYSTEM_POWER_STATUS;
  195. typedef WIN32_SYSTEM_POWER_STATUS *LPWIN32_SYSTEM_POWER_STATUS;
  196. typedef struct _APM_W32_GET_SYSTEM_STATUS_PARAM {
  197. LPWIN32_SYSTEM_POWER_STATUS lpWin32SystemPowerStatus;
  198. } APM_W32_GET_SYSTEM_STATUS_PARAM;
  199. // APM_IOCTL_GET_CAPABILITIES
  200. // Gets the capabilities bitmask of an APM 1.2 machine.
  201. // lpvInBuffer: Not used for this operation, set to NULL.
  202. // lpvOutBuffer: Pointer to APM_CAPABILITIES structure.
  203. #define APM_IOCTL_GET_CAPABILITIES 0x80FF003C
  204. typedef struct _APM_GET_CAPABILITIES_PARAM {
  205. PAPM_CAPABILITIES pApmCaps;
  206. } APM_GET_CAPABILITIES_PARAM;
  207. // APM_IOCTL_GET_RING_RESUME_STATUS
  208. // Gets the ring resume status.
  209. // lpvInBuffer: Not used for this operation, set to NULL.
  210. // lpvOutBuffer: Pointer to DWORD which will contain the status.
  211. #define APM_IOCTL_GET_RING_RESUME_STATUS 0x80FF0040
  212. // APM_IOCTL_ENABLE_RING_RESUME
  213. // Sets the ring resume status.
  214. // lpvInBuffer: Points to new status.
  215. // lpvOutBuffer: Pointer to APM_CAPABILITIES structure.
  216. #define APM_IOCTL_ENABLE_RING_RESUME 0x80FF0044
  217. #ifdef __cplusplus
  218. }
  219. #endif
  220. #endif // _NTDDAPMT_