https://git.reactos.org/?p=reactos.git;a=commitdiff;h=504bf68e2a031b93fa612…
commit 504bf68e2a031b93fa612dcc56d036cc9430193e
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sat Feb 18 21:40:11 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Feb 18 21:40:11 2023 +0900
[NOTEPAD] Simplify FileExists function (#5079)
Simplify FileExists helper function by using GetFileAttributes function. CORE-18837
---
base/applications/notepad/dialog.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/base/applications/notepad/dialog.c b/base/applications/notepad/dialog.c
index bc692321417..0b76b4711fd 100644
--- a/base/applications/notepad/dialog.c
+++ b/base/applications/notepad/dialog.c
@@ -228,13 +228,7 @@ static void AlertPrintError(void)
*/
BOOL FileExists(LPCTSTR szFilename)
{
- WIN32_FIND_DATA entry;
- HANDLE hFile;
-
- hFile = FindFirstFile(szFilename, &entry);
- FindClose(hFile);
-
- return (hFile != INVALID_HANDLE_VALUE);
+ return GetFileAttributes(szFilename) != INVALID_FILE_ATTRIBUTES;
}
BOOL HasFileExtension(LPCTSTR szFilename)