kernel32: Set last error to ERROR_FILE_NOT_FOUND if lpAppName is NULL.

This commit is contained in:
James Hawkins 2009-03-22 14:37:31 -07:00 committed by Alexandre Julliard
parent 287b07fddc
commit f1308f9b40
2 changed files with 3 additions and 7 deletions

View File

@ -1446,8 +1446,7 @@ BOOL WINAPI WritePrivateProfileStringW( LPCWSTR section, LPCWSTR entry,
else if (PROFILE_Open( filename, TRUE ))
{
if (!section) {
FIXME("(NULL?,%s,%s,%s)?\n",
debugstr_w(entry), debugstr_w(string), debugstr_w(filename));
SetLastError(ERROR_FILE_NOT_FOUND);
} else {
ret = PROFILE_SetString( section, entry, string, FALSE);
PROFILE_FlushFile();

View File

@ -855,11 +855,8 @@ static void test_WritePrivateProfileString(void)
SetLastError(0xdeadbeef);
ret = WritePrivateProfileStringA(NULL, "key", "string", path);
ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
todo_wine
{
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
}
ok(GetLastError() == ERROR_FILE_NOT_FOUND,
"Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
ok(check_file_data(path, data), "File doesn't match\n");
DeleteFileA(path);