A couple of suggestions:
- 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?
- 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.
Using the MESSAGE_RESOURCE_BLOCK and MESSAGE_RESOURCE_ENTRY structures I could I load a messagestring I guess, but that doesn't test the behaviour of FindResource anymore. Or do i see things wrong here?
Trying to load a non existing messagetable from another dll with FindResource gives ERROR_RESOURCE_TYPE_NOT_FOUND. Or is that not what you meant?
and drop FormatMessageW tests.
Ok i'll do that
"Louis Lenders" xerox_xerox2000@yahoo.co.uk wrote:
- 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.
- 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.