upssvc.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * upssvc.h
  3. *
  4. * UPS service interface
  5. *
  6. * This file is part of the w32api package.
  7. *
  8. * Contributors:
  9. * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
  10. *
  11. * THIS SOFTWARE IS NOT COPYRIGHTED
  12. *
  13. * This source code is offered for use in the public domain. You may
  14. * use, modify or distribute it freely.
  15. *
  16. * This code is distributed in the hope that it will be useful but
  17. * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  18. * DISCLAIMED. This includes but is not limited to warranties of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20. *
  21. */
  22. #ifndef __UPSSVC_H
  23. #define __UPSSVC_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #if defined(_APCUPS_)
  28. #define UPSAPI
  29. #else
  30. #define UPSAPI DECLSPEC_IMPORT
  31. #endif
  32. #define UPS_ONLINE 1
  33. #define UPS_ONBATTERY 2
  34. #define UPS_LOWBATTERY 4
  35. #define UPS_NOCOMM 8
  36. #define UPS_CRITICAL 16
  37. UPSAPI
  38. VOID
  39. NTAPI
  40. UPSCancelWait(VOID);
  41. UPSAPI
  42. DWORD
  43. NTAPI
  44. UPSGetState(VOID);
  45. #define UPS_INITUNKNOWNERROR 0
  46. #define UPS_INITOK 1
  47. #define UPS_INITNOSUCHDRIVER 2
  48. #define UPS_INITBADINTERFACE 3
  49. #define UPS_INITREGISTRYERROR 4
  50. #define UPS_INITCOMMOPENERROR 5
  51. #define UPS_INITCOMMSETUPERROR 6
  52. UPSAPI
  53. DWORD
  54. NTAPI
  55. UPSInit(VOID);
  56. UPSAPI
  57. VOID
  58. NTAPI
  59. UPSStop(VOID);
  60. UPSAPI
  61. VOID
  62. NTAPI
  63. UPSTurnOff(
  64. IN DWORD aTurnOffDelay);
  65. UPSAPI
  66. VOID
  67. NTAPI
  68. UPSWaitForStateChange(
  69. IN DWORD aCurrentState,
  70. IN DWORD anInterval);
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74. #endif /* __UPSSVC_H */