kernel32: fix last error result on CreateFile

Mike McCormack mike at
Fri Mar 17 19:21:05 CST 2006

Víctor Manuel Álvarez García wrote:

> If CreateFile is called with CREATE_ALWAYS or
> OPEN_ALWAYS flags, and the file already exists, the
> function should success but the result of GetLastError
> after the call must be ERROR_ALREADY_EXISTS. Wine was
> not not setting the proper error code and GetLastError
> just returned ERROR_SUCCESS.
> Wine is great, good work guys!
> Here goes my contribution,

Thanks for the contribution!   It would be great to write a test for 
this behaviour too, and add it to dlls/kernel/tests/file.c


More information about the wine-devel mailing list