From c6348961c1ddb46da3557e762c707eaa25fbb28b Mon Sep 17 00:00:00 2001 From: KirillAlekseenko Date: Fri, 9 May 2025 22:04:06 +0400 Subject: [PATCH] Fixed filename comparison on Mogwai's side According to https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-file_notify_information, FileNameLength is the size in bytes, and since we have wide string, actual amount of symbols will be FileNameLength / sizeof(wchar_t) --- Source/Falcor/Core/Platform/Windows/Windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Falcor/Core/Platform/Windows/Windows.cpp b/Source/Falcor/Core/Platform/Windows/Windows.cpp index 0c35e901b..ec588f957 100644 --- a/Source/Falcor/Core/Platform/Windows/Windows.cpp +++ b/Source/Falcor/Core/Platform/Windows/Windows.cpp @@ -796,7 +796,7 @@ static void checkFileModifiedStatus(const std::filesystem::path& path, const std while (offset < buffer.size()) { _FILE_NOTIFY_INFORMATION* pNotifyInformation = reinterpret_cast<_FILE_NOTIFY_INFORMATION*>(buffer.data()); - std::wstring currentFilename(pNotifyInformation->FileName, pNotifyInformation->FileName + pNotifyInformation->FileNameLength); + std::wstring currentFilename(pNotifyInformation->FileName, pNotifyInformation->FileName + pNotifyInformation->FileNameLength / sizeof(wchar_t)); if (currentFilename == filename && pNotifyInformation->Action == FILE_ACTION_MODIFIED) {