The DDK wording is not straightforward enough. It should say:In addition, in responding to a previous discussion on wmi, it bothered me that a some external code was run and interpreted in order to get NIC info, so I came up with this: (You need to install DBD::WMI:"The OID_PNP_QUERY_POWER OID requests the miniport driver to indicate whether it can transition its NIC to the low- power state specified in the NDIS_DEVICE_POWER_STATE value pointed by InformationBuffer." instead of "low-power state specified in the InformationBuffer". One time I interpreted it as:
PowerState = (NDIS_DEVICE_POWER_STATE) InformationBuffer;
This probably needs some tweaking to get the info you require. MS document is at http://msdn2.microsoft.com/en-us/library/aa394217.aspx .use DBI; use strict; my $dbh = DBI->connect('dbi:WMI:'); # You need to install DBD::WM +I my $sth = $dbh->prepare(<<WQL ); SELECT * from Win32_NetworkAdapterConfiguration WHERE IPEnabled = True WQL my @atts = qw[caption DefaultIPGateway Description ServiceName Index + IPAddress MACAddress ]; # $sth->execute(); while (my @row = $sth->fetchrow) { my $item= $row[0]; for (@atts){ if (ref $item->{$_} eq "ARRAY"){ print "$_\t=". join (",", @{$item->{$_}}) . ";\n"; }else{ print "$_\t=". $item->{$_} . ";\n"; } } print "\n"; }
Update: One more point : I read somewhere in the MSDN site (Can't find the URL now) that using the WIN32 API to get NDIS info is deprecated. It recommended using WMI.
"As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom
In reply to Re: OID Power Status Query
by NetWallah
in thread OID Power Status Query
by cmv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |