#include #include #include #include #include #include "regdiff.h" DWORD SnapshotCallback ( IN PVOID Context, IN DWORD NodesProcessed ) { return ERROR_SUCCESS; } BOOL TakeSnapshot ( IN HREGANL RegAnalyzer, IN PCTSTR SnapshotFile, IN PFNSNAPSHOTPROGRESS ProgressCallback, IN PVOID Context, IN DWORD MaxLevel, IN HANDLE hEvent); bool ReadMultipleKeys(HANDLE hRA) //read in some registry key names from the console { _tprintf(TEXT("All Names are case sensitive\n")); bool result = false; while (true) { _tprintf(TEXT("Please enter the root key name (HKLM, HKCU, HKCR, HKU, HKCC)\n" TEXT("or type 'quit' to stop entering keys\n"))); TCHAR buf1[1024]; _tscanf(TEXT("%s"), buf1); if (_tcscmp(buf1, TEXT("quit")) == 0) break; _tprintf(TEXT("Pleae enter the sub key name (e.g. SOFTWARE\\Microsoft\n")); TCHAR buf2[1024]; _tscanf(TEXT("%s"), buf2); AddRegistryKey(hRA, buf1, buf2); result = true; } return result; } int __cdecl _tmain(int Argc, TCHAR **Argv) { TCHAR helpmsg[] = TEXT("\n\ntryregdiff usage:\n") TEXT("_________________\n\n") TEXT("Take Snapshot:\n") TEXT(" tryregdiff /s \n\n") TEXT("Take Snapshot with multiple keys:\n") TEXT(" tryregdiff /k \n\n") TEXT("Compute Differences:\n") TEXT(" tryregdiff /d \n\n") TEXT("Install Differences:\n") TEXT(" tryregdiff /i \n\n"); bool bReadyToGo = false; if (Argc >= 3) { for (int k=0; k