one more correction

svn path=/trunk/; revision=6867
This commit is contained in:
Martin Fuchs 2003-12-06 20:30:35 +00:00
parent 3e8376db45
commit ba1e3f3b39

View file

@ -92,7 +92,7 @@ int ScanNTFSStreams(Entry* entry, HANDLE hFile)
DWORD error = GetLastError();
if (error != ERROR_SEEK) {
BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx);
BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx); // terminate BackupRead() loop
THROW_EXCEPTION(error);
//break;
}
@ -103,7 +103,7 @@ int ScanNTFSStreams(Entry* entry, HANDLE hFile)
BYTE buffer[4096];
while(hdr.Size.QuadPart > 0) {
if (!BackupRead(hFile, buffer, sizeof(buffer), &read, FALSE, FALSE, &ctx))
if (!BackupRead(hFile, buffer, sizeof(buffer), &read, FALSE, FALSE, &ctx) || read!=sizeof(buffer))
break;
hdr.Size.QuadPart -= read;
@ -111,7 +111,7 @@ int ScanNTFSStreams(Entry* entry, HANDLE hFile)
}
}
if (!BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx))
if (!BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx)) // terminate BackupRead() loop
THROW_EXCEPTION(GetLastError());
return cnt;