Fix a regression of pluginsAdmin

Fix a regression of pluginsAdmin reported in:
https://community.notepad-plus-plus.org/topic/21853/notepad-8-1-5-rc2/3?_=1632245574765
This commit is contained in:
Don Ho 2021-09-21 19:31:51 +02:00
parent 635f1d41ab
commit a7a700145d
1 changed files with 3 additions and 6 deletions

View File

@ -69,17 +69,14 @@ void Version::setVersionFrom(const generic_string& filePath)
{
if (!filePath.empty() && ::PathFileExists(filePath.c_str()))
{
DWORD handle = 0;
DWORD bufferSize = ::GetFileVersionInfoSize(filePath.c_str(), &handle);
if (handle == 0)
return;
DWORD uselessArg = 0; // this variable is for passing the ignored argument to the functions
DWORD bufferSize = ::GetFileVersionInfoSize(filePath.c_str(), &uselessArg);
if (bufferSize <= 0)
return;
unsigned char* buffer = new unsigned char[bufferSize];
::GetFileVersionInfo(filePath.c_str(), handle, bufferSize, buffer);
::GetFileVersionInfo(filePath.c_str(), uselessArg, bufferSize, buffer);
VS_FIXEDFILEINFO* lpFileInfo = nullptr;
UINT cbFileInfo = 0;