When using Subprocesses() with the WMI-variant, I get the output:
"Use of uninitialized value in numeric ge (>=) at
C:/strawberry/perl/site/lib/Win32/Process/Info.pm line 670" two times.
After adding some debug output to Info.pm, I have found out, that the
"CreationDate" is undefined for some processes. On my Windows XP SP3,
these are the "Idle" process and the "System" process. I used the
Process Explorer from Sysinternals to double-check that and it did not
show a "Start Time" for these processes either.
I have created the attached patch to prevent the output.
It is just a "cosmetic" patch but I thought, you might be interested :-)
Erik
Subject: | Info.pm.patch |
--- Info.pm.orig Fri Jun 13 02:48:02 2008
+++ Info.pm Wed Apr 1 14:11:59 2009
@@ -667,7 +667,8 @@
$key_found++;
# TRW 1.011_01 next unless $prox{$proc->{ParentProcessId}};
$prox{$pop} or next; # TRW 1.011_01
- $proc->{CreationDate} >= $prox{$pop}{CreationDate} or next; # TRW 1.011_01
+ defined($proc->{CreationDate}) && defined($prox{$pop}{CreationDate}) &&
+ $proc->{CreationDate} >= $prox{$pop}{CreationDate} or next; # TRW 1.011_01
# TRW 1.011_01 push @{$subs{$proc->{ParentProcessId}}}, $proc->{ProcessId};
push @{$subs{$pop}}, $proc->{ProcessId};
}