SetFilePointer error handling incorrect. Affects files > 2Gb
Brought to you by:
tpsfadmin
The SetFilePointer calls in fffile.inc in functions FFGetPositionFilePrim32, FFPositionFilePrim32 and FFPositionFileEOFPrim32 are followed by testing the result against $FFFFFFFF and raising an exception if equal. According to
http://msdn.microsoft.com/en-us/library/aa365541\(VS.85).aspx
this is incorrect for files over 2Gb. It says :
"If the return value is INVALID_SET_FILE_POINTER and if lpDistanceToMoveHigh is non-NULL, an application must call GetLastError to determine whether or not the function has succeeded or failed."
Hello,
I've made a fix for this bug as part of a class at MFF UK (a czech university faculty), it's available for download at http://atrey.karlin.mff.cuni.cz/~tauferp/fffile.patch .
Have a nice day