kernel32: add more tests for FormatMessage{A,W}

Dmitry Timoshkov dmitry at
Wed Oct 28 07:48:09 CDT 2009

"Louis Lenders" <xerox_xerox2000 at> wrote:

>>1. There is no point in testing last error if an API didn't fail
> Couldn't it be that the API sets ERROR_SUCCES if it doesn't fail?

That's unusual, there are APIs that do that, but they are exceptions,
and it's worth to test (and fix) it only if there is an app that depends
on this.

>>2. It would be helpful to simultaneously test return values and
>>last error for FindResource, which should have similar behaviour
>>(and the bug) to FormatMessage
> Could you explain a bit more what exactly to test? I can load the whole
> messagetable with FindResource from kernel32, but that always succeeds
> of course.

FormatMessage uses the same backend to find the requested resource as
FindResource does, so I'd guess that they both fail in the same way
when a resource id or a language does not exist in the module. Parsing
an actual resource data is not necessary.


More information about the wine-devel mailing list