diff --git a/include/usvfs_version.h b/include/usvfs_version.h index 12e91f07..4074a31e 100644 --- a/include/usvfs_version.h +++ b/include/usvfs_version.h @@ -3,7 +3,7 @@ #define USVFS_VERSION_MAJOR 0 #define USVFS_VERSION_MINOR 4 #define USVFS_VERSION_BUILD 4 -#define USVFS_VERSION_REVISION 6 +#define USVFS_VERSION_REVISION 7 #define USVFS_BUILD_STRING "" #define USVFS_BUILD_WSTRING L"" diff --git a/src/usvfs_dll/hooks/kernel32.cpp b/src/usvfs_dll/hooks/kernel32.cpp index 05e445aa..d6de7033 100644 --- a/src/usvfs_dll/hooks/kernel32.cpp +++ b/src/usvfs_dll/hooks/kernel32.cpp @@ -1292,6 +1292,17 @@ HANDLE WINAPI usvfs::hook_FindFirstFileExW(LPCWSTR lpFileName, FINDEX_INFO_LEVEL return res; } + // FindFirstFileEx() must fail early if the path ends with a slash + if (lpFileName) { + const auto len = wcslen(lpFileName); + if (len > 0) { + if (lpFileName[len - 1] == L'\\' || lpFileName[len - 1] == L'/') { + spdlog::get("usvfs")->warn("hook_FindFirstFileExW(): path '{}' ends with slash, always fails", fs::path(lpFileName).string()); + return INVALID_HANDLE_VALUE; + } + } + } + fs::path finalPath; RerouteW reroute; fs::path originalPath; diff --git a/vsbuild/external_dependencies.props b/vsbuild/external_dependencies.props index cc7be094..d39cec3e 100644 --- a/vsbuild/external_dependencies.props +++ b/vsbuild/external_dependencies.props @@ -4,7 +4,7 @@ - ..\..\boost_1_71_0 + ..\..\boost_1_72_0 $(BOOST_PATH) ..\..\googletest