in reply to Partial troubleshooting of Win32::Process::Memory and request for fixes

Hello Lotus1

I wrote that concern recently. Please note though that I don't know how well these module are maintained exactly. The only thing that I said in my post that some things that I have tried didn't work, so I just expressed my concerns.

Now back to why this may not work...

I think that the problem is in the NT.pm module:

if ($EnumProcessModules->Call ($prchdl, $modhdl, length $modhdl, $ +modgot)) { $modhdl = unpack ('L', $modhdl); my $mfn = ' ' x MAX_PATH; if ($GetModuleFileNameEx->Call ($prchdl, $modhdl, $mfn, length $mf +n)) { $mfn =~ s/\0.*//; $mfn =~ s/^\\(\w+)/$ENV{$1} ? $ENV{$1} : "\\$1"/ex; $mfn =~ s/^\\\?\?\\//; $self->_build_hash ($dat, ExecutablePath => $mfn); my $base = basename ($mfn); $self->_build_hash ($dat, Name => $base) if $base; } }

I think EnumProcessModules is not returning anything in $modhdl. One thing that I don't exactly understand about this code that EnumProcessModules returns an array (according to Microsoft docs). And then there is an unpack statement and passed on to GetModuleFileNameEx which takes a module handle as second argument.

Other things that can be said about EnumProcessModules is that there is also an EnumProcessModulesEx which can be used to get 32-bit processes and 64-bit processes, so there may be the problem as well, that EnumProcessModules is not working on 64-bit

See also this discussion here

So to fix these kind of problems I think that someone may need to have a look at things.