mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 20:51:58 +00:00
ldns for windows first working version
This commit is contained in:
@@ -144,6 +144,32 @@ static switch_status_t load_config(void)
|
||||
}
|
||||
|
||||
done:
|
||||
#ifdef _MSC_VER
|
||||
if (!globals.server) {
|
||||
HKEY hKey;
|
||||
DWORD data_sz;
|
||||
char* buf;
|
||||
RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters",
|
||||
0, KEY_QUERY_VALUE, &hKey);
|
||||
|
||||
RegQueryValueEx(hKey, "DhcpNameServer", NULL, NULL, NULL, &data_sz);
|
||||
if (globals.server) {
|
||||
free(globals.server);
|
||||
}
|
||||
buf = (char*)malloc(data_sz + 1);
|
||||
|
||||
RegQueryValueEx(hKey, "DhcpNameServer", NULL, NULL, (LPBYTE)buf, &data_sz);
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
||||
if(buf[data_sz - 1] != 0) {
|
||||
buf[data_sz] = 0;
|
||||
}
|
||||
globals.server = buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (xml) {
|
||||
switch_xml_free(xml);
|
||||
|
||||
Reference in New Issue
Block a user