http://bugs.winehq.org/show_bug.cgi?id=13350
--- Comment #11 from Rein Klazes wijn@online.nl 2009-07-27 01:23:49 --- I am responsible for this piece of code, yet I wasn't aware of this bug until now. Sorry for that.
At first the patch looked reasonable to me, so I built some tests for it. That showed the patch was not correct. There is a good point for those tests.
Anyway I submitted a better patch:
http://www.winehq.org/pipermail/wine-patches/2009-July/076445.html
The tests are interactive, you will have to set WINETEST_INTERACTIVE to 1 to enable them.