Skip to content

Commit

Permalink
Disable psapi in UWP (unsupported)
Browse files Browse the repository at this point in the history
  • Loading branch information
enen92 authored and kmilos committed Jun 18, 2024
1 parent 41f05b1 commit 9999608
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@
// platform specific support for getLoadedLibraries
#if defined(_WIN32) || defined(__CYGWIN__)
// clang-format off
#include <winapifamily.h>
#include <windows.h>
#include <psapi.h>
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_APP)
#include <psapi.h>
#endif
// clang-format on
#if __LP64__
#ifdef _WIN64
Expand Down Expand Up @@ -121,7 +124,8 @@ static std::vector<std::string> getLoadedLibraries() {
std::string path;

#if defined(_WIN32) || defined(__CYGWIN__)
// enumerate loaded libraries and determine path to executable
// enumerate loaded libraries and determine path to executable (unsupported on UWP)
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_APP)
HMODULE handles[200];
DWORD cbNeeded;
if (EnumProcessModules(GetCurrentProcess(), handles, static_cast<DWORD>(std::size(handles)), &cbNeeded)) {
Expand All @@ -131,6 +135,7 @@ static std::vector<std::string> getLoadedLibraries() {
pushPath(szFilename, libs, paths);
}
}
#endif
#elif defined(__APPLE__)
// man 3 dyld
uint32_t count = _dyld_image_count();
Expand Down

0 comments on commit 9999608

Please sign in to comment.