msvcp90: Fix __cdecl functions definitions that returns structures

Piotr Caban piotr.caban at
Mon Jul 2 09:02:06 CDT 2012

On 06/29/12 19:33, Alexandre Julliard wrote:
> Piotr Caban<piotr at>  writes:
>> In code produced by gcc callee removes hidden return argument. In code
>> produced by MS Visual Studio caller is responsible for removing the
>> hidden argument.
> That's only for structures larger than 8 bytes, which isn't the case at
> least for _Getcoll. Some tests would probably be a good idea.

I'm not sure how to write tests for these functions. I see two 
possibilities in case of functions returning "big" structures (e.g. 
_Getctype). Should I write a test that calls the function in a loop to 
make sure the tests are crashing if it corrupts the stack? Or maybe it's 
better to write a test in assembler that checks %esp value before and 
after calling the function?

In case of _Getcoll (and _Getcvt) the structure should be returned in 
%eax and %edx registers. Current implementation tries to pass hidden 
argument. Is it acceptable to test this case by passing inaccessible 
memory pointer so the test crashes if implementation tries to write to 
it? Do you have any other idea of testing it?


More information about the wine-devel mailing list