urlmon/tests: Skip domain tests if the user doesn't have admin rights.

Hans Leidekker hans at codeweavers.com
Mon Dec 19 04:38:54 CST 2016


Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 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();
 }
-- 
2.1.4




More information about the wine-patches mailing list