diff options
author | Andreas Holzammer <andreas.holzammer@kdab.com> | 2012-08-13 17:40:08 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-14 03:56:55 +0200 |
commit | 853f78e1259e46a3072b3aef2b4612cdc5232510 (patch) | |
tree | e7f56ff3d08df955aed171b8019a0f2cc1d0eeb5 /src/network | |
parent | 0fa52909fd56275cd3f56640fb61cc1bdeb98d76 (diff) |
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>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/socket/qnativesocketengine_win.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index aebb9dc40e..b0f284fa4e 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -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) { |