From aadd076269cc3e09896bb1da554bd1a358a276c5 Mon Sep 17 00:00:00 2001 From: Tannin Date: Tue, 28 May 2013 23:14:49 +0200 Subject: - added hook for ansi version of SHFileOperation, this function may not be routed to the unicode version in every windows variant --- src/shared/util.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/shared/util.cpp') diff --git a/src/shared/util.cpp b/src/shared/util.cpp index e61ae8a6..1c4bf5b6 100644 --- a/src/shared/util.cpp +++ b/src/shared/util.cpp @@ -28,6 +28,19 @@ along with Mod Organizer. If not, see . namespace MOShared { +bool FileExists(const std::string &filename) +{ + WIN32_FIND_DATAA findData; + ZeroMemory(&findData, sizeof(WIN32_FIND_DATAA)); + HANDLE search = ::FindFirstFileExA(filename.c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, NULL, 0); + if (search == INVALID_HANDLE_VALUE) { + return false; + } else { + FindClose(search); + return true; + } +} + bool FileExists(const std::wstring &filename) { WIN32_FIND_DATAW findData; -- cgit v1.3.1