Source code of Windows XP (NT5)
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.6 KiB

  1. /*
  2. *
  3. * NOTES:
  4. *
  5. * REVISIONS:
  6. * pcy15Sep93: Use NT Registry for some stuff, then use our ini file
  7. * pcy08Apr94: Trim size, use static iterators, dead code removal
  8. * ntf29Jan97: Add code to access PnP info on Windows '95
  9. * ntf07Feb97: Changed ScanConfigurationRegistry to get port name
  10. * from INI file if not available in registry.
  11. */
  12. #include "cdefine.h"
  13. extern "C" {
  14. #include <windows.h>
  15. #include <stdio.h>
  16. #include <string.h>
  17. #include <malloc.h>
  18. }
  19. #include "apc.h"
  20. #include "ntcfgmgr.h"
  21. #include "err.h"
  22. #include "upsreg.h"
  23. /********************************************************************
  24. *
  25. * NTConfigManager methods
  26. *
  27. ********************************************************************/
  28. //-------------------------------------------------------------------
  29. // Constructor
  30. NTConfigManager::NTConfigManager()
  31. : IniConfigManager()
  32. {
  33. _theConfigManager = this;
  34. }
  35. //-------------------------------------------------------------------
  36. // Destructor
  37. NTConfigManager::~NTConfigManager()
  38. {
  39. _theConfigManager = (PConfigManager) NULL;
  40. }
  41. INT NTConfigManager::Get(INT itemCode, PCHAR aValue)
  42. {
  43. int err = ErrNO_ERROR;
  44. switch (itemCode) {
  45. case CFG_UPS_PORT_NAME:
  46. {
  47. // Moved to serport.cxx
  48. }
  49. break;
  50. case CFG_MESSAGE_DELAY:
  51. case CFG_MESSAGE_INTERVAL:
  52. case CFG_SHUTDOWN_SCRIPT:
  53. {
  54. err = IniConfigManager::Get(itemCode,aValue);
  55. break;
  56. }
  57. default:
  58. {
  59. err = IniConfigManager::Get(itemCode,aValue);
  60. break;
  61. }
  62. }
  63. return err;
  64. }