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

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2016-12-20 12:08:35 +01:00 committed by Alexandre Julliard
parent 0e3a0e13ef
commit 53b7a36319
1 changed files with 8 additions and 0 deletions

View File

@ -455,6 +455,14 @@ static void test_profile_items(void)
goto cleanup;
}
snprintf(path, MAX_PATH, "%s\\TestDir", commonprogs);
if (!CreateDirectoryA(path, NULL) && GetLastError() == ERROR_ACCESS_DENIED)
{
skip("need admin rights\n");
return;
}
RemoveDirectoryA(path);
create_inf_file(inffile, inf);
sprintf(path, "%s\\%s", CURR_DIR, inffile);
run_cmdline("DefaultInstall", 128, path);