Update WinDNSHelper.cpp

This commit is contained in:
wangyi2005 2025-03-01 22:38:45 +08:00 committed by GitHub
parent a2162c01e3
commit 1993be973e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -335,6 +335,7 @@ void WinDNSHelper::setDNS(uint64_t nwid, const char* domain, const std::vector<I
RegSetKeyValueA(dnsKey, NULL, "GenericDNSServers", REG_SZ, serverValue.data(), serverValue.length());
RegSetKeyValueA(dnsKey, NULL, "IPSECCARestriction", REG_SZ, "", 0);
std::string d = "." + std::string(domain);
if(d=="..") d=".";
RegSetKeyValueA(dnsKey, NULL, "Name", REG_MULTI_SZ, d.data(), d.length());
DWORD version = 2;
RegSetKeyValueA(dnsKey, NULL, "Version", REG_DWORD, &version, sizeof(DWORD));
@ -350,4 +351,4 @@ void WinDNSHelper::removeDNS(uint64_t nwid)
}
}
}
}