Changeset 70205 in vbox for trunk/src/VBox/Runtime/r3/socket.cpp
- Timestamp:
- Dec 18, 2017 3:13:28 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/socket.cpp
r70198 r70205 460 460 AssertReturn(g_pfnsocket, VERR_NOT_SUPPORTED); 461 461 AssertReturn(g_pfnclosesocket, VERR_NOT_SUPPORTED); 462 AssertReturn(g_pfnWSAStartup, VERR_NOT_SUPPORTED); 463 464 /* Initialize WinSock. */ 465 WORD const wVersionRequested = MAKEWORD(1, 1); 466 WSADATA wsaData; 467 RT_ZERO(wsaData); 468 int rcWsa = g_pfnWSAStartup(wVersionRequested, &wsaData); 469 AssertMsgReturn(wsaData.wVersion >= wVersionRequested && rcWsa == 0, 470 ("Wrong winsock version %#x rcWsa=%#x (%d)\n", wsaData.wVersion, rcWsa, rcWsa), 471 VERR_NOT_SUPPORTED); 462 472 #endif 463 473 … … 688 698 || !g_pfngethostbyname) 689 699 return VERR_NOT_SUPPORTED; 690 WORD 691 WSADATA wsaData;700 WORD const wVersionRequested = MAKEWORD(1, 1); 701 WSADATA wsaData; 692 702 RT_ZERO(wsaData); 693 rc = g_pfnWSAStartup(wVersionRequested, &wsaData); 694 if (wsaData.wVersion != wVersionRequested) 695 { 696 AssertMsgFailed(("Wrong winsock version\n")); 697 return VERR_NOT_SUPPORTED; 698 } 703 int rcWsa = g_pfnWSAStartup(wVersionRequested, &wsaData); 704 AssertMsgReturn(wsaData.wVersion >= wVersionRequested && rcWsa == 0, 705 ("Wrong winsock version %#x rcWsa=%#x (%d)\n", wsaData.wVersion, rcWsa, rcWsa), 706 VERR_NOT_SUPPORTED); 699 707 # define gethostbyname g_pfngethostbyname 700 708 #endif … … 780 788 return VERR_NOT_SUPPORTED; 781 789 /** @todo someone should check if we really need 2, 2 here */ 782 WORD wVersionRequested = MAKEWORD(2, 2); 783 WSADATA wsaData; 784 RT_ZERO(wszData); 785 rc = WSAStartup(wVersionRequested, &wsaData); 786 if (wsaData.wVersion != wVersionRequested) 787 { 788 AssertMsgFailed(("Wrong winsock version\n")); 789 return VERR_NOT_SUPPORTED; 790 } 790 WORD const wVersionRequested = MAKEWORD(2, 2); 791 WSADATA wsaData; 792 RT_ZERO(wsaData); 793 int rcWsa = g_pfnWSAStartup(wVersionRequested, &wsaData); 794 AssertMsgReturn(wsaData.wVersion >= wVersionRequested && rcWsa == 0, 795 ("Wrong winsock version %#x rcWsa=%#x (%d)\n", wsaData.wVersion, rcWsa, rcWsa), 796 VERR_NOT_SUPPORTED); 791 797 # define getaddrinfo g_pfngetaddrinfo 792 798 # define freeaddrinfo g_pfnfreeaddrinfo
Note:
See TracChangeset
for help on using the changeset viewer.