Commit add814af authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

reg/tests: Check for elevated privileges before cleaning up the Windows 3.1 test…

reg/tests: Check for elevated privileges before cleaning up the Windows 3.1 test key and running unit tests. Signed-off-by: 's avatarHugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 2ff9a8f0
......@@ -4204,14 +4204,11 @@ static void test_import_31(void)
{
LONG err;
HKEY hkey;
DWORD r;
err = RegDeleteKeyA(HKEY_CLASSES_ROOT, KEY_BASE);
ok(err == ERROR_SUCCESS || err == ERROR_FILE_NOT_FOUND, "RegDeleteKeyA failed: %d\n", err);
DWORD dispos, r;
/* Check if reg.exe is running with elevated privileges */
err = RegCreateKeyExA(HKEY_CLASSES_ROOT, KEY_BASE, 0, NULL, REG_OPTION_NON_VOLATILE,
KEY_READ|KEY_SET_VALUE, NULL, &hkey, NULL);
KEY_READ|KEY_SET_VALUE, NULL, &hkey, &dispos);
if (err == ERROR_ACCESS_DENIED)
{
win_skip("reg.exe is not running with elevated privileges; "
......@@ -4219,6 +4216,9 @@ static void test_import_31(void)
return;
}
if (dispos == REG_OPENED_EXISTING_KEY)
delete_value(hkey, NULL);
/* Test simple value */
test_import_str("REGEDIT\r\n"
"HKEY_CLASSES_ROOT\\" KEY_BASE " = Value0\r\n", &r);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment