Am 04.01.2024 um 23:33 schrieb Björn Schäpers: > Am 03.01.2024 um 00:12 schrieb Björn Schäpers: >> Am 30.11.2023 um 20:53 schrieb Ian Lance Taylor: >>> On Fri, Jan 20, 2023 at 2:55 AM Björn Schäpers wrote: >>>> >>>> From: Björn Schäpers >>>> >>>> Fixes https://github.com/ianlancetaylor/libbacktrace/issues/53, except >>>> that libraries loaded after the backtrace_initialize are not handled. >>>> But as far as I can see that's the same for elf. >>> >>> Thanks, but I don't want a patch that loops using goto statements. >>> Please rewrite to avoid that.  It may be simpler to call a function. >>> >>> Also starting with a module count of 1000 seems like a lot.  Do >>> typical Windows programs load that many modules? >>> >>> Ian >>> >>> >> >> Rewritten using a function. >> >> If that is commited, could you attribute that commit to me (--author="Björn >> Schäpers ")? >> >> Thanks and kind regards, >> Björn. > > I noticed that under 64 bit libraries loaded with LoadLibrary were missing. > EnumProcessModules stated the correct number of modules, but did not fill the > the HMODULEs, but set them to 0. While trying to investigate I noticed if I do > the very same thing from main (in C++) I even got fewer module HMODULEs. > > So I went a different way. This detects all libraries correctly, in 32 and 64 > bit. The question is, if it should be a patch on top of the previous, or should > they be merged, or even only this solution and drop the EnumProcessModules variant? > > Kind regards, > Björn. This patch adds libraries which are loaded after backtrace_initialize, like plugins or similar. I don't know what style is preferred for the Win32 typedefs, should the code use PVOID or void*? And I'm not sure I wrapped every long line correctly. Kind regards, Björn.