Skip to content
Snippets Groups Projects
Commit cca75cc1 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard
Browse files

kernel32/tests: Don't crash when run as a normal user.

parent dda0fe45
No related branches found
No related tags found
No related merge requests found
......@@ -681,7 +681,14 @@ static void test_GetPrivateProfileString(const char *content, const char *descri
ok(!lstrcmpA(buf, "default"), "Expected \"default\", got \"%s\"\n", buf);
GetWindowsDirectoryA(windir, MAX_PATH);
GetTempFileNameA(windir, "pre", 0, path);
SetLastError(0xdeadbeef);
ret = GetTempFileNameA(windir, "pre", 0, path);
if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
{
skip("Not allowed to create a file in the Windows directory\n");
DeleteFileA(filename);
return;
}
tempfile = strrchr(path, '\\') + 1;
create_test_file(path, content, lstrlenA(content));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment