jschollen has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I'm trying to retrieve bus relations thru WMI (Windows Measurement Instrumentation).
The best I have come up with is:
my $subDevices = $wmiService->ExecQuery('ASSOCIATORS OF {Win32_PnPEnti +ty.DeviceID="'.$deviceID.'"} WHERE AssocClass=Win32_PnPDevice');
But unfortunattely, I'm skipping a few intermediate ID's :-(

Can someone guide me?

20060920 Janitored by Corion: Removed readmore tags


Update: Appended full code in Re^2.


Update 2:
I found a solution to my problem. (See my own Re^2 on the subject for more details).

Replies are listed 'Best First'.
Re: WMI: Bus relations
by mikeock (Hermit) on Sep 20, 2006 at 19:37 UTC
    Post the rest of your code
    At this point it could be WMI fudging up or it could be the loop you use to go through all of the items!

    My sig Sucks!
      I don't think it's the loop, but here's the code:
      My guess is I'm missing some bus relations which I can't retrieve with "Win32_Bus". (The IDs I get with this call are not unique, hence I cann't use it).

      Am I missing something in this query?

      Update: Guess I'm looking for a logical bus, not a phisical one. But were (and how) to find it...?


      Update:
      Win32_Bus retrieves the phisical Bus devices. This is not the thing I needed, since more devices are connected on 1 physical bus.
      I did found a solution however.
      I have to querry the PDO (Physical Device Object). These can give me enough date (along with the deviceID) to combine all instances, created by the drivers, that belong to a single device.
Re: WMI: Bus relations
by talexb (Chancellor) on Sep 20, 2006 at 16:02 UTC
      But unfortunattely, I'm skipping a few intermediate ID's :-(

    ??? I have no idea what this means, or what your question is.

      Can someone guide me?

    Yeah -- this is a Perl site. Ask us a Perl question and we'll come up with lots of great ideas. I don't even know what your question is, so I don't know what the Perl part is, on order to think how to answer it.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      While the question could be clearer and better written where does it say that only general questions that a vast majority of monks could answer are the only acceptable ones!? It seems pretty clear that those of us without Windows Measurement Instrumentation experience should just move along.