Commit cca75cc1 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

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

parent dda0fe45
...@@ -681,7 +681,14 @@ static void test_GetPrivateProfileString(const char *content, const char *descri ...@@ -681,7 +681,14 @@ static void test_GetPrivateProfileString(const char *content, const char *descri
ok(!lstrcmpA(buf, "default"), "Expected \"default\", got \"%s\"\n", buf); ok(!lstrcmpA(buf, "default"), "Expected \"default\", got \"%s\"\n", buf);
GetWindowsDirectoryA(windir, MAX_PATH); 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; tempfile = strrchr(path, '\\') + 1;
create_test_file(path, content, lstrlenA(content)); create_test_file(path, content, lstrlenA(content));
......
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