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.

121 lines
3.1 KiB

  1. // Copyright (C) 2002 Microsoft Corporation
  2. //
  3. // answerfile reader object
  4. //
  5. // 5 April 2002 sburns
  6. #ifndef ANSWERFILE_HPP_INCLUDED
  7. #define ANSWERFILE_HPP_INCLUDED
  8. class AnswerFile
  9. {
  10. public:
  11. static const String OPTION_ADMIN_PASSWORD;
  12. static const String OPTION_ALLOW_ANON_ACCESS;
  13. static const String OPTION_AUTO_CONFIG_DNS;
  14. static const String OPTION_CHILD_NAME;
  15. static const String OPTION_CRITICAL_REPLICATION_ONLY;
  16. static const String OPTION_DATABASE_PATH;
  17. static const String OPTION_DISABLE_CANCEL_ON_DNS_INSTALL;
  18. static const String OPTION_DNS_ON_NET;
  19. static const String OPTION_GC_CONFIRM;
  20. static const String OPTION_IS_LAST_DC;
  21. static const String OPTION_LOG_PATH;
  22. static const String OPTION_NEW_DOMAIN;
  23. static const String OPTION_NEW_DOMAIN_NAME;
  24. static const String OPTION_NEW_DOMAIN_NETBIOS_NAME;
  25. static const String OPTION_PARENT_DOMAIN_NAME;
  26. static const String OPTION_PASSWORD;
  27. static const String OPTION_REBOOT;
  28. static const String OPTION_REMOVE_APP_PARTITIONS;
  29. static const String OPTION_REPLICATION_SOURCE;
  30. static const String OPTION_REPLICA_DOMAIN_NAME;
  31. static const String OPTION_REPLICA_OR_MEMBER;
  32. static const String OPTION_REPLICA_OR_NEW_DOMAIN;
  33. static const String OPTION_SAFE_MODE_ADMIN_PASSWORD;
  34. static const String OPTION_SET_FOREST_VERSION;
  35. static const String OPTION_SITE_NAME;
  36. static const String OPTION_SOURCE_PATH;
  37. static const String OPTION_SYSKEY;
  38. static const String OPTION_SYSVOL_PATH;
  39. static const String OPTION_USERNAME;
  40. static const String OPTION_USER_DOMAIN;
  41. static const String VALUE_CHILD;
  42. static const String VALUE_DOMAIN;
  43. static const String VALUE_NO;
  44. static const String VALUE_NO_DONT_PROMPT;
  45. static const String VALUE_REPLICA;
  46. static const String VALUE_TREE;
  47. static const String VALUE_YES;
  48. // Constructs a new instance of the class.
  49. //
  50. // filename - fully-qualified pathname to an existing file from which the
  51. // options are read.
  52. //
  53. // If the file has the read-only attribute set, it will be removed.
  54. explicit
  55. AnswerFile(const String& filename);
  56. ~AnswerFile();
  57. String
  58. GetOption(const String& option) const;
  59. EncryptedString
  60. GetEncryptedOption(const String& option) const;
  61. bool
  62. IsSafeModeAdminPwdOptionPresent() const;
  63. private:
  64. bool
  65. IsKeyPresent(const String& key) const;
  66. String
  67. ReadKey(const String& key) const;
  68. EncryptedString
  69. EncryptedReadKey(const String& key) const;
  70. HRESULT
  71. WriteKey(const String& key, const String& value) const;
  72. typedef
  73. std::map<
  74. String,
  75. EncryptedString,
  76. String::LessIgnoreCase,
  77. Burnslib::Heap::Allocator< EncryptedString > >
  78. OptionEncryptedValueMap;
  79. OptionEncryptedValueMap ovMap;
  80. StringList keysPresent;
  81. String filename;
  82. bool isSafeModePasswordPresent;
  83. };
  84. #endif // ANSWERFILE_HPP_INCLUDED