From 0cfa278b022a5b02935ec721d5f9e5359002b991 Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Wed, 14 Feb 2001 00:26:46 +0000 Subject: [PATCH] SetLastError() for GetFileAttributesA. --- files/file.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/files/file.c b/files/file.c index 734e7f4c6c3..9d7c10c1190 100644 --- a/files/file.c +++ b/files/file.c @@ -584,9 +584,16 @@ DWORD WINAPI GetFileAttributesA( LPCSTR name ) DOS_FULL_NAME full_name; BY_HANDLE_FILE_INFORMATION info; - if (name == NULL || *name=='\0') return -1; - - if (!DOSFS_GetFullName( name, TRUE, &full_name )) return -1; + if (name == NULL) + { + 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; return info.dwFileAttributes; }