kernel32: Don't try to load an empty initialization file.

This commit is contained in:
James Hawkins 2009-03-22 14:37:54 -07:00 committed by Alexandre Julliard
parent 7c3529f1cc
commit 87847b47cd
2 changed files with 2 additions and 5 deletions

View File

@ -322,7 +322,7 @@ static PROFILESECTION *PROFILE_Load(HANDLE hFile, ENCODING * pEncoding)
TRACE("%p\n", hFile);
dwFileSize = GetFileSize(hFile, NULL);
if (dwFileSize == INVALID_FILE_SIZE)
if (dwFileSize == INVALID_FILE_SIZE || dwFileSize == 0)
return NULL;
buffer_base = HeapAlloc(GetProcessHeap(), 0 , dwFileSize);

View File

@ -865,10 +865,7 @@ static void test_WritePrivateProfileString(void)
"key=string\r\n";
ret = WritePrivateProfileStringA("", "key", "string", path);
ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
todo_wine
{
ok(check_file_data(path, data), "File doesn't match\n");
}
ok(check_file_data(path, data), "File doesn't match\n");
DeleteFileA(path);
/* NULL lpKeyName */