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.

82 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name :
  4. reg.hxx
  5. Abstract:
  6. Class that modifies the registry
  7. Author:
  8. Christopher Achille (cachille)
  9. Project:
  10. Internet Services Setup
  11. Revision History:
  12. June 2001: Created
  13. --*/
  14. #define REGKEY_RECURSION_MAXDEPTH 10
  15. class CRegValue {
  16. public:
  17. BUFFER m_buffData;
  18. DWORD m_dwType;
  19. DWORD m_dwSize;
  20. BOOL SetDword( DWORD dwNewValue );
  21. BOOL GetDword( LPDWORD pdwValue );
  22. };
  23. // class: CRegistry
  24. //
  25. // This is a Registry Object used for moving values in the registry
  26. //
  27. class CRegistry {
  28. private:
  29. HKEY m_hKey;
  30. public:
  31. CRegistry();
  32. ~CRegistry();
  33. BOOL OpenRegistry(LPTSTR szNodetoOpen, LPTSTR szSubKey, DWORD dwAccess);
  34. BOOL OpenRegistry(HKEY hKey, LPCTSTR szSubKey, DWORD dwAccess, BOOL bCreateIfNotPresent = FALSE );
  35. void CloseRegistry();
  36. BOOL ReadValue(LPCTSTR szName, CRegValue &Value);
  37. BOOL ReadValueString(LPCTSTR szName, TSTR *strValue);
  38. BOOL SetValue(LPCTSTR szName, CRegValue &Value);
  39. BOOL DeleteValue(LPCTSTR szName);
  40. BOOL DeleteAllValues();
  41. BOOL DeleteKey(LPTSTR szKeyName, BOOL bDeleteSubKeys, DWORD dwDepth = 0 );
  42. HKEY QueryKey();
  43. };
  44. class CRegistry_MoveValue : public CBaseFunction {
  45. private:
  46. virtual BOOL VerifyParameters(CItemList &ciParams);
  47. virtual BOOL DoInternalWork(CItemList &ciList);
  48. public:
  49. virtual LPTSTR GetMethodName();
  50. };
  51. class CRegistry_DeleteKey : public CBaseFunction {
  52. private:
  53. virtual BOOL VerifyParameters(CItemList &ciParams);
  54. virtual BOOL DoInternalWork(CItemList &ciList);
  55. public:
  56. virtual LPTSTR GetMethodName();
  57. };