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.

67 lines
1.9 KiB

  1. // RegAnalyzer.h: interface for the RegAnalyzer class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_REGANALYZER_H__655EE78C_3742_4D24_BB60_C92B55676851__INCLUDED_)
  5. #define AFX_REGANALYZER_H__655EE78C_3742_4D24_BB60_C92B55676851__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "precomp.h"
  10. #include "RegStringBuffer.h"
  11. #include "RegFile.h"
  12. #include "SmartBuffer.h"
  13. #include "Str.h"
  14. class CRegDiffFile;
  15. class CRegAnalyzer
  16. {
  17. public:
  18. CRegAnalyzer();
  19. virtual ~CRegAnalyzer();
  20. bool ComputeDifferences1(LPCTSTR RegFile1, LPCTSTR RegFile2, LPCTSTR OutputFile);
  21. //Saving Registry Hives
  22. BOOL AddKey(LPCTSTR RootKey, LPCTSTR SubKey, bool bExclude = false);
  23. BOOL SaveKeysToFile(LPCTSTR FileName, PFNSNAPSHOTPROGRESS ProgressCallback, PVOID Context, DWORD MaxLevels);
  24. protected:
  25. //Computing Differences
  26. void CompareSubKeys(LPCTSTR Key, CRegFile& f1, CRegFile& f2, CRegDiffFile& out);
  27. int CompareRegKeys(LPCTSTR Key1, LPCTSTR Key2, CRegFile& f1, CRegFile& f2, CRegDiffFile& out);
  28. void CompareDataItems(LPCTSTR KeyName, CRegFile& f1, CRegFile& f2, CRegDiffFile& out);
  29. //Saving Registry Hives
  30. bool SaveKeyToFile(HKEY hKey, LPCTSTR KeyName, CRegFile* RegFile, SectionType section,
  31. IN OUT PDWORD NodesSoFar = NULL, OPTIONAL
  32. IN PFNSNAPSHOTPROGRESS ProgressCallback = NULL,
  33. IN PVOID Context = NULL,
  34. IN INT MaxLevels = 0
  35. );
  36. bool SaveValuesToFile(HKEY hKey, LPCTSTR KeyName, CRegFile* RegFile, SectionType section);
  37. CRegStringBuffer m_SA;
  38. CSmartBuffer<BYTE> m_pData;
  39. CSmartBuffer<TCHAR> m_pOutputLine;
  40. struct CRegKey
  41. {
  42. CStr m_KeyName;
  43. HKEY m_hKey;
  44. };
  45. friend class CRegistry;
  46. CSmartBuffer<CRegKey> m_KeysToSave;
  47. CSmartBuffer<CStr> m_KeysToExclude;
  48. };
  49. #endif // !defined(AFX_REGANALYZER_H__655EE78C_3742_4D24_BB60_C92B55676851__INCLUDED_)