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.

89 lines
2.6 KiB

  1. #pragma once
  2. #include "value.h"
  3. class CParam
  4. {
  5. public:
  6. CParam();
  7. ~CParam();
  8. BOOL FInit(HKEY hkRoot, HKEY hkNdiParam, PWSTR pszSubKey);
  9. BOOL Apply(); // Applies from Temp storage to In-Memory storage.
  10. UINT Validate();
  11. VOID GetDescription(WCHAR *sz, UINT cch);
  12. VOID GetHelpFile(WCHAR *sz, UINT cch);
  13. VOID AlertPrintfRange(HWND hDlg);
  14. // Data accessors
  15. VALUETYPE GetType() {return m_eType;}
  16. BOOL FIsOptional() {return m_fOptional;};
  17. BOOL FIsModified() {return m_fModified;}
  18. BOOL FIsReadOnly() {return m_fReadOnly;}
  19. BOOL FIsOEMText() {return m_fOEMText;}
  20. BOOL FIsUppercase() {return m_fUppercase;}
  21. CValue * GetInitial() {return &m_vInitial;}
  22. CValue * GetValue() {return &m_vValue;}
  23. CValue * GetMin() {return &m_vMin;}
  24. CValue * GetMax() {return &m_vMax;}
  25. CValue * GetStep() {return &m_vStep;}
  26. HKEY GetEnumKey()
  27. {
  28. AssertH(VALUETYPE_ENUM == m_eType);
  29. return m_hkEnum;
  30. }
  31. UINT GetLimitText()
  32. {
  33. AssertH((VALUETYPE_EDIT == m_eType) || (VALUETYPE_DWORD == m_eType)
  34. || (VALUETYPE_LONG == m_eType));
  35. return m_uLimitText;
  36. }
  37. WCHAR * GetDesc()
  38. {
  39. return m_pszDesc;
  40. }
  41. PCWSTR SzGetKeyName()
  42. {
  43. return m_pszKeyName;
  44. }
  45. VOID SetModified(BOOL f) {m_fModified = f;}
  46. // Values
  47. CValue m_vValue; // current control value
  48. CValue m_vInitial; // initial value read in
  49. // Range info (type-specific)
  50. CValue m_vMin; // numeric types - minimum value
  51. CValue m_vMax; // numeric types - maximum value
  52. CValue m_vStep; // numeric types - step value
  53. private:
  54. VOID InitParamType(PTSTR lpszType);
  55. BOOL m_fInit;
  56. // General info
  57. VALUETYPE m_eType; // value type
  58. HKEY m_hkRoot; // instance root
  59. WCHAR * m_pszKeyName; // Name of subkey for this parameter.
  60. WCHAR * m_pszDesc; // value description
  61. WCHAR * m_pszHelpFile; // help file
  62. DWORD m_dwHelpContext; // help context id
  63. UINT m_uLimitText; // edit type - max chars
  64. HKEY m_hkEnum; // enum type - registry param enum subkey
  65. // Flags
  66. BOOL m_fOptional; // optional paramter
  67. BOOL m_fModified; // param has been modified
  68. BOOL m_fReadOnly; // edit type - read-only
  69. BOOL m_fOEMText; // edit type - oem convert
  70. BOOL m_fUppercase; // edit type - uppercase
  71. };
  72. const DWORD c_cchMaxNumberSize = 16;