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.

102 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. ntapmdmp.c
  5. Abstract:
  6. Dump data about whether machine is ACPI or APM, and if
  7. APM whether APM is usable, good, bad, etc.
  8. Author:
  9. Byan M. Willman (bryanwi) 24-Aug-1998
  10. Revision History:
  11. --*/
  12. #if 0
  13. #include <nt.h>
  14. #include <ntrtl.h>
  15. #include <nturtl.h>
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include <apmlib.h>
  20. void
  21. DumpApmError();
  22. void
  23. _CRTAPI1 main(
  24. int argc,
  25. char *argv[]
  26. )
  27. {
  28. if (IsSystemACPI()) {
  29. printf("ACPI system. APM is not relevent.\n");
  30. exit(0);
  31. }
  32. switch (IsApmPresent()) {
  33. case APM_NOT_PRESENT:
  34. printf("APM not detected on this system.\n");
  35. exit(1);
  36. break;
  37. case APM_PRESENT_BUT_NOT_USABLE:
  38. printf("APM detected on this system, but not usable.\n");
  39. DumpApmError();
  40. exit(2);
  41. break;
  42. case APM_ON_GOOD_LIST:
  43. printf("APM detected on this system, usable, on the Good bios list.\n");
  44. if (IsApmActive()) {
  45. printf("APM is active on this machine.\n");
  46. } else {
  47. printf("APM is NOT active on this machine.\n");
  48. }
  49. exit(3);
  50. break;
  51. case APM_NEUTRAL:
  52. printf("APM detected on this system, usable, NOT on the Good or Bad lists.\n");
  53. if (IsApmActive()) {
  54. printf("APM is active on this machine.\n");
  55. } else {
  56. printf("APM is NOT active on this machine.\n");
  57. }
  58. exit(4);
  59. break;
  60. case APM_ON_BAD_LIST:
  61. printf("APM detected on this system, usable, BUT on the bad bios list.\n");
  62. if (IsApmActive()) {
  63. printf("APM is active on this machine.\n");
  64. } else {
  65. printf("APM is NOT active on this machine.\n");
  66. }
  67. exit(5);
  68. break;
  69. default:
  70. printf("Something very strange has happened.\n");
  71. exit(99);
  72. break;
  73. }
  74. }
  75. VOID
  76. DumpApmError()
  77. {
  78. }
  79. #endif