GetLastError strangeness with FindClose

Alex Pasadyn ajp at mail.utexas.edu
Sat Aug 16 18:46:25 CDT 2003


Eric Pouech wrote:
> 
>> 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).
> 
> let's just test Alex small test program on various platforms and see 
> what gives...
> A+
> 
> 

FWIW, the original program that was giving me a problem was the Diablo 2 
1.09 to 1.10beta updater.  The workaround I found was to move all the 
files from my "save" subdirectory to somewhere else, run the patch, and 
then move them all back.  Having any files in the save directory caused 
it to bomb out with a message about FindNextFile failing due to "success".

I made that test program based on the series of calls I saw in the relay 
trace, and it gave a different result with Windows (9x was all I had to 
test) from Wine.

Anyway, if I were writing it I would put the check for the error code 
before the FindClose, but it wasn't my program...

Cheers,
-ajp




More information about the wine-devel mailing list