Fix sockets for Windows CE

Version numbers for CE are higher then for the desktop,
so insert a check for this, as the api is not working as
for windows 7 and above.

Change-Id: I79baba9183e11c714cffd0bb43327c197043d6e0
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
bb10
Andreas Holzammer 2012-08-13 17:40:08 +02:00 committed by Qt by Nokia
parent 0fa52909fd
commit 853f78e125
1 changed files with 2 additions and 2 deletions

View File

@ -325,12 +325,12 @@ bool QNativeSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType soc
SOCKET socket = INVALID_SOCKET;
// Windows 7 or later, try the new API
if (osver >= QSysInfo::WV_6_1)
if ((osver & QSysInfo::WV_NT_based) >= QSysInfo::WV_6_1)
socket = ::WSASocket(protocol, type, 0, NULL, 0, WSA_FLAG_NO_HANDLE_INHERIT | WSA_FLAG_OVERLAPPED);
// previous call fails if the windows 7 service pack 1 or hot fix isn't installed.
// Try the old API if the new one failed on Windows 7, or always on earlier versions
if (socket == INVALID_SOCKET && osver <= QSysInfo::WV_6_1) {
if (socket == INVALID_SOCKET && ((osver & QSysInfo::WV_NT_based) <= QSysInfo::WV_6_1)) {
socket = ::WSASocket(protocol, type, 0, NULL, 0, WSA_FLAG_OVERLAPPED);
#ifdef HANDLE_FLAG_INHERIT
if (socket != INVALID_SOCKET) {