mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 10:45:37 +08:00
Fix -fpermissive error with MinGW
Changed const vector output buffer parameter to non-const raw pointer. Writing to const vector is not possible, and vector was not necessary refs #918
This commit is contained in:
committed by
Mathew Sutcliffe
parent
a92a9f13f4
commit
621f6f6ca7
@@ -41,16 +41,16 @@ namespace BlackMisc
|
|||||||
return iso;
|
return iso;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString queryToQString(const std::vector<BYTE> &pbVersionInfo, const std::vector<TCHAR> &subBlockNameBuffer)
|
QString queryToQString(BYTE *pbVersionInfo, const std::vector<TCHAR> &subBlockNameBuffer)
|
||||||
{
|
{
|
||||||
UINT dwBytes = 0;
|
UINT dwBytes = 0;
|
||||||
LPVOID lpBuffer = nullptr;
|
LPVOID lpBuffer = nullptr;
|
||||||
VerQueryValueW(pbVersionInfo.data(), subBlockNameBuffer.data(), &lpBuffer, &dwBytes);
|
VerQueryValueW(pbVersionInfo, subBlockNameBuffer.data(), &lpBuffer, &dwBytes);
|
||||||
const QString queryString = QString::fromWCharArray((const wchar_t *) lpBuffer, dwBytes);
|
const QString queryString = QString::fromWCharArray((const wchar_t *) lpBuffer, dwBytes);
|
||||||
return queryString;
|
return queryString;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString queryToQString(const std::vector<BYTE> &pbVersionInfo, const LanguageCodePage &codePage, _In_ LPCTSTR subBlockpSzFormat, std::vector<TCHAR> &subBlockNameBuffer)
|
QString queryToQString(BYTE *pbVersionInfo, const LanguageCodePage &codePage, _In_ LPCTSTR subBlockpSzFormat, std::vector<TCHAR> &subBlockNameBuffer)
|
||||||
{
|
{
|
||||||
HRESULT hr = StringCchPrintf(subBlockNameBuffer.data(), subBlockNameBuffer.size() - 1, subBlockpSzFormat, codePage.wLanguage, codePage.wCodePage);
|
HRESULT hr = StringCchPrintf(subBlockNameBuffer.data(), subBlockNameBuffer.size() - 1, subBlockpSzFormat, codePage.wLanguage, codePage.wCodePage);
|
||||||
if (FAILED(hr)) { return QString(); }
|
if (FAILED(hr)) { return QString(); }
|
||||||
@@ -129,10 +129,10 @@ namespace BlackMisc
|
|||||||
// Retrieve file description for language and code page "i".
|
// Retrieve file description for language and code page "i".
|
||||||
const PrivateWindows::LanguageCodePage cp = lpTranslate[i];
|
const PrivateWindows::LanguageCodePage cp = lpTranslate[i];
|
||||||
result.iso = PrivateWindows::languageToIsoCode(cp);
|
result.iso = PrivateWindows::languageToIsoCode(cp);
|
||||||
result.fileDescription = PrivateWindows::queryToQString(pbVersionInfo, cp, TEXT("\\StringFileInfo\\%04x%04x\\FileDescription"), subBlockNameBuffer);
|
result.fileDescription = PrivateWindows::queryToQString(pbVersionInfo.data(), cp, TEXT("\\StringFileInfo\\%04x%04x\\FileDescription"), subBlockNameBuffer);
|
||||||
result.productName = PrivateWindows::queryToQString(pbVersionInfo, cp, TEXT("\\StringFileInfo\\%04x%04x\\ProductName"), subBlockNameBuffer);
|
result.productName = PrivateWindows::queryToQString(pbVersionInfo.data(), cp, TEXT("\\StringFileInfo\\%04x%04x\\ProductName"), subBlockNameBuffer);
|
||||||
result.productVersionName = PrivateWindows::queryToQString(pbVersionInfo, cp, TEXT("\\StringFileInfo\\%04x%04x\\ProductVersion"), subBlockNameBuffer);
|
result.productVersionName = PrivateWindows::queryToQString(pbVersionInfo.data(), cp, TEXT("\\StringFileInfo\\%04x%04x\\ProductVersion"), subBlockNameBuffer);
|
||||||
result.originalFilename = PrivateWindows::queryToQString(pbVersionInfo, cp, TEXT("\\StringFileInfo\\%04x%04x\\OriginalFilename"), subBlockNameBuffer);
|
result.originalFilename = PrivateWindows::queryToQString(pbVersionInfo.data(), cp, TEXT("\\StringFileInfo\\%04x%04x\\OriginalFilename"), subBlockNameBuffer);
|
||||||
result.fullFilename = dllQFile.fileName();
|
result.fullFilename = dllQFile.fileName();
|
||||||
|
|
||||||
//! \fixme currently stopping at first language, maybe need to change that in future
|
//! \fixme currently stopping at first language, maybe need to change that in future
|
||||||
|
|||||||
Reference in New Issue
Block a user