Winsock problem in 64 bit windows
-
Hi everybody, The line of code
SOCKET sock = socket(AF_NETBIOS, SOCK_DGRAM, 0);
works fine in windows XP 32 bit but fails in windows server 2003 enterprise 64 Bit. The WSAGetLastError() returns error code 10047. Any idea where I am going wrong? The code is given below which prints "Success" in 32 bit OS but prints Error: 10047 in 64 bit OS
void main()
{
WSADATA sockdata;
WORD wVersionRequested = MAKEWORD(2, 2);int stat = WSAStartup(wVersionRequested,&sockdata); if(stat != 0) { printf("Error initializing winsock\\r\\n"); return; } SOCKET sock = socket(AF\_NETBIOS, SOCK\_DGRAM, 0); DWORD errcode = WSAGetLastError(); if(sock != INVALID\_SOCKET) { closesocket(sock); printf("Success\\r\\n"); } else { printf("\\r\\nError: %d\\r\\n",errcode); } WSACleanup();
}
cheers Varghese Paul
-
Hi everybody, The line of code
SOCKET sock = socket(AF_NETBIOS, SOCK_DGRAM, 0);
works fine in windows XP 32 bit but fails in windows server 2003 enterprise 64 Bit. The WSAGetLastError() returns error code 10047. Any idea where I am going wrong? The code is given below which prints "Success" in 32 bit OS but prints Error: 10047 in 64 bit OS
void main()
{
WSADATA sockdata;
WORD wVersionRequested = MAKEWORD(2, 2);int stat = WSAStartup(wVersionRequested,&sockdata); if(stat != 0) { printf("Error initializing winsock\\r\\n"); return; } SOCKET sock = socket(AF\_NETBIOS, SOCK\_DGRAM, 0); DWORD errcode = WSAGetLastError(); if(sock != INVALID\_SOCKET) { closesocket(sock); printf("Success\\r\\n"); } else { printf("\\r\\nError: %d\\r\\n",errcode); } WSACleanup();
}
cheers Varghese Paul
-
Hi everybody, The line of code
SOCKET sock = socket(AF_NETBIOS, SOCK_DGRAM, 0);
works fine in windows XP 32 bit but fails in windows server 2003 enterprise 64 Bit. The WSAGetLastError() returns error code 10047. Any idea where I am going wrong? The code is given below which prints "Success" in 32 bit OS but prints Error: 10047 in 64 bit OS
void main()
{
WSADATA sockdata;
WORD wVersionRequested = MAKEWORD(2, 2);int stat = WSAStartup(wVersionRequested,&sockdata); if(stat != 0) { printf("Error initializing winsock\\r\\n"); return; } SOCKET sock = socket(AF\_NETBIOS, SOCK\_DGRAM, 0); DWORD errcode = WSAGetLastError(); if(sock != INVALID\_SOCKET) { closesocket(sock); printf("Success\\r\\n"); } else { printf("\\r\\nError: %d\\r\\n",errcode); } WSACleanup();
}
cheers Varghese Paul
http://msdn.microsoft.com/en-us/library/bb870913(VS.85).aspx[^] "Netbios is not supported on Windows Vista, Windows Server 2008, and subsequent versions of the operating system." Maybe that list should include Win2003 x64 as well.
...cmk The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying. - John Carmack