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.

34 lines
1008 B

  1. #ifndef REGISTRY_H
  2. #define REGISRTY_H
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif
  6. #include "resource.h"
  7. class CRegistry
  8. {
  9. public:
  10. CRegistry();
  11. CRegistry(const TCHAR *pszSubKey, HKEY hkey = HKEY_CURRENT_USER);
  12. ~CRegistry();
  13. BOOL Open(const TCHAR *pszSubKey, HKEY hkey = HKEY_CURRENT_USER);
  14. BOOL CreateKey(const TCHAR *pszSubKey);
  15. BOOL DeleteKey(const TCHAR *pszSubKey);
  16. BOOL Close();
  17. LONG SetValue(const TCHAR *pszValue, DWORD dwNumber);
  18. LONG GetValue(const TCHAR *pszValue,DWORD dwDefault);
  19. VOID MoveToSubKey(const TCHAR *pszSubKeyName);
  20. HKEY GetKey() { return m_hkey; };
  21. BOOL IsValid() { return bhkeyValid;};
  22. LONG GetError() { return m_error; };
  23. VOID ClearErrors() { m_error = 0; };
  24. LONG EnumerateKeys(DWORD dwIndex,TCHAR *pszKeyName, DWORD dwSize);
  25. private:
  26. HKEY m_hkey;
  27. long m_error;
  28. BOOL bhkeyValid;
  29. };
  30. #endif