| 1 |
From aaae4d700b339491d9c90d12f38ac26186980305 Mon Sep 17 00:00:00 2001 |
| 2 |
From: tobtoht <[email protected]> |
| 3 |
Date: Tue, 15 Nov 2022 15:48:09 +0100 |
| 4 |
Subject: [PATCH] Windows: don't use GetFileVersionInfoSize, |
| 5 |
GetFileVersionInfo, VerQueryValue |
| 6 |
|
| 7 |
--- |
| 8 |
src/corelib/kernel/qcoreapplication_win.cpp | 24 --------------------- |
| 9 |
1 file changed, 24 deletions(-) |
| 10 |
|
| 11 |
diff --git a/qtbase/src/corelib/kernel/qcoreapplication_win.cpp b/qtbase/src/corelib/kernel/qcoreapplication_win.cpp |
| 12 |
index 0fe14af798..e46384a6a5 100644 |
| 13 |
--- a/qtbase/src/corelib/kernel/qcoreapplication_win.cpp |
| 14 |
+++ b/qtbase/src/corelib/kernel/qcoreapplication_win.cpp |
| 15 |
@@ -60,30 +60,6 @@ QString QCoreApplicationPrivate::appName() const |
| 16 |
QString QCoreApplicationPrivate::appVersion() const |
| 17 |
{ |
| 18 |
QString applicationVersion; |
| 19 |
-#ifndef QT_BOOTSTRAPPED |
| 20 |
- const QString appFileName = qAppFileName(); |
| 21 |
- QVarLengthArray<wchar_t> buffer(appFileName.size() + 1); |
| 22 |
- buffer[appFileName.toWCharArray(buffer.data())] = 0; |
| 23 |
- |
| 24 |
- DWORD versionInfoSize = GetFileVersionInfoSize(buffer.data(), nullptr); |
| 25 |
- if (versionInfoSize) { |
| 26 |
- QVarLengthArray<BYTE> info(static_cast<int>(versionInfoSize)); |
| 27 |
- if (GetFileVersionInfo(buffer.data(), 0, versionInfoSize, info.data())) { |
| 28 |
- UINT size; |
| 29 |
- DWORD *fi; |
| 30 |
- |
| 31 |
- if (VerQueryValue(info.data(), __TEXT("\\"), |
| 32 |
- reinterpret_cast<void **>(&fi), &size) && size) { |
| 33 |
- const VS_FIXEDFILEINFO *verInfo = reinterpret_cast<const VS_FIXEDFILEINFO *>(fi); |
| 34 |
- applicationVersion = QStringLiteral("%1.%2.%3.%4") |
| 35 |
- .arg(HIWORD(verInfo->dwProductVersionMS)) |
| 36 |
- .arg(LOWORD(verInfo->dwProductVersionMS)) |
| 37 |
- .arg(HIWORD(verInfo->dwProductVersionLS)) |
| 38 |
- .arg(LOWORD(verInfo->dwProductVersionLS)); |
| 39 |
- } |
| 40 |
- } |
| 41 |
- } |
| 42 |
-#endif |
| 43 |
return applicationVersion; |
| 44 |
} |
| 45 |
|
| 46 |
-- |
| 47 |
2.38.1 |
| 48 |
|