summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-27 18:53:18 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-27 18:53:18 +0300
commite3b2425ac0e38ef35d6493edc4a0a211959eb91d (patch)
tree7a80e334998b863a90459d45bc597e8d0ad7ae3b /plugins/PluginUpdater
parentf4d63038321dc6b1abe0f7fdb0e824ba66d3917f (diff)
fix for correct version info offset calculation
Diffstat (limited to 'plugins/PluginUpdater')
-rw-r--r--plugins/PluginUpdater/src/checksum.cpp9
-rw-r--r--plugins/PluginUpdater/src/stdafx.h1
2 files changed, 7 insertions, 3 deletions
diff --git a/plugins/PluginUpdater/src/checksum.cpp b/plugins/PluginUpdater/src/checksum.cpp
index 2a1fd1b5a9..73d8a30734 100644
--- a/plugins/PluginUpdater/src/checksum.cpp
+++ b/plugins/PluginUpdater/src/checksum.cpp
@@ -19,6 +19,8 @@
int debug = 0;
DWORD dwVersion = 0;
+#pragma comment(lib, "version.lib")
+
struct MFileMapping
{
PBYTE ptr;
@@ -205,8 +207,11 @@ LBL_NotPE:
// patch version
if (dwVersion) {
shift = dwVersion - pISH->VirtualAddress + pISH->PointerToRawData;
- VS_FIXEDFILEINFO *pVersion = (VS_FIXEDFILEINFO*)(map.ptr + shift);
- pVersion->dwProductVersionLS = pVersion->dwProductVersionMS = 0;
+
+ UINT blockSize;
+ VS_FIXEDFILEINFO *vsffi;
+ VerQueryValue(map.ptr + shift, L"\\", (PVOID*)&vsffi, &blockSize);
+ vsffi->dwProductVersionLS = vsffi->dwProductVersionMS = 0;
}
}
diff --git a/plugins/PluginUpdater/src/stdafx.h b/plugins/PluginUpdater/src/stdafx.h
index e90119bcd6..00be8fc56f 100644
--- a/plugins/PluginUpdater/src/stdafx.h
+++ b/plugins/PluginUpdater/src/stdafx.h
@@ -229,7 +229,6 @@ wchar_t* GetDefaultUrl();
bool DownloadFile(FILEURL *pFileURL, HNETLIBCONN &nlc);
void ShowPopup(LPCTSTR Title, LPCTSTR Text, int Number);
-void __stdcall RestartMe(void*);
void __stdcall OpenPluginOptions(void*);
void CheckUpdateOnStartup();
void InitTimer(void *type);