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.

195 lines
7.7 KiB

  1. /*******************************************************************************
  2. *
  3. * (C) COPYRIGHT MICROSOFT CORP., 1993-1994
  4. *
  5. * TITLE: PWRIOCTL.H
  6. *
  7. * VERSION: 1.0
  8. *
  9. * DATE: 01 Feb 1994
  10. *
  11. * AUTHOR: TCS
  12. *
  13. * Definitions for the Virtual Power Management Device DeviceIoControl
  14. * interface.
  15. *
  16. ********************************************************************************
  17. *
  18. * CHANGE LOG:
  19. *
  20. * DATE REV DESCRIPTION
  21. * ----------- --- -------------------------------------------------------------
  22. * 01 Feb 1994 TCS Original implementation.
  23. *
  24. *******************************************************************************/
  25. #ifndef _INC_PWRIOCTL
  26. #define _INC_PWRIOCTL
  27. #ifndef Not_VxD
  28. #define Not_VxD
  29. #endif
  30. #ifndef IS_32
  31. #define IS_32
  32. #endif
  33. #include <vpowerd.h>
  34. //
  35. // The IOCTL codes match up exactly to the order of the services in the VPOWERD
  36. // service table (plus one). The input buffer for each IOCTL code follows the
  37. // same structure as the corresponding VPOWERD service would expect. The
  38. // output buffer is used to store the return value from the VPOWERD service.
  39. //
  40. // VPOWERD_IOCTL_GET_VERSION
  41. // Gets the version of the installed VPOWERD device.
  42. //
  43. // lpvInBuffer: Not used for this operation, set to NULL.
  44. // lpvOutBuffer: Pointer to DWORD to receive the VPOWERD version.
  45. #define VPOWERD_IOCTL_GET_VERSION 0x00000001
  46. // VPOWERD_IOCTL_GET_APM_BIOS_VERSION
  47. // Gets the version of the APM BIOS that VPOWERD has detected.
  48. //
  49. // lpvInBuffer: Not used for this operation, set to NULL.
  50. // lpvOutBuffer: Pointer to DWORD to receive the APM BIOS version.
  51. #define VPOWERD_IOCTL_GET_APM_BIOS_VERSION 0x00000002
  52. // VPOWERD_IOCTL_GET_PM_LEVEL
  53. // Gets the level of power management interaction between VPOWERD and the
  54. // APM BIOS.
  55. //
  56. // lpvInBuffer: Not used for this operation, set to NULL.
  57. // lpvOutBuffer: Pointer to DWORD to receive the current power management
  58. // level.
  59. #define VPOWERD_IOCTL_GET_PM_LEVEL 0x00000003
  60. // VPOWERD_IOCTL_SET_PM_LEVEL
  61. // Sets the level of power management interaction between VPOWERD and the
  62. // APM BIOS.
  63. //
  64. // lpvInBuffer: Pointer to VPOWERD_SET_PM_LEVEL_PARAM structure.
  65. // lpvOutBuffer: Pointer to DWORD to receive the VPOWERD return code.
  66. #define VPOWERD_IOCTL_SET_PM_LEVEL 0x00000004
  67. typedef struct _VPOWERD_SET_PM_LEVEL_PARAM {
  68. DWORD PowerManagementLevel;
  69. } VPOWERD_SET_PM_LEVEL_PARAM;
  70. // VPOWERD_IOCTL_SET_DEVICE_STATE
  71. // Sets the power state (e.g., OFF) of the specified device ID. Not valid
  72. // for the system device (all devices power managed by the APM BIOS).
  73. //
  74. // lpvInBuffer: Pointer to VPOWERD_SET_DEVICE_PARAM structure.
  75. // lpvOutBuffer: Pointer to DWORD to receive the VPOWERD return code.
  76. #define VPOWERD_IOCTL_SET_DEVICE_STATE 0x00000005
  77. typedef struct _VPOWERD_SET_DEVICE_PARAM {
  78. POWER_DEVICE_ID PowerDeviceID;
  79. POWER_STATE PowerState;
  80. } VPOWERD_SET_DEVICE_PARAM;
  81. // VPOWERD_IOCTL_RESTORE_DEFAULTS
  82. // Reinitializes all APM BIOS power-on defaults.
  83. //
  84. // lpvInBuffer: Not used for this operation, set to NULL.
  85. // lpvOutBuffer: Pointer to DWORD to receive the VPOWERD return code.
  86. #define VPOWERD_IOCTL_RESTORE_DEFAULTS 0x00000007
  87. // VPOWERD_IOCTL_GET_STATUS
  88. // Gets the current power status of the specified device ID.
  89. //
  90. // lpvInBuffer: Pointer to VPOWERD_GET_STATUS_PARAM structure.
  91. // lpvOutBuffer: Pointer to DWORD to receive the VPOWERD return code.
  92. #define VPOWERD_IOCTL_GET_STATUS 0x00000008
  93. typedef struct _VPOWERD_GET_STATUS_PARAM {
  94. POWER_DEVICE_ID PowerDeviceID;
  95. LPPOWER_STATUS lpPowerStatus;
  96. } VPOWERD_GET_STATUS_PARAM;
  97. // VPOWERD_IOCTL_GET_STATE
  98. // Gets the power state (e.g., OFF) of the specified device ID.
  99. //
  100. // lpvInBuffer: Pointer to VPOWERD_GET_STATE_PARAM structure.
  101. // lpvOutBuffer: Pointer to DWORD to receive the VPOWERD return code.
  102. #define VPOWERD_IOCTL_GET_STATE 0x00000009
  103. typedef struct _VPOWERD_GET_STATE_PARAM {
  104. POWER_DEVICE_ID PowerDeviceID;
  105. LPPOWER_STATE lpPowerState;
  106. } GET_STATE_PARAM;
  107. // VPOWERD_IOCTL_OEM_APM_FUNCTION
  108. // Calls an OEM defined APM BIOS extension.
  109. //
  110. // lpvInBuffer: Pointer to VPOWERD_OEM_APM_FUNCTION_PARAM structure.
  111. // lpvOutBuffer: Pointer to DWORD to receive the VPOWERD return code.
  112. #define VPOWERD_IOCTL_OEM_APM_FUNCTION 0x0000000A
  113. typedef struct _VPOWERD_OEM_APM_FUNCTION_PARAM {
  114. LPOEM_APM_REGS lpOemApmRegs;
  115. } VPOWERD_OEM_APM_FUNCTION_PARAM;
  116. // VPOWERD_IOCTL_W32_GET_SYSTEM_STATUS
  117. // Gets the current power status of the system. Follows the Win32
  118. // GetSystemPowerStatus API convention.
  119. //
  120. // lpvInBuffer: Pointer to VPOWERD_W32_GET_SYSTEM_STATUS_PARAM structure.
  121. // lpvOutBuffer: Pointer to DWORD to receive the boolean return code.
  122. #define VPOWERD_IOCTL_W32_GET_SYSTEM_STATUS 0x0000000D
  123. typedef struct _VPOWERD_W32_GET_SYSTEM_STATUS_PARAM {
  124. LPWIN32_SYSTEM_POWER_STATUS lpWin32SystemPowerStatus;
  125. } VPOWERD_W32_GET_SYSTEM_STATUS_PARAM;
  126. // VPOWERD_IOCTL_GET_CAPABILITIES
  127. // Gets the capabilities bitmask of an APM 1.2 machine.
  128. // lpvInBuffer: Pointer to VPOWERD_GET_CAPABILITIES_PARAM structure.
  129. // lpvOutBuffer: Pointer to DWORD to receive the boolean return code.
  130. #define VPOWERD_IOCTL_GET_CAPABILITIES 0x000000F
  131. typedef struct _VPOWERD_GET_CAPABILITIES_PARAM {
  132. PAPM_CAPABILITIES pApmCaps;
  133. } VPOWERD_GET_CAPABILITIES_PARAM;
  134. // VPOWERD_IOCTL_ENABLE_RING_RESUME
  135. // Calls into the BIOS and attempts to enable the Resume on Ring capability. This is only supported on APM 1.2 machines
  136. // lpvInBuffer: Not used for this operation, set to NULL
  137. // lpvOutBuffer: pointer to dword to receive the VPOWERD return code. (Expect PR_FUNC_NOT_SUPPORTED on APM 1.1 or lower machines.)
  138. #define VPOWERD_IOCTL_ENABLE_RING_RESUME 0x00000010
  139. // VPOWERD_IOCTL_DISABLE_RING_RESUME
  140. // Calls into the BIOS and attempts to disable the Resume on Ring capability. This is only supported on APM 1.2 machines
  141. // lpvInBuffer: Not used for this operation, set to NULL
  142. // lpvOutBuffer: pointer to dword to receive the VPOWERD return code. (Expect PR_FUNC_NOT_SUPPORTED on APM 1.1 or lower machines.)
  143. #define VPOWERD_IOCTL_DISABLE_RING_RESUME 0x00000011
  144. // VPOWERD_IOCTL_W32_GET_STATUS
  145. // Gets the current power status of a particular battery on an APM 1.2 machine.
  146. // BatteryNumber is the battery device ID in which your interested.
  147. // The device ID is formed by adding 0x8000 to the *1* based battery number.
  148. // e.g. if your interested in the first battery, BatteryNumber=0x8001
  149. // lpvInBuffer: Pointer to VPOWERD_W32_GET_STATUS_PARAM structure.
  150. // lpvOutBuffer: Pointer to DWORD to receive the boolean return code.
  151. #define VPOWERD_IOCTL_W32_GET_STATUS 0x00000017
  152. typedef struct _VPOWERD_W32_GET_STATUS_PARAM {
  153. DWORD BatteryNumber;
  154. LPWIN32_SYSTEM_POWER_STATUS lpWin32SystemPowerStatus;
  155. } VPOWERD_W32_GET_STATUS_PARAM;
  156. // VPOWERD_IOCTL_GET_RING_RESUME_STATUS
  157. // Calls into the BIOS and attempts to determine whether Resume on Ring is enabled or disabled.
  158. // This is only supported on APM 1.2 machines.
  159. // lpvInBuffer: Pointer to VPOWERD_GET_RING_RESUME_STATUS_PARAM structure
  160. // lpvOutBuffer: pointer to dword to receive the VPOWERD return code. (Expect PR_FUNC_NOT_SUPPORTED on APM 1.1 or lower machines.)
  161. #define VPOWERD_IOCTL_GET_RING_RESUME_STATUS 0x00000019
  162. typedef struct _VPOWERD_GET_RING_RESUME_STATUS_PARAM {
  163. LPDWORD pStatus;
  164. } VPOWERD_GET_RING_RESUME_STATUS_PARAM;
  165. #endif // _INC_PWRIOCTL