#define ARES_ELOADIPHLPAPI 21
#define ARES_ELOADADVAPI32 22
#define ARES_EADDRGetNetworkParams 23
-#define ARES_EADDRSYSTEMFUNCTION036 24
/* Flag values */
#define ARES_FLAG_USEVC (1 << 0)
fpSystemFunction036 = (fpSystemFunction036_t)
GetProcAddress(hnd_advapi32, "SystemFunction036");
- if (!fpSystemFunction036)
- {
- FreeLibrary(hnd_advapi32);
- FreeLibrary(hnd_iphlpapi);
- return ARES_EADDRSYSTEMFUNCTION036;
- }
+
+ /*
+ * Intentionally avoid checking if the address of SystemFunction036, a.k.a.
+ * RtlGenRandom, has been located or not. This function is only available on
+ * WinXP and later. When unavailable c-ares uses portable rand() function.
+ */
#endif
return ARES_SUCCESS;
"Illegal hints flags specified",
"Error loading iphlpapi.dll",
"Error loading advapi32.dll",
- "Unknown GetNetworkParams function address",
- "Unknown SystemFunction036 function address"
+ "Could not find GetNetworkParams function"
};
if(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext)))