22 AutoHandle file1(CreateFileW(file1Path, GENERIC_READ, FILE_SHARE_READ,
23 nullptr, OPEN_EXISTING, 0,
nullptr));
24 if (file1 == INVALID_HANDLE_VALUE)
28 AutoHandle file2(CreateFileW(file2Path, GENERIC_READ, FILE_SHARE_READ,
29 nullptr, OPEN_EXISTING, 0,
nullptr));
30 if (file2 == INVALID_HANDLE_VALUE)
35 DWORD fileSize1 = GetFileSize(file1.
get(),
nullptr);
36 DWORD fileSize2 = GetFileSize(file2.
get(),
nullptr);
37 if (INVALID_FILE_SIZE == fileSize1 || INVALID_FILE_SIZE == fileSize2)
42 if (fileSize1 != fileSize2)
53 for (DWORD
i = 0;
i < numBlocks;
i++)
76 if (!ReadFile(file1.
get(), buf1, leftOver, &readAmount,
nullptr) ||
77 readAmount != leftOver)
82 if (!ReadFile(file2.
get(), buf2, leftOver, &readAmount,
nullptr) ||
83 readAmount != leftOver)
88 if (memcmp(buf1, buf2, leftOver))
const wchar_t *typedef BOOL
BOOL VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL &sameContent)
Verifies if 2 files are byte for byte equivalent.
#define COMPARE_BLOCKSIZE