ldns for windows first working version

This commit is contained in:
Jeff Lenk
2011-03-25 17:18:16 -05:00
parent fa151503c4
commit 159efea47c
2 changed files with 45 additions and 0 deletions
+26
View File
@@ -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);