setupapi/tests: Skip devinst tests if the user doesn't have admin rights.

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


Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 dlls/setupapi/tests/devinst.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index c8452d6..6ca0e92 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -1349,8 +1349,17 @@ static void testSetupDiGetINFClassA(void)
 
 START_TEST(devinst)
 {
+    HKEY hkey;
+
     init_function_pointers();
 
+    if ((hkey = SetupDiOpenClassRegKey(NULL, KEY_ALL_ACCESS)) == INVALID_HANDLE_VALUE)
+    {
+        skip("needs admin rights\n");
+        return;
+    }
+    RegCloseKey(hkey);
+
     if (pIsWow64Process)
         pIsWow64Process(GetCurrentProcess(), &is_wow64);
 
-- 
2.1.4




More information about the wine-patches mailing list