[PATCH] mscoree/tests: The comtest registry tests may require elevated privileges.

Francois Gouget fgouget at codeweavers.com
Tue Dec 1 23:54:40 CST 2020


On Windows Vista and 7 run_registry_test() requires having elevated
privileges.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 dlls/mscoree/tests/comtest.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/mscoree/tests/comtest.c b/dlls/mscoree/tests/comtest.c
index b62d527bb95..4b2183bac3a 100644
--- a/dlls/mscoree/tests/comtest.c
+++ b/dlls/mscoree/tests/comtest.c
@@ -168,6 +168,12 @@ static void run_registry_test(run_type run)
 
     sprintf(buffer, "CLSID\\%s", wine_dbgstr_guid(&CLSID_Test), "");
     ret = RegCreateKeyA( HKEY_CLASSES_ROOT, buffer, &hkey );
+    if (ret == ERROR_ACCESS_DENIED && !IsUserAnAdmin())
+    {
+        win_skip("cannot run the registry tests due to user not being admin\n");
+        RegCloseKey(hkey);
+        return;
+    }
     ok(ret == ERROR_SUCCESS, "RegCreateKeyA returned %x\n", ret);
 
     ret = RegSetKeyValueA(hkey, "InprocServer32", NULL, REG_SZ, "mscoree.dll", 11);
-- 
2.20.1



More information about the wine-devel mailing list