diff --git a/.gitmodules b/.gitmodules index 9348686c..43b13bea 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,4 +9,4 @@ url = https://github.com/fmtlib/fmt.git [submodule "spdlog"] path = spdlog - url = https://github.com/TanninOne/spdlog.git + url = https://github.com/gabime/spdlog.git diff --git a/appveyor.yml b/appveyor.yml index 1a531dc9..09d4638d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,12 +1,12 @@ version: 1.0.{build} -image: Visual Studio 2017 +image: Visual Studio 2019 Preview configuration: Release platform: - x64 - x86 environment: GTEST_PATH: C:\Libraries\googletest - BOOST_PATH: C:\Libraries\boost_1_69_0 + BOOST_PATH: C:\Libraries\boost_1_70_0 WEBHOOK_URL: secure: gOKbXaZM9ImtMD5XrYITvdyZUW/az082G9OIN1EC1VZ2CuYaUUM6WY2eiNxaFeOL7/9Jyu/m+Vm1fH54CEyigcUUaxA7d8F5IMWlOgE/7YYdaAFSMUTFD7EK+++3FBYfmU1F/nZ61wsiWE6hB9Au5FpGBSCeQ0Tf8U8m0ybPmD0= before_build: diff --git a/include/usvfs_version.h b/include/usvfs_version.h index 882cf53d..f562aa74 100644 --- a/include/usvfs_version.h +++ b/include/usvfs_version.h @@ -2,7 +2,7 @@ #define USVFS_VERSION_MAJOR 0 #define USVFS_VERSION_MINOR 4 -#define USVFS_VERSION_BUILD 3 +#define USVFS_VERSION_BUILD 4 #define USVFS_VERSION_REVISION 0 #define USVFS_BUILD_STRING "" diff --git a/spdlog b/spdlog index e6cefe81..560df287 160000 --- a/spdlog +++ b/spdlog @@ -1 +1 @@ -Subproject commit e6cefe81c1e736864f5e08893ca6eb07d352d368 +Subproject commit 560df2878ad308b27873b3cc5e810635d69cfad6 diff --git a/src/shared/directory_tree.h b/src/shared/directory_tree.h index 0e57037c..94d5a7c6 100644 --- a/src/shared/directory_tree.h +++ b/src/shared/directory_tree.h @@ -449,7 +449,14 @@ class DirectoryTree if (auto par = parent()) { spdlog::get("usvfs")->info("remove from tree {}", m_Name.c_str()); auto self = par->m_Nodes.find(m_Name.c_str()); - par->erase(self); + if (self != par->m_Nodes.end()) { + par->erase(self); + } + else { + //trying to remove a node that des not exist, most likely because it was already removed in a lower level call. + //this is known to happen when MoveFile has the MOVEFILE_COPY_ALLOWED flag and moving a mapped file. + spdlog::get("usvfs")->warn("Failed to remove inexisting node from tree: {}", m_Name.c_str()); + } } } diff --git a/src/shared/shmlogger.cpp b/src/shared/shmlogger.cpp index ae90af6c..a13b7a80 100644 --- a/src/shared/shmlogger.cpp +++ b/src/shared/shmlogger.cpp @@ -176,15 +176,13 @@ void spdlog::sinks::shm_sink::output(level::level_enum lev, switch (lev) { case level::trace: case level::debug: - case level::notice: { + case level::info: { // m_LogQueue.send(message.c_str(), count, 0); sent = m_LogQueue.try_send(message.c_str(), static_cast(count), 0); } break; - case level::alert: - case level::critical: - case level::emerg: - case level::err: { + case level::err: + case level::critical: { m_LogQueue.send(message.c_str(), static_cast(count), 0); } break; default: { diff --git a/src/shared/shmlogger.h b/src/shared/shmlogger.h index 7e376342..473f431e 100644 --- a/src/shared/shmlogger.h +++ b/src/shared/shmlogger.h @@ -27,6 +27,7 @@ along with usvfs. If not, see . #include #include #include +#include #include typedef boost::interprocess::message_queue_t message_queue_interop; diff --git a/src/usvfs_dll/hooks/kernel32.cpp b/src/usvfs_dll/hooks/kernel32.cpp index 66112308..1c00edca 100644 --- a/src/usvfs_dll/hooks/kernel32.cpp +++ b/src/usvfs_dll/hooks/kernel32.cpp @@ -139,6 +139,7 @@ HMODULE WINAPI usvfs::hook_LoadLibraryExW(LPCWSTR lpFileName, HANDLE hFile, HMODULE res = nullptr; HOOK_START_GROUP(MutExHookGroup::LOAD_LIBRARY) + // Why is the usual if (!callContext.active()... check missing? RerouteW reroute = RerouteW::create(READ_CONTEXT(), callContext, lpFileName); PRE_REALCALL @@ -488,6 +489,7 @@ DWORD WINAPI usvfs::hook_SetFileAttributesW( DWORD res = 0UL; HOOK_START_GROUP(MutExHookGroup::FILE_ATTRIBUTES) + // Why is the usual if (!callContext.active()... check missing? RerouteW reroute = RerouteW::create(READ_CONTEXT(), callContext, lpFileName); PRE_REALCALL @@ -508,6 +510,7 @@ BOOL WINAPI usvfs::hook_DeleteFileW(LPCWSTR lpFileName) BOOL res = FALSE; HOOK_START_GROUP(MutExHookGroup::DELETE_FILE) + // Why is the usual if (!callContext.active()... check missing? RerouteW reroute = RerouteW::create(READ_CONTEXT(), callContext, lpFileName); @@ -800,6 +803,9 @@ BOOL WINAPI usvfs::hook_MoveFileWithProgressA(LPCSTR lpExistingFileName, LPCSTR BOOL WINAPI usvfs::hook_MoveFileWithProgressW(LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, LPPROGRESS_ROUTINE lpProgressRoutine, LPVOID lpData, DWORD dwFlags) { + + //TODO: Remove all redundant hooks to moveFile alternatives. + //it would appear that all other moveFile functions end up calling this one with no additional code. BOOL res = FALSE; HOOK_START_GROUP(MutExHookGroup::SHELL_FILEOP) @@ -861,7 +867,9 @@ BOOL WINAPI usvfs::hook_MoveFileWithProgressW(LPCWSTR lpExistingFileName, LPCWST writeReroute.updateResult(callContext, res); if (res) { - readReroute.removeMapping(READ_CONTEXT(), isDirectory); // Updating the rerouteCreate to check deleted file entries should make this okay + //TODO: this call causes the node to be removed twice in case of MOVEFILE_COPY_ALLOWED as the deleteFile hook lower level already takes care of it, + //but deleteFile can't be disabled since we are relying on it in case of MOVEFILE_REPLACE_EXISTING for the destination file. + readReroute.removeMapping(READ_CONTEXT(), isDirectory); // Updating the rerouteCreate to check deleted file entries should make this okay (not related to comments above) if (writeReroute.newReroute()) { if (isDirectory) @@ -1094,6 +1102,7 @@ DLLEXPORT BOOL WINAPI usvfs::hook_RemoveDirectoryW( BOOL res = FALSE; HOOK_START_GROUP(MutExHookGroup::DELETE_FILE) + // Why is the usual if (!callContext.active()... check missing? RerouteW reroute = RerouteW::create(READ_CONTEXT(), callContext, lpPathName); diff --git a/src/usvfs_dll/hooks/ntdll.cpp b/src/usvfs_dll/hooks/ntdll.cpp index b7badb91..4e3618a5 100644 --- a/src/usvfs_dll/hooks/ntdll.cpp +++ b/src/usvfs_dll/hooks/ntdll.cpp @@ -1075,6 +1075,7 @@ NTSTATUS ntdll_mess_NtOpenFile(PHANDLE FileHandle, NTSTATUS res = STATUS_NO_SUCH_FILE; HOOK_START_GROUP(MutExHookGroup::OPEN_FILE) + // Why is the usual if (!callContext.active()... check missing? bool storePath = false; if (((OpenOptions & FILE_DIRECTORY_FILE) != 0UL) @@ -1299,6 +1300,10 @@ NTSTATUS WINAPI usvfs::hook_NtClose(HANDLE Handle) // std::lock_guard lock(activeSearches.queryMutex); auto iter = activeSearches.info.find(Handle); if (iter != activeSearches.info.end()) { + if (iter->second.currentSearchHandle != INVALID_HANDLE_VALUE) { + ::CloseHandle(iter->second.currentSearchHandle); + } + activeSearches.info.erase(iter); log = true; } @@ -1340,6 +1345,7 @@ NTSTATUS WINAPI usvfs::hook_NtQueryAttributesFile( NTSTATUS res = STATUS_SUCCESS; HOOK_START_GROUP(MutExHookGroup::FILE_ATTRIBUTES) + // Why is the usual if (!callContext.active()... check missing? UnicodeString inPath = CreateUnicodeString(ObjectAttributes); diff --git a/src/usvfs_proxy/main.cpp b/src/usvfs_proxy/main.cpp index 93e00403..c1f4a983 100644 --- a/src/usvfs_proxy/main.cpp +++ b/src/usvfs_proxy/main.cpp @@ -116,7 +116,7 @@ int main(int argc, char **argv) { exceptionDialog(__LINE__, 2, e.what(), e2.what()); // no way to log this } catch (const std::exception &) { - logger->critical() << e.what(); + logger->critical(e.what()); } return 1; } @@ -216,7 +216,7 @@ int main(int argc, char **argv) { // no way to log this exceptionDialog(__LINE__, 2, e.what(), e2.what()); } catch (const std::exception &) { - logger->critical() << e.what(); + logger->critical(e.what()); } } } diff --git a/vsbuild/asmjit.vcxproj b/vsbuild/asmjit.vcxproj index 6a169f8a..33203567 100644 --- a/vsbuild/asmjit.vcxproj +++ b/vsbuild/asmjit.vcxproj @@ -79,32 +79,32 @@ 15.0 {5338B9D6-C2A9-4DED-B7E8-31292B96CBF2} asmjit - 10.0.16299.0 + 10.0 StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode diff --git a/vsbuild/external_dependencies.props b/vsbuild/external_dependencies.props index 43ebdfb0..1ff0ab33 100644 --- a/vsbuild/external_dependencies.props +++ b/vsbuild/external_dependencies.props @@ -4,7 +4,7 @@ - ..\..\boost_1_69_0 + ..\..\boost_1_70_0 $(BOOST_PATH) ..\..\googletest diff --git a/vsbuild/fmt.vcxproj b/vsbuild/fmt.vcxproj index 24146f2d..e6b7af19 100644 --- a/vsbuild/fmt.vcxproj +++ b/vsbuild/fmt.vcxproj @@ -22,32 +22,32 @@ 15.0 {E75F344A-1373-4E3F-97EA-BC80CA42E0F0} fmt - 10.0.16299.0 + 10.0 StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode diff --git a/vsbuild/platform_x64.props b/vsbuild/platform_x64.props index 7317e5c7..25d7071f 100644 --- a/vsbuild/platform_x64.props +++ b/vsbuild/platform_x64.props @@ -15,7 +15,7 @@ _WIN64;%(PreprocessorDefinitions) - $(BOOST_PATH)\lib64-msvc-14.1\lib;%(AdditionalLibraryDirectories) + $(BOOST_PATH)\lib64-msvc-14.2\lib;%(AdditionalLibraryDirectories) diff --git a/vsbuild/platform_x86.props b/vsbuild/platform_x86.props index 7b66bb75..1aa0f351 100644 --- a/vsbuild/platform_x86.props +++ b/vsbuild/platform_x86.props @@ -12,7 +12,7 @@ - $(BOOST_PATH)\lib32-msvc-14.1\lib;%(AdditionalLibraryDirectories) + $(BOOST_PATH)\lib32-msvc-14.2\lib;%(AdditionalLibraryDirectories) diff --git a/vsbuild/shared.vcxproj b/vsbuild/shared.vcxproj index 1e85c6e3..537a95a5 100644 --- a/vsbuild/shared.vcxproj +++ b/vsbuild/shared.vcxproj @@ -22,32 +22,32 @@ 15.0 {2BB3300B-F08A-4063-95C4-8A0FADAE6C51} shared - 10.0.16299.0 + 10.0 StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode diff --git a/vsbuild/shared_test.vcxproj b/vsbuild/shared_test.vcxproj index 7b2cf4d0..77fe9e42 100644 --- a/vsbuild/shared_test.vcxproj +++ b/vsbuild/shared_test.vcxproj @@ -22,32 +22,32 @@ 15.0 {26B28EFA-5EEB-45AC-AF8F-C20F478070F8} sharedtest - 10.0.16299.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/vsbuild/spdlog.vcxproj b/vsbuild/spdlog.vcxproj index e9fa42d8..ad45f5b0 100644 --- a/vsbuild/spdlog.vcxproj +++ b/vsbuild/spdlog.vcxproj @@ -22,32 +22,32 @@ 15.0 {CDADDEC0-B72B-43B4-831F-72BA85B72805} spdlog - 10.0.16299.0 + 10.0 Application true - v141 + v142 MultiByte Application false - v141 + v142 true MultiByte Application true - v141 + v142 MultiByte Application false - v141 + v142 true MultiByte diff --git a/vsbuild/test_file_operations.vcxproj b/vsbuild/test_file_operations.vcxproj index 6c7f2971..2dc21bf1 100644 --- a/vsbuild/test_file_operations.vcxproj +++ b/vsbuild/test_file_operations.vcxproj @@ -22,32 +22,32 @@ 15.0 {0B2FF5AF-8580-458C-8EF4-10E6B6398D3A} testfileoperations - 10.0.16299.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/vsbuild/testinject_bin.vcxproj b/vsbuild/testinject_bin.vcxproj index 855f3318..83d8f9d5 100644 --- a/vsbuild/testinject_bin.vcxproj +++ b/vsbuild/testinject_bin.vcxproj @@ -22,32 +22,32 @@ 15.0 {5705ABC8-8CF4-4A1C-AACF-22554B38E04A} testinjectbin - 10.0.16299.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/vsbuild/testinject_dll.vcxproj b/vsbuild/testinject_dll.vcxproj index 5d8616fe..7d872001 100644 --- a/vsbuild/testinject_dll.vcxproj +++ b/vsbuild/testinject_dll.vcxproj @@ -22,32 +22,32 @@ 15.0 {D536BD2F-BA2D-4C70-A2F8-EF08580F8280} testinjectdll - 10.0.16299.0 + 10.0 DynamicLibrary true - v141 + v142 Unicode DynamicLibrary false - v141 + v142 true Unicode DynamicLibrary true - v141 + v142 Unicode DynamicLibrary false - v141 + v142 true Unicode diff --git a/vsbuild/thooklib.vcxproj b/vsbuild/thooklib.vcxproj index 1dbdb82f..b95263dc 100644 --- a/vsbuild/thooklib.vcxproj +++ b/vsbuild/thooklib.vcxproj @@ -22,32 +22,32 @@ 15.0 {1CE90F86-126E-40AB-BD8B-08B25FD2E68E} thooklib - 10.0.16299.0 + 10.0 StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode diff --git a/vsbuild/thooklib_test.vcxproj b/vsbuild/thooklib_test.vcxproj index 3cbff648..af19ce6c 100644 --- a/vsbuild/thooklib_test.vcxproj +++ b/vsbuild/thooklib_test.vcxproj @@ -22,32 +22,32 @@ 15.0 {931A68BE-AF5F-48C9-AFAE-C8DC08103E33} thooklibtest - 10.0.16299.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/vsbuild/tinjectlib.vcxproj b/vsbuild/tinjectlib.vcxproj index 41ca3368..da60a0a8 100644 --- a/vsbuild/tinjectlib.vcxproj +++ b/vsbuild/tinjectlib.vcxproj @@ -22,32 +22,32 @@ 15.0 {D18D0B1C-37B4-48A8-88C0-399DE2815C05} tinjectlib - 10.0.16299.0 + 10.0 StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode diff --git a/vsbuild/tinjectlib_test.vcxproj b/vsbuild/tinjectlib_test.vcxproj index 77121770..57bf8785 100644 --- a/vsbuild/tinjectlib_test.vcxproj +++ b/vsbuild/tinjectlib_test.vcxproj @@ -22,32 +22,32 @@ 15.0 {5F393577-7E8E-43A4-B476-BFCC78147D0D} tinjectlibtest - 10.0.16299.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/vsbuild/tvfs_test.vcxproj b/vsbuild/tvfs_test.vcxproj index 65cf92d6..bee11a01 100644 --- a/vsbuild/tvfs_test.vcxproj +++ b/vsbuild/tvfs_test.vcxproj @@ -22,32 +22,32 @@ 15.0 {1DDD14EC-2274-4793-803E-B64D278AFD7A} usvfstest - 10.0.16299.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/vsbuild/udis86.vcxproj b/vsbuild/udis86.vcxproj index 1f7b72f8..5ad94eec 100644 --- a/vsbuild/udis86.vcxproj +++ b/vsbuild/udis86.vcxproj @@ -22,32 +22,32 @@ 15.0 {5B0E078A-D196-4EBB-BD6E-DCFB48B15E90} udis86 - 10.0.16299.0 + 10.0 StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode @@ -192,4 +192,4 @@ - + \ No newline at end of file diff --git a/vsbuild/usvfs_dll.vcxproj b/vsbuild/usvfs_dll.vcxproj index 1973e02e..cb76b298 100644 --- a/vsbuild/usvfs_dll.vcxproj +++ b/vsbuild/usvfs_dll.vcxproj @@ -22,32 +22,32 @@ 15.0 {562B0058-4701-4284-8B40-D87648A3F64C} usvfsdll - 10.0.16299.0 + 10.0 DynamicLibrary true - v141 + v142 Unicode DynamicLibrary false - v141 + v142 true Unicode DynamicLibrary true - v141 + v142 Unicode DynamicLibrary false - v141 + v142 true Unicode diff --git a/vsbuild/usvfs_helper.vcxproj b/vsbuild/usvfs_helper.vcxproj index e6c6fa3b..1bf2a8b6 100644 --- a/vsbuild/usvfs_helper.vcxproj +++ b/vsbuild/usvfs_helper.vcxproj @@ -22,32 +22,32 @@ 15.0 {BA5B2CAC-8B75-4C6B-83C7-FFB963E872B6} usvfshelper - 10.0.16299.0 + 10.0 StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode StaticLibrary true - v141 + v142 Unicode StaticLibrary false - v141 + v142 true Unicode diff --git a/vsbuild/usvfs_proxy.vcxproj b/vsbuild/usvfs_proxy.vcxproj index 92db5baf..a1ffb7be 100644 --- a/vsbuild/usvfs_proxy.vcxproj +++ b/vsbuild/usvfs_proxy.vcxproj @@ -22,32 +22,32 @@ 15.0 {50AC03C1-BB24-4033-90E6-ABE65BCC13DC} usvfsproxy - 10.0.16299.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/vsbuild/usvfs_test.vcxproj b/vsbuild/usvfs_test.vcxproj index cc3dbc0f..f4fe449d 100644 --- a/vsbuild/usvfs_test.vcxproj +++ b/vsbuild/usvfs_test.vcxproj @@ -22,32 +22,32 @@ 15.0 {CEAF96EC-0BAA-4C02-B91B-5C4C49B5455B} usvfstest - 10.0.16299.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/vsbuild/usvfs_test_runner.vcxproj b/vsbuild/usvfs_test_runner.vcxproj index 0ef7bbd1..b5d2818e 100644 --- a/vsbuild/usvfs_test_runner.vcxproj +++ b/vsbuild/usvfs_test_runner.vcxproj @@ -22,32 +22,32 @@ 15.0 {0452CB4D-A906-4717-94AC-7A450E479BE1} usvfstestrunner - 10.0.16299.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode