platform/dns.c: Intercept router host names

This commit is contained in:
Tau 2019-09-07 13:49:04 -04:00
parent 29d9561a28
commit 0242c5efc8
3 changed files with 21 additions and 0 deletions

View File

@ -63,6 +63,14 @@ void dns_config_load(struct dns_config *cfg, const wchar_t *filename)
_countof(default_),
filename);
GetPrivateProfileStringW(
L"dns",
L"router",
default_,
cfg->router,
_countof(cfg->router),
filename);
GetPrivateProfileStringW(
L"dns",
L"startup",

View File

@ -12,6 +12,7 @@ struct amvideo_config {
struct dns_config {
bool enable;
wchar_t router[128];
wchar_t startup[128];
wchar_t billing[128];
wchar_t aimedb[128];

View File

@ -17,6 +17,18 @@ HRESULT dns_platform_hook_init(const struct dns_config *cfg)
return S_FALSE;
}
hr = dns_hook_push(L"tenporouter.loc", cfg->router);
if (FAILED(hr)) {
return hr;
}
hr = dns_hook_push(L"bbrouter.loc", cfg->router);
if (FAILED(hr)) {
return hr;
}
hr = dns_hook_push(L"naominet.jp", cfg->startup);
if (FAILED(hr)) {