[Xcb] [PATCH 3/3] Use WSAStartup()/WSACleanup() on WIN32

Rémi Denis-Courmont remi at remlab.net
Thu Jan 5 13:55:30 PST 2012


Le jeudi 5 janvier 2012 23:28:06 Josh Triplett, vous avez écrit :
> What happens if the application using XCB has already called WSAStartup,
> and passes a lower version number than 2.2?

If the sockets library does not support version 2.2, WSAStartup() will fail. 
Then XCB should either fail, or try to negotiate another usable version with 
the library.

> Will XCB's call to WSAStartup cause Winsock to start assuming 2.2
> semantics instead of whatever older semantics the application requested?

The new semantics would be new functions or parameters that a Winsock 1.1 
should not be using in the first place. Unless the application is buggy, this 
cannot be a problem.

> Or will Winsock just tell XCB to use the older version?

If the version requested by XCB is not supported, WSAStartup() will fail. Note 
that there is a bug in the patch: XCB should never call WSACleanup() if 
WSAStartup() did not succeed.

> In the latter case, can XCB live with that?

Someone could check if XCB can live with Winsock 1.1. However, support for 
versions of Windows without Winsock 1.x has ceased many years ago. So most 
probably nobody cares.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis


More information about the Xcb mailing list