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.

66 lines
1.4 KiB

  1. //
  2. // RegistryHive class
  3. //
  4. class CRegistryHive:
  5. public IUnknown
  6. {
  7. protected:
  8. ULONG m_cRef;
  9. HKEY m_hKey;
  10. LPTSTR m_lpFileName;
  11. LPTSTR m_lpKeyName;
  12. LPTSTR m_lpEventName;
  13. HANDLE m_hEvent;
  14. public:
  15. CRegistryHive();
  16. ~CRegistryHive();
  17. //
  18. // IUnknown methods
  19. //
  20. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  21. STDMETHODIMP_(ULONG) AddRef();
  22. STDMETHODIMP_(ULONG) Release();
  23. //
  24. // Implemented Internal methods
  25. //
  26. STDMETHODIMP Initialize(LPTSTR lpFileName, LPTSTR lpKeyName);
  27. STDMETHODIMP GetHKey(HKEY *hKey);
  28. STDMETHODIMP Save(VOID);
  29. STDMETHODIMP ExportKey(HKEY hKey, HANDLE hFile, LPWSTR lpKeyName, ULONG ulKeySize);
  30. STDMETHODIMP WriteValue(HANDLE hFile, LPWSTR lpKeyName,
  31. LPWSTR lpValueName, DWORD dwType,
  32. DWORD dwDataLength, LPBYTE lpData);
  33. STDMETHODIMP Load(VOID);
  34. STDMETHODIMP IsRegistryEmpty(BOOL *bEmpty);
  35. };
  36. //
  37. // Verison number for the registry file format
  38. //
  39. #define REGISTRY_FILE_VERSION 1
  40. //
  41. // File signature
  42. //
  43. #define REGFILE_SIGNATURE 0x67655250
  44. //
  45. // Max keyname size
  46. //
  47. #define MAX_KEYNAME_SIZE 2048
  48. #define MAX_VALUENAME_SIZE 512