# HG changeset patch # User Daniel Atallah # Date 1161223000 0 # Node ID a87c53e7b1e236e065959e3a8a7c6ba0103a97b7 # Parent d1ffbae3a73a69b3a7193ecdcf421e3ff60e0459 [gaim-migrate @ 17540] Various fixes for wingaim network manager stuff. When unable to look up network connections, assume that there is one. Fix error handling. Remove note about using WSANSPIoctl directly - it isn't supported on w2k anyway. Fix compile warning committer: Tailor Script diff -r d1ffbae3a73a -r a87c53e7b1e2 libgaim/network.c --- a/libgaim/network.c Wed Oct 18 23:41:57 2006 +0000 +++ b/libgaim/network.c Thu Oct 19 01:56:40 2006 +0000 @@ -392,9 +392,12 @@ retval = WSALookupServiceBegin(&qs, LUP_RETURN_ALL, &h); if (retval != ERROR_SUCCESS) { - gchar *msg = g_win32_error_message(retval); - gaim_debug_warning("network", "Couldn't look up connected networks. %s (%lu).\n", msg, retval); + int errorid = WSAGetLastError(); + gchar *msg = g_win32_error_message(errorid); + gaim_debug_warning("network", "Couldn't look up connected networks. %s (%d).\n", msg, errorid); g_free(msg); + + net_cnt = 1; /* Assume something is connected */ } else { char buf[1024]; WSAQUERYSET *res = (LPWSAQUERYSET) buf; @@ -461,10 +464,7 @@ retval = WSALookupServiceBegin(&qs, LUP_RETURN_ALL, &h); /* This will block until there is a network change */ - /* This is missing from the MinGW libws2_32.a as of version 3.7. - * When this patch: http://sourceforge.net/tracker/index.php?func=detail&aid=1576083&group_id=2435&atid=302435 gets into a release, we can call this directly - * retval = WSANSPIoctl(h, SIO_NSP_NOTIFY_CHANGE, NULL, 0, NULL, 0, &retLen, NULL);*/ - retval = MyWSANSPIoctl(h, SIO_NSP_NOTIFY_CHANGE, NULL, 0, NULL, 0, &retLen, NULL); + retval = MyWSANSPIoctl(h, SIO_NSP_NOTIFY_CHANGE, NULL, 0, NULL, 0, &retLen, NULL); retval = WSALookupServiceEnd(h); @@ -489,7 +489,7 @@ } if (libnm_retval == LIBNM_ACTIVE_NETWORK_CONNECTION) return TRUE; } -#elif _WIN32 +#elif define _WIN32 return (current_network_count > 0); #endif return TRUE;