$Bill Luebkert wrote:


use constant TH32CS_SNAPTHREAD => 0x4;
thanks, I had missed defining the constant (I thought Win32::API did all that automatically, silly me).
my $hProcessSnap = CreateToolhelp32Snapshot (TH32CS_SNAPTHREAD, 0);
die "CreateToolhelp32Snapshot: $!($^E)" if $hProcessSnap == -1;
print Data::Dumper->Dump([$hProcessSnap], [qw($hProcessSnap)]);

My results:

$hProcessSnap = 1980;
$PE32 = '(☺                                   ';
[EMAIL PROTECTED] = [
  296,
  62,
  0,
  669,
  0,
  0,
  0,
  48,
  0,
  ''
];
That looks like what I get now from Process32First/Next. According to the PROCESSENTRY32 structure, the 3rd value should be a ProcessID, and the 7th should be ParentProcessID : in your example, 0 and 0, which doesn't look good. Examples of values I got :-
296 0 0 28 0 620 752 8 0         ProcessID=0, Parent=752
296 8 0 0 28 0 1504 1480 8     ProcessID=0, Parent=1504
296 0 28 0 864 872 6 0 0         ProcessID=28,Parent=6
296 28 0 304 680 8 0 0 28       ProcessID=0,Parent=0
This appears absurd. ?????
Also, perl itself always crashes after exactly 13 calls to Process32Next (probably on the 14th call). Plenty of RAM available, it has not returned code 18 to indicate no more processes (anyway, there are +- 50 running). Why would Perl itself just crash ?
thanks
Rod


--
-----------------------------------------------------
<corporate disclaimer drivel goes here>
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to