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.

83 lines
1.9 KiB

  1. /*++
  2. ;
  3. ; Copyright (c) Microsoft Corporation. All rights reserved.
  4. ;
  5. ; Module Name:
  6. ;
  7. ; ntapm.h
  8. ;
  9. ; Abstract:
  10. ;
  11. ; This module contains definitions specific to legacy APM support
  12. ; in NT5, including special HAL interfaces
  13. ;
  14. ; Author:
  15. ;
  16. ; Bryan Willman (bryanwi) 13 Feb 1998
  17. ;
  18. ; Revision History:
  19. ;
  20. ;
  21. --*/
  22. //
  23. // Arguments to HalInitPowerManagment
  24. //
  25. #define HAL_APM_SIGNATURE 0x004D5041 // APM
  26. #define HAL_APM_VERSION 500 // 5.00
  27. #define HAL_APM_TABLE_SIZE (sizeof(PM_DISPATCH_TABLE)+sizeof(PVOID))
  28. #define HAL_APM_SLEEP_VECTOR 0
  29. #define HAL_APM_OFF_VECTOR 1
  30. //
  31. // Values used in the Parameters.Other part of an IO_STACK_LOCATION
  32. // to set up a link between a battery and ntapm.sys
  33. //
  34. typedef struct _NTAPM_LINK {
  35. ULONG Signature; // overlay Argument1
  36. ULONG Version; // overlay Argument2
  37. ULONG BattLevelPtr; // overlay Argument3, pointer to pointer to a pvoid void function
  38. ULONG ChangeNotify; // overlay Argument4, address of notify function
  39. } NTAPM_LINK, *PNTAPM_LINK;
  40. #define NTAPM_LINK_SIGNATURE 0x736d7061 // apms = Argument1
  41. #define NTAPM_LINK_VERSION 500 // 5.00 = Argument2
  42. //
  43. // Major code is IRP_MJ_INTERNAL_DEVICE_CONTROL
  44. // Minor code is 0.
  45. //
  46. //
  47. // BattLevelPtr gets the address of a routine with prototype:
  48. //
  49. //ULONG BatteryLevel();
  50. //
  51. //
  52. // Data returned by NtApmGetBatteryLevel in NTAPM
  53. // is a ULONG, cracked with these defines.
  54. //
  55. #define NTAPM_ACON 0x1000
  56. #define NTAPM_NO_BATT 0x2000
  57. #define NTAPM_NO_SYS_BATT 0x4000
  58. #define NTAPM_BATTERY_STATE 0x0f00
  59. #define NTAPM_BATTERY_STATE_SHIFT 8
  60. #define NTAPM_POWER_PERCENT 0x00ff
  61. //
  62. // ChangeNotify provides the address of a routine with prototype
  63. //
  64. //VOID ChangeNotify();
  65. //