Commit 22434f49 authored by Dan Kegel's avatar Dan Kegel Committed by Alexandre Julliard

iphlpapi: _res is per-thread in glibc.

parent e66198ae
......@@ -66,16 +66,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi);
#define INADDR_NONE ~0UL
#endif
static int resolver_initialised;
/* call res_init() just once because of a bug in Mac OS X 10.4 */
/* Call once per thread on systems that have per-thread _res. */
/* FIXME: should do same fix in dnsapi (or use dnsapi here?) */
static void initialise_resolver(void)
{
if (!resolver_initialised)
{
if ((_res.options & RES_INIT) == 0)
res_init();
resolver_initialised = 1;
}
}
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
......
......@@ -765,11 +765,12 @@ GetBestRoute
IpReleaseAddress
IpRenewAddress
*/
static void testWin98Functions(void)
static DWORD CALLBACK testWin98Functions(void *p)
{
testGetInterfaceInfo();
testGetAdaptersInfo();
testGetNetworkParams();
return 0;
}
static void testGetPerAdapterInfo(void)
......@@ -885,9 +886,16 @@ START_TEST(iphlpapi)
loadIPHlpApi();
if (hLibrary) {
HANDLE thread;
testWin98OnlyFunctions();
testWinNT4Functions();
testWin98Functions();
/* run testGetXXXX in two threads at once to make sure we don't crash in that case */
thread = CreateThread(NULL, 0, testWin98Functions, NULL, 0, NULL);
testWin98Functions(NULL);
WaitForSingleObject(thread, INFINITE);
testWin2KFunctions();
test_GetAdaptersAddresses();
freeIPHlpApi();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment