kernel32/tests: Fix permission check.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
43c71d9916
commit
43c5fe11cb
@ -956,6 +956,7 @@ static void test_WritePrivateProfileString(void)
|
|||||||
LPCSTR data;
|
LPCSTR data;
|
||||||
CHAR path[MAX_PATH];
|
CHAR path[MAX_PATH];
|
||||||
CHAR temp[MAX_PATH];
|
CHAR temp[MAX_PATH];
|
||||||
|
HANDLE file;
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = WritePrivateProfileStringW(NULL, NULL, NULL, NULL);
|
ret = WritePrivateProfileStringW(NULL, NULL, NULL, NULL);
|
||||||
@ -1069,12 +1070,14 @@ static void test_WritePrivateProfileString(void)
|
|||||||
"Expected ERROR_ACCESS_DENIED, got %d\n", GetLastError());
|
"Expected ERROR_ACCESS_DENIED, got %d\n", GetLastError());
|
||||||
|
|
||||||
/* Relative paths are relative to X:\\%WINDIR% */
|
/* Relative paths are relative to X:\\%WINDIR% */
|
||||||
GetWindowsDirectoryA(temp, MAX_PATH);
|
GetWindowsDirectoryA(path, MAX_PATH);
|
||||||
GetTempFileNameA(temp, "win", 1, path);
|
strcat(path, "\\win1.tmp");
|
||||||
if (GetFileAttributesA(path) == INVALID_FILE_ATTRIBUTES)
|
file = CreateFileA(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
if (!ret && GetLastError() == ERROR_ACCESS_DENIED)
|
||||||
skip("Not allowed to create a file in the Windows directory\n");
|
skip("Not allowed to create a file in the Windows directory\n");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
CloseHandle(file);
|
||||||
DeleteFileA(path);
|
DeleteFileA(path);
|
||||||
|
|
||||||
data = "[App]\r\n"
|
data = "[App]\r\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user