http://bugs.winehq.org/show_bug.cgi?id=17898
--- Comment #1 from Jeff Zaroyko jeffz@jeffz.name 2009-03-30 19:00:03 --- I'm not sure if the problem in winsock for your application, but I have had a look at the log you have provided and have come up with a patch to more closely match Windows, the only thing Wine doesn't do is set the same lasterror code.
Try it to see if it makes a difference, otherwise the problem is likely somewhere else.