Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable psapi in UWP (unsupported) (backport #2990) #2993

Merged
merged 1 commit into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,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 @@ -122,7 +125,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 @@ -132,6 +136,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
Loading