diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-21 19:29:50 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-21 19:29:50 +0000 |
commit | e461ff6e109039b7c8993877a68b2a0ecf3ff413 (patch) | |
tree | 2e43c5f60beb1272be0f92400ea3b1f41b5cd0a9 /plugins/CrashDumper/src | |
parent | c2df6e7bbf6efdb36f751379c154623191864a1f (diff) |
fix for displaying version
git-svn-id: http://svn.miranda-ng.org/main/trunk@1095 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CrashDumper/src')
-rw-r--r-- | plugins/CrashDumper/src/dumper.cpp | 22 | ||||
-rw-r--r-- | plugins/CrashDumper/src/version.h | 6 |
2 files changed, 23 insertions, 5 deletions
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index bae091a023..df69f881a1 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -22,6 +22,7 @@ extern TCHAR* vertxt; extern TCHAR* profname;
extern TCHAR* profpath;
+#pragma comment(lib, "version.lib")
void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr)
{
@@ -241,10 +242,27 @@ static void GetPluginsString(bkstring& buffer, unsigned& flags) const TCHAR *unica = (ep && ((PLUGININFOEX*)pi)->flags & 1) ? TEXT("|Unicode aware|") : TEXT("");
ListItem* lst = new ListItem;
- DWORD ver = pi->version;
+ int v1, v2, v3, v4;
+
+ DWORD unused, verInfoSize = GetFileVersionInfoSize(path, &unused);
+ if (verInfoSize != 0) {
+ UINT blockSize;
+ VS_FIXEDFILEINFO* fi;
+ void* pVerInfo = mir_alloc(verInfoSize);
+ GetFileVersionInfo(path, 0, verInfoSize, pVerInfo);
+ VerQueryValue(pVerInfo, _T("\\"), (LPVOID*)&fi, &blockSize);
+ v1 = HIWORD(fi->dwProductVersionMS), v2 = LOWORD(fi->dwProductVersionMS),
+ v3 = HIWORD(fi->dwProductVersionLS), v4 = LOWORD(fi->dwProductVersionLS);
+ mir_free(pVerInfo);
+ }
+ else {
+ DWORD ver = pi->version;
+ v1 = HIBYTE(HIWORD(ver)), v2 = LOBYTE(HIWORD(ver)), v3 = HIBYTE(LOWORD(ver)), v4 = LOBYTE(LOWORD(ver));
+ }
+
lst->str.appendfmt(format, ep ? TEXT('\xa4') : TEXT(' '), FindFileData.cFileName,
(flags & VI_FLAG_FORMAT) ? TEXT("[b]") : TEXT(""),
- HIBYTE(HIWORD(ver)), LOBYTE(HIWORD(ver)), HIBYTE(LOWORD(ver)), LOBYTE(LOWORD(ver)),
+ v1, v2, v3, v4,
(flags & VI_FLAG_FORMAT) ? TEXT("[/b]") : TEXT(""),
timebuf, pi->shortName ? pi->shortName : "", unica);
diff --git a/plugins/CrashDumper/src/version.h b/plugins/CrashDumper/src/version.h index 776e30e404..288dccf0fa 100644 --- a/plugins/CrashDumper/src/version.h +++ b/plugins/CrashDumper/src/version.h @@ -1,3 +1,3 @@ -#define __FILEVERSION_STRING 0,0,4,21
-#define __VERSION_STRING "0.0.4.21"
-#define __VERSION_DWORD PLUGIN_MAKE_VERSION(0, 0, 4, 21)
+#define __FILEVERSION_STRING 0,0,4,22
+#define __VERSION_STRING "0.0.4.22"
+#define __VERSION_DWORD PLUGIN_MAKE_VERSION(0, 0, 4, 22)
|