http://bugs.winehq.org/show_bug.cgi?id=12302
Florian Friedrich friedrich@hooster.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |friedrich@hooster.de
--- Comment #72 from Florian Friedrich friedrich@hooster.de 2008-07-17 04:34:35 --- (In reply to comment #71)
In the API documentation for WSAGetLastError (http://msdn.microsoft.com/en-us/library/ms898741.aspx) you can read the following: "The return value indicates the error code for this thread's last Windows Sockets operation that failed"
If WSASendTo returns 0, then it did not fail, so a call to WSAGetLastError would be undefined (returning the last error of the last function that really failed). But it may be, that the Windows function resets the last error. But by contract, it would not have to do so, or is not even allowed to do so. So, the error in the lotroclient would be, that it calls WSAGetLastError regardless of the result of the WSASendTo.
If the Windows function resets the last error on success, then of course the wine function should do this as well, although it would be wrong, according to the API documentation.
Well, your documentation is for Windows CE (look at the bottom of the page). Here is the documentation for Windows 95 to Windows Vista: http://msdn.microsoft.com/en-us/library/ms741580(VS.85).aspx
And there you can find the following sentences: "If a function call's return value indicates that error or other relevant data was returned in the error code, WSAGetLastError should be called immediately. This is necessary because some functions may reset the last extended error code to 0 if they succeed, overwriting the extended error code returned by a previously failed function."