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.

45 lines
1.2 KiB

  1. /*++
  2. Copyright (C) 1997-2000 Microsoft Corporation
  3. Module Name:
  4. reg.H
  5. Abstract:
  6. Registry helper class
  7. History:
  8. --*/
  9. #define WBEM_REG_WBEM "Software\\Microsoft\\WBEM"
  10. #define WBEM_REG_WINMGMT "Software\\Microsoft\\WBEM\\CIMOM"
  11. #define WBEM_REG_AUTORECOVER "Autorecover MOFs"
  12. #define WBEM_REG_AUTORECOVER_EMPTY "Autorecover MOFs (empty)"
  13. #define WBEM_REG_AUTORECOVER_RECOVERED "Autorecover MOFs (recovered)"
  14. #define SYSTEM_SETUP_REG "System\\Setup"
  15. class Registry
  16. {
  17. HKEY hPrimaryKey;
  18. HKEY hSubkey;
  19. int m_nStatus;
  20. LONG m_nLastError;
  21. public:
  22. enum { no_error, failed };
  23. Registry(char *pszLocalMachineStartKey);
  24. ~Registry();
  25. int Open(HKEY hStart, const char *pszStartKey);
  26. int GetStr(const char *pszValueName, char **pValue);
  27. char* GetMultiStr(const char *pszValueName, DWORD &dwSize);
  28. int SetMultiStr(const char *pszValueName, const char*pData, DWORD dwSize);
  29. int DeleteEntry(const char *pszValueName);
  30. int SetStr(char *pszValueName, char *pszValue);
  31. int GetDWORD(TCHAR *pszValueName, DWORD *pdwValue);
  32. int GetStatus() { return m_nStatus;};
  33. LONG GetLastError() { return m_nLastError;};
  34. };