rovf has asked for the wisdom of the Perl Monks concerning the following question:
But since the docs explain:use Win32::Process::Info; my $wpi=Win32::Process::Info->new();
if you use fork(), you must disallow WMI completely by loading this module as follows: use Win32::Process::Info qw{NT};I decided to write the code like this:
This works fine on one of my systems, but on the other one it complains:use Win32::Process::Info qw(NT); my $wpi=Win32::Process::Info->new;
Same result if I replace the constructor call by Win32::Process::Info->new('NT'). The working system runs Windows 7, while the one showing the error runs Windows XP. Of course there might be other differences in the setup of the two hosts which could matter in this case.Error - Variant 'WMI' is unsupported on your configuration. Disallowed + on load of Win32::Process::Info. at ... Error - Variant 'NT' is unsupported on your configuration. Can't locat +e loadable object for module Win32::API in @INC Compilation failed in + require at ... Error - Variant 'PT' is unsupported on your configuration. Disallowed +on load of Win32::Process::Info. at ...
I tried to get more information by playing around a bit with the code:
This resulted in the following error messages:use Win32::Process::Info; my $wpi=Win32::Process::Info->new('NT');
I don't know enough about Windows to understand the Windows message, but at least it explains the message about 'PT' variant. This module isn't installed (which is surprising - I had installed everything using ppm and would have expected that these dependencies would be resolved implicitly). Anyway, I'm more interested in the 'NT' variant, so I wonder what this Windows error message is supposed to mean. It claims about a missing RPC server. I guess this RPC means "remote procedure call". While I don't administer the host in question, it might well be that there is no RPC server defined; but why, on earth, would a module to fetch process information, need RPC?Error - Win32::Process::Info::WMI failed to get winmgs object: Win32::OLE(0.1707) error 0x800706ba: "The RPC server is unavailable" a +fter character 0 in "winmgmts:{impersonationLevel=impersonate}!//NT/root/cimv2" at ... Error - Variant 'NT' is unsupported on your configuration. Can't locat +e loadable object for module Win32::API in @INC ... Error - Variant 'PT' is unsupported on your configuration. Unable to l +oad Proc::ProcessTable at ...
Another interesting question is the meaning of the error message about the NT variant. It complains about a missing "loadable object". What's this? And why is it that this error doesn't show up when I leave out the specification of an explicit variant in the import list of the module and in the parameter to the new() function?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::Process::Info question
by BrowserUk (Patriarch) on Sep 14, 2011 at 11:49 UTC | |
by rovf (Priest) on Sep 14, 2011 at 12:07 UTC | |
by BrowserUk (Patriarch) on Sep 14, 2011 at 12:16 UTC | |
by rovf (Priest) on Sep 15, 2011 at 11:36 UTC | |
by BrowserUk (Patriarch) on Sep 15, 2011 at 11:43 UTC | |
|
Re: Win32::Process::Info question
by Corion (Patriarch) on Sep 14, 2011 at 11:40 UTC | |
by rovf (Priest) on Sep 15, 2011 at 11:25 UTC |