From 4cd07769389c64823c242813adedd198a2423d5d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sun, 9 May 1999 16:05:08 +0000 Subject: [PATCH] Use OpenFile() to test for file existence, so that the path gets searched. --- loader/module.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/loader/module.c b/loader/module.c index 3f3b6e5cd62..1e03123174d 100644 --- a/loader/module.c +++ b/loader/module.c @@ -899,6 +899,8 @@ static void get_executable_name( LPCSTR line, LPSTR name, int namelen, LPCSTR pcmd = NULL; LPCSTR from; LPSTR to, to_end, to_old; + HFILE hFile; + OFSTRUCT ofs; to = name; to_end = to + namelen - 1; @@ -946,8 +948,11 @@ static void get_executable_name( LPCSTR line, LPSTR name, int namelen, TRACE_(module)("checking if file exists '%s'\n", name); - if (GetFileAttributesA(name)!=-1) - break; /* if file exists then all done */ + if ((hFile = OpenFile( name, &ofs, OF_READ )) != HFILE_ERROR) + { + CloseHandle( hFile ); + break; /* if file exists then all done */ + } /* loop around keeping the blank as part of file name */ if (!*from)