From 6794a04616653a94b706a2d529178f6a26be7832 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Fri, 10 Nov 2023 17:46:24 +0100 Subject: [PATCH] Fix a critical forgotten error --- PowerEditor/src/MISC/Common/FileInterface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PowerEditor/src/MISC/Common/FileInterface.cpp b/PowerEditor/src/MISC/Common/FileInterface.cpp index fc480bebb8be..add8ed5b2164 100644 --- a/PowerEditor/src/MISC/Common/FileInterface.cpp +++ b/PowerEditor/src/MISC/Common/FileInterface.cpp @@ -46,6 +46,8 @@ Win32_IO_File::Win32_IO_File(const wchar_t *fname) FindClose(hFind); } + _hFile = ::CreateFileW(fname, _accessParam, _shareParam, NULL, dispParam, _attribParam, NULL); + // Race condition management: // If file didn't exist while calling PathFileExistsW, but before calling CreateFileW, file is created: use CREATE_ALWAYS is OK // If file did exist while calling PathFileExistsW, but before calling CreateFileW, file is deleted: use TRUNCATE_EXISTING will cause the error