Subject: Re: [boost] [iostreams]mapped_file bug on Win32?
From: Nelson, Erik - 2 (erik.l.nelson_at_[hidden])
Date: 2010-02-22 13:28:18


 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