GetLastError strangeness with FindClose

Kelly Leahy kellyleahy at
Sat Aug 16 15:05:23 CDT 2003

> AFAIK, it's never said that a successful function call should set the
> last error to 0. This only thing MS claims is that when a function
> fails, the last error is set to a error code explaining that error.
> Moreover, wine's goal is not to make a better design than windows, but
> to mimic windows behavior. So, if FindClose doesn't change the last
> error on success, wine should do the same (especially if some known
> program depends on it)

You're missing my point (or maybe you're not and you just don't agree with
me - in either case, let me make my point in a clearer way).  If windows
doesn't say it won't change the last error, we, as programmers, should
assume that it might.  In my experience, a large number of functions that
set last error on failure set it to ERROR_SUCCESS on success.  For the few
that don't, I would consider this an oversight on MS's part, and I wouldn't
expect it to exist in all implementations of a particular function (across
OS versions).

Just my 0.02.


More information about the wine-devel mailing list