From 65020b353928d368afd6afded6c973f4d8e36cf6 Mon Sep 17 00:00:00 2001 From: James Juran Date: Tue, 23 May 2000 01:13:50 +0000 Subject: [PATCH] SearchPathA needs to set the last error to ERROR_FILE_NOT_FOUND when it does not find the file. --- files/directory.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/files/directory.c b/files/directory.c index f20adcf7cf4..4280f204460 100644 --- a/files/directory.c +++ b/files/directory.c @@ -649,7 +649,8 @@ done: * Failure: Zero * * NOTES - * Should call SetLastError(but currently doesn't). + * If the file is not found, calls SetLastError(ERROR_FILE_NOT_FOUND) + * (tested on NT 4.0) */ DWORD WINAPI SearchPathA( LPCSTR path, LPCSTR name, LPCSTR ext, DWORD buflen, LPSTR buffer, LPSTR *lastpart ) @@ -657,7 +658,11 @@ DWORD WINAPI SearchPathA( LPCSTR path, LPCSTR name, LPCSTR ext, DWORD buflen, LPSTR p, res; DOS_FULL_NAME full_name; - if (!DIR_SearchPath( path, name, ext, &full_name, TRUE )) return 0; + if (!DIR_SearchPath( path, name, ext, &full_name, TRUE )) + { + SetLastError(ERROR_FILE_NOT_FOUND); + return 0; + } lstrcpynA( buffer, full_name.short_name, buflen ); res = full_name.long_name + strlen(DRIVE_GetRoot( full_name.short_name[0] - 'A' )); -- 2.11.4.GIT