Win32-Process-Info
view release on metacpan or search on metacpan
lib/Win32/Process/Info/PT.pm view on Meta::CPAN
that the Win32::Process::Info keys are derived from
Proc::ProcessTable::Process fields, and if your OS does not support the
underlying field, you will not get it. Here are the possible keys and
the fields from which they are derived:
CreationDate: start
Description: cmndline
ExecutablePath: fname (note 1)
KernelModeTime: stime (note 2)
Name: basename (fname)
Owner: '\' . getpwuid (uid) (note 3)
OwnerSid: uid (note 4)
ParentProcessId: ppid
ProcessId: pid
UserModeTime: utime (note 2)
Notes:
1) ExecutablePath may not be an absolute pathname.
2) We assume that Proc::ProcessTable::Process returns stime and utime in
lib/Win32/Process/Info/PT.pm view on Meta::CPAN
my ($info, $proc) = @_;
$info->{KernelModeTime} = $proc->stime() * 10;
},
utime => sub {
my ($info, $proc) = @_;
$info->{UserModeTime} = $proc->utime() * 10;
},
uid => sub {
my ($info, $proc) = @_;
$info->{OwnerSid} = my $uid = $proc->uid ();
$info->{Owner} = $pw_uid{$uid} ||= '\\' . getpwuid($uid);
},
);
my @fld_sup = grep { defined $_ } Proc::ProcessTable->new ()->fields ();
sub GetProcInfo {
my ($self, @args) = @_;
my $my_pid = $self->My_Pid();
my $opt = ref $args[0] eq 'HASH' ? shift @args : {};
my $tbl = Proc::ProcessTable->new ()->table ();
package main;
use strict;
use warnings;
use File::Spec;
use Test::More 0.88; # For done_testing();
BEGIN { eval 'use Win32::Getppid' }
my $my_user = eval { getlogin || getpwuid ($<) };
my $reactos = $^O eq 'MSWin32'
&& defined $ENV{OS} && lc $ENV{OS} eq 'reactos';
require_ok 'Win32::Process::Info'
or BAIL_OUT;
eval {
Win32::Process::Info->import();
1;
( run in 0.250 second using v1.01-cache-2.11-cpan-454fe037f31 )