Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
haukeduden committed May 31, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 5e86f5f commit 2011d69
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ set_target_properties(countly PROPERTIES
CXX_EXTENSIONS NO)

find_package(Threads)
target_link_libraries(countly Threads::Threads)
target_link_libraries(countly Threads::Threads version)

target_include_directories(countly PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/vendor/json/include)

14 changes: 5 additions & 9 deletions src/countly_c.cpp
Original file line number Diff line number Diff line change
@@ -113,20 +113,18 @@ extern "C" int countly_c_init(
// One can look at the DLL version of the kernel32.dll. So we do that
// to get an accurate version number.
DWORD dummy=0;
DWORD size = ::GetFileVersionInfoSize(L"kernel32.dll", &dummy);
DWORD size = ::GetFileVersionInfoSize("kernel32.dll", &dummy);
if(size>0)
{
LPVOID vData = malloc(size+100);
if (vData == nullptr)
return;
std::unique_ptr<uint8_t> data( new uint8_t[size+100]);

if(::GetFileVersionInfo(L"kernel32.dll", 0, size+100, vData))
if(::GetFileVersionInfo("kernel32.dll", 0, size+100, data.get()))
{
VS_FIXEDFILEINFO* pFileInfo=NULL;
UINT sizeFileInfo=0;

if(::VerQueryValue( vData,
L"\\",
if(::VerQueryValue( data.get(),
"\\",
(LPVOID*)&pFileInfo,
&sizeFileInfo))
{
@@ -159,8 +157,6 @@ extern "C" int countly_c_init(
}
}
}

free(vData);
}
}

0 comments on commit 2011d69

Please sign in to comment.