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.

147 lines
3.8 KiB

  1. //+---------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1993 - 1997.
  5. //
  6. // File: virtreg.h
  7. //
  8. // Contents: Defines the class CVirtualRegistry which manages a
  9. // virtual registry
  10. //
  11. // Classes:
  12. //
  13. // Methods:
  14. //
  15. // History: 23-Apr-96 BruceMa Created.
  16. //
  17. //----------------------------------------------------------------------
  18. #ifndef _VIRTREG_H_
  19. #define _VIRTREG_H_
  20. class CVirtualRegistry
  21. {
  22. public:
  23. CVirtualRegistry(void);
  24. ~CVirtualRegistry(void);
  25. int ReadRegSzNamedValue(HKEY hRoot,
  26. TCHAR *szKeyPath,
  27. TCHAR *szValueName,
  28. int *pIndex);
  29. int ReadRegMultiSzNamedValue(HKEY hRoot,
  30. TCHAR *szKeyPath,
  31. TCHAR *szValueName,
  32. int *pIndex);
  33. int NewRegSzNamedValue(HKEY hRoot,
  34. TCHAR *szKeyPath,
  35. TCHAR *szValueName,
  36. TCHAR *szVal,
  37. int *pIndex);
  38. int NewRegMultiSzNamedValue(HKEY hRoot,
  39. TCHAR *szKeyPath,
  40. TCHAR *szValueName,
  41. int *pIndex);
  42. void ChgRegSzNamedValue(int nIndex,
  43. TCHAR *szVal);
  44. int ReadRegDwordNamedValue(HKEY hRoot,
  45. TCHAR *szKeyPath,
  46. TCHAR *szValueName,
  47. int *pIndex);
  48. int NewRegDwordNamedValue(HKEY hRoot,
  49. TCHAR *szKeyPath,
  50. TCHAR *szValueName,
  51. DWORD dwVal,
  52. int *pIndex);
  53. void ChgRegDwordNamedValue(int nIndex,
  54. DWORD dwVal);
  55. int NewRegSingleACL(HKEY hRoot,
  56. TCHAR *szKeyPath,
  57. TCHAR *szValueName,
  58. SECURITY_DESCRIPTOR *pacl,
  59. BOOL fSelfRelative,
  60. int *pIndex);
  61. void ChgRegACL(int nIndex,
  62. SECURITY_DESCRIPTOR *pacl,
  63. BOOL fSelfRelative);
  64. int NewRegKeyACL(HKEY hKey,
  65. HKEY *phClsids,
  66. unsigned cClsids,
  67. TCHAR *szTitle,
  68. SECURITY_DESCRIPTOR *paclOrig,
  69. SECURITY_DESCRIPTOR *pacl,
  70. BOOL fSelfRelative,
  71. int *pIndex);
  72. int ReadLsaPassword(CLSID &clsid,
  73. int *pIndex);
  74. int NewLsaPassword(CLSID &clsid,
  75. TCHAR *szPassword,
  76. int *pIndex);
  77. void ChgLsaPassword(int nIndex,
  78. TCHAR *szPassword);
  79. int ReadSrvIdentity(TCHAR *szService,
  80. int *pIndex);
  81. int NewSrvIdentity(TCHAR *szService,
  82. TCHAR *szIdentity,
  83. int *pIndex);
  84. void ChgSrvIdentity(int nIndex,
  85. TCHAR *szIdentity);
  86. void MarkForDeletion(int nIndex);
  87. void MarkHiveForDeletion(int nIndex);
  88. CDataPacket * GetAt(int nIndex);
  89. void Remove(int nIndex);
  90. void RemoveAll(void);
  91. void Cancel(int nIndex);
  92. int Apply(int nIndex);
  93. int ApplyAll(void);
  94. int Ok(int nIndex);
  95. private:
  96. int SearchForRegEntry(HKEY hRoot,
  97. TCHAR *szKeyPath,
  98. TCHAR *szValueName);
  99. int SearchForLsaEntry(CLSID appid);
  100. int SearchForSrvEntry(TCHAR *szServiceName);
  101. CArray<CDataPacket*, CDataPacket*> m_pkts;
  102. };
  103. extern CVirtualRegistry g_virtreg;
  104. #endif //_VIRTREG_H_