You may want to try and write a regression test (a small amount of C code calling the function/functions in such a way that the problem you see can be seen as output value) to show what windows does in this case; if then the values are corrected under wine with your changes, it shows you're going in the right direction :-)
HTH,
Joris