Hans Leidekker : urlmon/tests: Skip domain tests if the user doesn' t have admin rights.
Alexandre Julliard
julliard at winehq.org
Mon Dec 19 16:53:07 CST 2016
Module: wine
Branch: master
Commit: 3a8801b1cc3aa2720dd2e189fc35cf856afb282c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3a8801b1cc3aa2720dd2e189fc35cf856afb282c
Author: Hans Leidekker <hans at codeweavers.com>
Date: Mon Dec 19 11:38:54 2016 +0100
urlmon/tests: Skip domain tests if the user doesn't have admin rights.
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/urlmon/tests/sec_mgr.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dlls/urlmon/tests/sec_mgr.c b/dlls/urlmon/tests/sec_mgr.c
index ad0fcf6..33e295a 100644
--- a/dlls/urlmon/tests/sec_mgr.c
+++ b/dlls/urlmon/tests/sec_mgr.c
@@ -758,7 +758,7 @@ static const zone_domain_mapping zone_domain_mappings[] = {
{"wine.testing",NULL,"*",URLZONE_CUSTOM2}
};
-static void register_zone_domains(void)
+static BOOL register_zone_domains(void)
{
HKEY domains;
DWORD res, i;
@@ -771,6 +771,12 @@ static void register_zone_domains(void)
DWORD zone = URLZONE_CUSTOM;
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);
res = RegSetValueExA(domain, "http", 0, REG_DWORD, (BYTE*)&zone, sizeof(DWORD));
@@ -810,6 +816,7 @@ static void register_zone_domains(void)
}
RegCloseKey(domains);
+ return TRUE;
}
static void unregister_zone_domains(void)
@@ -964,7 +971,7 @@ static void test_zone_domains(void)
test_zone_domain_cache();
- register_zone_domains();
+ if (!register_zone_domains()) return;
run_child_process();
unregister_zone_domains();
}
More information about the wine-cvs
mailing list