urlmon/tests: Skip domain tests if the user doesn't have admin rights.
Signed-off-by: Hans Leidekker <hans@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
162a40e145
commit
3a8801b1cc
|
@ -758,7 +758,7 @@ static const zone_domain_mapping zone_domain_mappings[] = {
|
||||||
{"wine.testing",NULL,"*",URLZONE_CUSTOM2}
|
{"wine.testing",NULL,"*",URLZONE_CUSTOM2}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void register_zone_domains(void)
|
static BOOL register_zone_domains(void)
|
||||||
{
|
{
|
||||||
HKEY domains;
|
HKEY domains;
|
||||||
DWORD res, i;
|
DWORD res, i;
|
||||||
|
@ -771,6 +771,12 @@ static void register_zone_domains(void)
|
||||||
DWORD zone = URLZONE_CUSTOM;
|
DWORD zone = URLZONE_CUSTOM;
|
||||||
|
|
||||||
res = RegCreateKeyA(domains, "local.machine", &domain);
|
res = RegCreateKeyA(domains, "local.machine", &domain);
|
||||||
|
if (res == ERROR_ACCESS_DENIED)
|
||||||
|
{
|
||||||
|
skip("need admin rights\n");
|
||||||
|
RegCloseKey(domains);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
ok(res == ERROR_SUCCESS, "RegCreateKey failed: %d\n", res);
|
ok(res == ERROR_SUCCESS, "RegCreateKey failed: %d\n", res);
|
||||||
|
|
||||||
res = RegSetValueExA(domain, "http", 0, REG_DWORD, (BYTE*)&zone, sizeof(DWORD));
|
res = RegSetValueExA(domain, "http", 0, REG_DWORD, (BYTE*)&zone, sizeof(DWORD));
|
||||||
|
@ -810,6 +816,7 @@ static void register_zone_domains(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey(domains);
|
RegCloseKey(domains);
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void unregister_zone_domains(void)
|
static void unregister_zone_domains(void)
|
||||||
|
@ -964,7 +971,7 @@ static void test_zone_domains(void)
|
||||||
|
|
||||||
test_zone_domain_cache();
|
test_zone_domain_cache();
|
||||||
|
|
||||||
register_zone_domains();
|
if (!register_zone_domains()) return;
|
||||||
run_child_process();
|
run_child_process();
|
||||||
unregister_zone_domains();
|
unregister_zone_domains();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue