
22 Feb
2010
22 Feb
'10
6:28 p.m.
eg wrote:
"If the function fails, the return value is INVALID_SET_FILE_POINTER. To get extended error information, call GetLastError."
if ( dwPtrLow == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR )
It seems to me that the GetLastError() call as part of the test only makes room for problems... The error test is *defined* as dwPtrLow == INVALID_SET_FILE_POINTER And the GetLastError() should be called only if an error is detected. In fact, if this test had been just the test against INVALID_SET_FILE_POINTER, the code would have worked correctly even without the SetLastError() clearing the error code. Erik