diff options
author | George Hazan <ghazan@miranda.im> | 2022-01-09 18:36:39 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-01-09 18:36:39 +0300 |
commit | 6058db4dbc4f0f7627bac09a49a775d1953c428c (patch) | |
tree | e230141020da62549aa2d1f7c64afdd1b142d4ec /plugins/PluginUpdater/pu_stub/src/pu_stub.cpp | |
parent | bb939d4b38daf85a2707217a7f9af272e0756cc8 (diff) |
more thorough fix for #2992
Diffstat (limited to 'plugins/PluginUpdater/pu_stub/src/pu_stub.cpp')
-rw-r--r-- | plugins/PluginUpdater/pu_stub/src/pu_stub.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp b/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp index 3da0773ec8..9bdbd46177 100644 --- a/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp +++ b/plugins/PluginUpdater/pu_stub/src/pu_stub.cpp @@ -102,7 +102,7 @@ int APIENTRY wWinMain(HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR lpCmdLine, int) log(L"Received command: %d <%s> <%s>", dwAction, ptszFile1, ptszFile2); switch (dwAction) { case 1: // copy - if (!CopyFile(ptszFile1, ptszFile2, FALSE)) + if (!CopyFileW(ptszFile1, ptszFile2, FALSE)) dwError = GetLastError(); break; @@ -160,6 +160,19 @@ int APIENTRY wWinMain(HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR lpCmdLine, int) dwError = 0; break; + case 7: + { + wchar_t tmpPath[MAX_PATH+1]; + _snwprintf_s(tmpPath, _countof(tmpPath), L"%s%c", ptszFile1, 0); + + SHFILEOPSTRUCT shfo = {}; + shfo.wFunc = FO_DELETE; + shfo.pFrom = tmpPath; + shfo.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO; + dwError = SHFileOperation(&shfo); + } + break; + default: dwError = ERROR_UNKNOWN_FEATURE; } |