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.

117 lines
2.7 KiB

  1. /*
  2. * ACPISI.C - ACPI OS Independent System Indicator Routines
  3. *
  4. * Notes:
  5. *
  6. * This file provides OS independent functions for managing system indicators
  7. *
  8. */
  9. #include "pch.h"
  10. #ifdef ALLOC_PRAGMA
  11. #pragma alloc_text(PAGE, SetSystemIndicator)
  12. #endif
  13. BOOLEAN
  14. SetSystemIndicator (
  15. SYSTEM_INDICATORS SystemIndicators,
  16. ULONG Value
  17. )
  18. {
  19. PNSOBJ pns = NULL, pnssi = NULL;
  20. OBJDATA Arg0,data;
  21. char IndicatorName []= "_SST";
  22. PAGED_CODE();
  23. switch (SystemIndicators) {
  24. case SystemStatus:
  25. // StrCpy (IndicatorName, "_SST",sizeof(IndicatorName));
  26. // init arg0 for the control method
  27. ACPIPrint( (
  28. ACPI_PRINT_POWER,
  29. "System Status Value = %x\n",
  30. Value
  31. ) );
  32. Arg0.dwfData = 0;
  33. Arg0.uipDataValue = Value;
  34. Arg0.dwDataType = OBJTYPE_INTDATA;
  35. Arg0.dwDataLen = 0;
  36. Arg0.pbDataBuff = NULL;
  37. break;
  38. case MessageWaiting:
  39. StrCpy (IndicatorName, "_MSG",sizeof(IndicatorName));
  40. // init arg0 for the control method
  41. ACPIPrint( (
  42. ACPI_PRINT_POWER,
  43. "Message Waiting Value = %x\n",
  44. Value
  45. ) );
  46. Arg0.dwfData = 0;
  47. Arg0.uipDataValue = Value;
  48. Arg0.dwDataType = OBJTYPE_INTDATA;
  49. Arg0.dwDataLen = 0;
  50. Arg0.pbDataBuff = NULL;
  51. break;
  52. default:
  53. ACPIPrint( (
  54. ACPI_PRINT_FAILURE,
  55. "SetSystemIndicator: Unknown Indicator\n"
  56. ) );
  57. return FALSE;
  58. }
  59. if ( AMLIERR(AMLIGetNameSpaceObject ("\\_SI",NULL, &pnssi,0)) != AMLIERR_NONE ) {
  60. ACPIPrint( (
  61. ACPI_PRINT_FAILURE,
  62. "Could not GET \\_SI\n"
  63. ) );
  64. ACPIBreakPoint ();
  65. return FALSE;
  66. }
  67. if ( AMLIERR(AMLIGetNameSpaceObject (IndicatorName, pnssi, &pns,NSF_LOCAL_SCOPE)) == AMLIERR_NONE ) {
  68. if ( AMLIERR(AMLIEvalNameSpaceObject (pns,&data, 1, &Arg0)) == AMLIERR_NONE ) {
  69. AMLIFreeDataBuffs (&data,1);
  70. } else {
  71. ACPIPrint( (
  72. ACPI_PRINT_FAILURE,
  73. "Attempt to Eval %s %x failed using objdata %x\n",
  74. IndicatorName,pns,&Arg0
  75. ) );
  76. ACPIBreakPoint ();
  77. }
  78. } else {
  79. ACPIPrint( (
  80. ACPI_PRINT_FAILURE,
  81. "Attempt to GET %s failed\n",
  82. IndicatorName,pns,&Arg0
  83. ) );
  84. }
  85. return (TRUE);
  86. }