Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
FileSize failure HRESULT lost in DetectPackagePayloadsCached #4288
In core.cpp the function DetectPackagePayloadsCached has this code:
If FileSize returns a error then it also returns file size 0. Thus the comparison at the start of the else will overwrite the return code with the generic ERROR_FILE_CORRUPT. This does not allow postmortem debugging based on the log file. Better would be to retain the HRESULT from FileSize and present that value in the log. I'd suggest modifying the code as follows:
The new test for SUCCEEDED(hr) means that the generic error code will only be returned if the actual file size differs from the stored value.