SetLastError() for GetFileAttributesA.

This commit is contained in:
Jon Griffiths 2001-02-14 00:26:46 +00:00 committed by Alexandre Julliard
parent 5c2cbc6850
commit 0cfa278b02
1 changed files with 10 additions and 3 deletions

View File

@ -584,9 +584,16 @@ DWORD WINAPI GetFileAttributesA( LPCSTR name )
DOS_FULL_NAME full_name; DOS_FULL_NAME full_name;
BY_HANDLE_FILE_INFORMATION info; BY_HANDLE_FILE_INFORMATION info;
if (name == NULL || *name=='\0') return -1; if (name == NULL)
{
if (!DOSFS_GetFullName( name, TRUE, &full_name )) return -1; SetLastError( ERROR_INVALID_PARAMETER );
return -1;
}
if (!*name || !DOSFS_GetFullName( name, TRUE, &full_name ))
{
SetLastError( ERROR_BAD_PATHNAME );
return -1;
}
if (!FILE_Stat( full_name.long_name, &info )) return -1; if (!FILE_Stat( full_name.long_name, &info )) return -1;
return info.dwFileAttributes; return info.dwFileAttributes;
} }