mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Initialize value type and cast to void pointer before passing to VerQueryValue
refs #918
This commit is contained in:
committed by
Mathew Sutcliffe
parent
621f6f6ca7
commit
959c290108
@@ -44,9 +44,9 @@ namespace BlackMisc
|
||||
QString queryToQString(BYTE *pbVersionInfo, const std::vector<TCHAR> &subBlockNameBuffer)
|
||||
{
|
||||
UINT dwBytes = 0;
|
||||
LPVOID lpBuffer = nullptr;
|
||||
VerQueryValueW(pbVersionInfo, subBlockNameBuffer.data(), &lpBuffer, &dwBytes);
|
||||
const QString queryString = QString::fromWCharArray((const wchar_t *) lpBuffer, dwBytes);
|
||||
wchar_t *szQueryString = nullptr;
|
||||
VerQueryValue(pbVersionInfo, subBlockNameBuffer.data(), reinterpret_cast<LPVOID *>(&szQueryString), &dwBytes);
|
||||
const QString queryString = QString::fromWCharArray(szQueryString, dwBytes);
|
||||
return queryString;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user