summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/unzipfile.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2025-05-21 11:35:33 +0300
committerGeorge Hazan <george.hazan@gmail.com>2025-05-21 11:35:33 +0300
commit7c07d4e6578b0eab6de015ab7c1126e2f8fa4a13 (patch)
tree03f956f4f5b6a9df8d1f9dfd706ea0ff0854491e /plugins/PluginUpdater/src/unzipfile.cpp
parente5ab71aebf01a16885b4f1500fe0d15a66cad682 (diff)
more logs for Plugin Updater
Diffstat (limited to 'plugins/PluginUpdater/src/unzipfile.cpp')
-rw-r--r--plugins/PluginUpdater/src/unzipfile.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/PluginUpdater/src/unzipfile.cpp b/plugins/PluginUpdater/src/unzipfile.cpp
index 56457b07ee..2252f2ae9b 100644
--- a/plugins/PluginUpdater/src/unzipfile.cpp
+++ b/plugins/PluginUpdater/src/unzipfile.cpp
@@ -70,8 +70,10 @@ int extractCurrentFile(unzFile uf, wchar_t *pwszDestPath, wchar_t *pwszBackPath,
mir_ptr<char> buf((char *)mir_alloc(DATA_BUF_SIZE+1));
int err = unzGetCurrentFileInfo64(uf, &file_info, filename, sizeof(filename), buf, DATA_BUF_SIZE, nullptr, 0);
- if (err != UNZ_OK)
+ if (err != UNZ_OK) {
+ Netlib_LogfW(g_hNetlibUser, L"Error retrieving file info %S: %d", filename, err);
return err;
+ }
for (char *p = strchr(filename, '/'); p; p = strchr(p + 1, '/'))
*p = '\\';
@@ -111,9 +113,12 @@ int extractCurrentFile(unzFile uf, wchar_t *pwszDestPath, wchar_t *pwszBackPath,
pwszFile2unzip = wszBackFile;
}
- HANDLE hFile = CreateFile(pwszFile2unzip, GENERIC_WRITE, FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS, file_info.external_fa, nullptr);
- if (hFile == INVALID_HANDLE_VALUE)
- return GetLastError();
+ HANDLE hFile = CreateFileW(pwszFile2unzip, GENERIC_WRITE, FILE_SHARE_WRITE, nullptr, CREATE_ALWAYS, file_info.external_fa, nullptr);
+ if (hFile == INVALID_HANDLE_VALUE) {
+ err = GetLastError();
+ Netlib_LogfW(g_hNetlibUser, L"Error creating file %s: %d", pwszFile2unzip, err);
+ return err;
+ }
while (true) {
err = unzReadCurrentFile(uf, buf, DATA_BUF_SIZE);
@@ -123,6 +128,7 @@ int extractCurrentFile(unzFile uf, wchar_t *pwszDestPath, wchar_t *pwszBackPath,
DWORD bytes;
if (!WriteFile(hFile, buf, err, &bytes, FALSE)) {
err = GetLastError();
+ Netlib_LogfW(g_hNetlibUser, L"Error writing file %s: %d", pwszFile2unzip, err);
break;
}
}