Disable psapi in UWP (unsupported)

main
enen92 1 year ago committed by Miloš Komarčević
parent 41f05b1db1
commit 9999608d34

@ -33,8 +33,11 @@
// platform specific support for getLoadedLibraries // platform specific support for getLoadedLibraries
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32) || defined(__CYGWIN__)
// clang-format off // clang-format off
#include <winapifamily.h>
#include <windows.h> #include <windows.h>
#include <psapi.h> #if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_APP)
#include <psapi.h>
#endif
// clang-format on // clang-format on
#if __LP64__ #if __LP64__
#ifdef _WIN64 #ifdef _WIN64
@ -121,7 +124,8 @@ static std::vector<std::string> getLoadedLibraries() {
std::string path; std::string path;
#if defined(_WIN32) || defined(__CYGWIN__) #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]; HMODULE handles[200];
DWORD cbNeeded; DWORD cbNeeded;
if (EnumProcessModules(GetCurrentProcess(), handles, static_cast<DWORD>(std::size(handles)), &cbNeeded)) { if (EnumProcessModules(GetCurrentProcess(), handles, static_cast<DWORD>(std::size(handles)), &cbNeeded)) {
@ -131,6 +135,7 @@ static std::vector<std::string> getLoadedLibraries() {
pushPath(szFilename, libs, paths); pushPath(szFilename, libs, paths);
} }
} }
#endif
#elif defined(__APPLE__) #elif defined(__APPLE__)
// man 3 dyld // man 3 dyld
uint32_t count = _dyld_image_count(); uint32_t count = _dyld_image_count();

Loading…
Cancel
Save