<div>I also (naturally) thought that the InstanceName from the event is the same as the Name property of Win32_NetworkAdapter. It seems to be true in most cases. Except for pluggable devices. Every time you unplug the card and stick it back into the USB port, something very strange happens: the InstanceName changes. A #1 is appended to the name, then #2, #3 ... and so on every time you unplug it and plug it back again. The situation is very similar if you have 2 identical adapters attached to the same computer (and I have :-(). Their instance name will be different. Unfortunatelly the name property of the Win32_NetworkAdapter is not changed by the OS, so it will never match the IntanceName except for the first time the adapter is installed on the computer (only one adapter). Pretty weird. I think this might be a bug in the WMI provider (it is already known to have many bugs).
</div>
<div> </div>
<div>The good news is that the Name property of the Win32_PnPEntity class is always in sync with the InstanceName as a new Win32_PnPEntity instance is created every time you plug the adapter. And it is easy to navigate the association from the pnp entity to the win32_networkadapter.
</div>
<div> </div>
<div>This is why I first select from WMI the PNPEntity and the navigate to win32_networkadapter and then to win32_networkadapterconfiguration to get the GUID. </div>
<div> </div>
<div>Bye<br> </div>
<div><span class="gmail_quote">On 8/21/06, <b class="gmail_sendername">Jouni Malinen</b> <<a href="mailto:jkmaline@cc.hut.fi">jkmaline@cc.hut.fi</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On Mon, Aug 21, 2006 at 06:43:52PM +0300, Adrian Nistor wrote:<br><br>> sorry for the very late reply. In the attached ZIP file I included the
<br>> config file and the output of the supplicant that demonstrates the issue.<br>> It is very probable that you cannot reproduce this benaviour unless you use<br>> the same wireless card. Mine is a Sweex usb adapter based on the Ralink 2500
<br>> chipset. The issue also appeared with another 2 USB adapters from other<br>> manufacturers.<br>><br>> I also included in the ZIP the two source files I modified in order to fix<br>> the defect. The sources are based on the snapshot published in 8-Aug-2006.
<br><br>Thanks! I was trying to understand the use of PNPDeviceID in the<br>queries. Why is the Win32_PnPEntity class needed here? Is Name property<br>in that class guaranteed to match with InstanceName in the events? Why
<br>not just use Name in Win32_NetworkAdapter?<br><br>The problem for me is that I have found no documentation describing<br>where that InstanceName is coming from. Win32_NetworkAdapter class has<br>number of properties (Caption, Description, Name, ProductName) that
<br>could be used as the source or it could be something completely<br>different..<br><br>I'm actually considering of doing this in the opposite order, i.e.,<br>mapping adapter GUID to InstanceName, i.e., something like this:
<br><br>SELECT Index FROM Win32_NetworkAdapterConfiguration<br> WHERE SettingID='{GUID}'<br><br>SELECT Name FROM Win32_NetworkAdapter WHERE Index=idx<br><br>This would need to be done only once and the matching of events could
<br>actually be left to WMI since the "SELECT * FROM<br>MSNdis_StatusMediaConnect" type queries could actually be changed to<br>"SELECT * FROM MSDNdis_StatusMediaConnect WHERE InstanceName='name'"<br>(and that name would need to be the correct one; which could be Name
<br>from Win32_NetworkAdapter).<br><br>In addition to limiting number of WMI queries and reducing latency for<br>each event, this should also simplify the interface from ndis_events.c<br>to driver_ndis*.c since events would be delivered only for the correct
<br>adapter. I would just like to get confirmation on what is exact source<br>of InstanceName string in WMI..<br><br>--<br>Jouni Malinen PGP id EFC895FA<br>_______________________________________________
<br>HostAP mailing list<br><a href="mailto:HostAP@shmoo.com">HostAP@shmoo.com</a><br><a href="http://lists.shmoo.com/mailman/listinfo/hostap">http://lists.shmoo.com/mailman/listinfo/hostap</a><br></blockquote></div><br>