From f1308f9b40d65e795e8d15f14fd8be7defcb4ed0 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Sun, 22 Mar 2009 14:37:31 -0700 Subject: [PATCH] kernel32: Set last error to ERROR_FILE_NOT_FOUND if lpAppName is NULL. --- dlls/kernel32/profile.c | 3 +-- dlls/kernel32/tests/profile.c | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dlls/kernel32/profile.c b/dlls/kernel32/profile.c index 8b77aaa3805..fea858c18e0 100644 --- a/dlls/kernel32/profile.c +++ b/dlls/kernel32/profile.c @@ -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(); diff --git a/dlls/kernel32/tests/profile.c b/dlls/kernel32/tests/profile.c index 6000ffb2d4d..0ba3fd1cc1f 100644 --- a/dlls/kernel32/tests/profile.c +++ b/dlls/kernel32/tests/profile.c @@ -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);