will LivePacketDevice.AllLocalMachine always provide response in same order?

Sep 2, 2010 at 7:47 AM

Hi,

Will LivePacketDevice.AllLocalMachine always provide response in same order?

That is can I use the index the the result in a UI selection panel, and then when finally selected I can repeat the query for the list and use the index number to grab the correct LivePacketDevice based on the index.

thanks

Coordinator
Sep 2, 2010 at 8:54 AM

Hi,

 

LivePacketDevice.AllLocalMachine property uses WinPcap's pcap_findalldevs_ex() function.

There isn't anything about the order of the devices returned by this function in its documentation (and neither in AllLocalMachine) so I would assume the order is not guaranteed.

http://www.winpcap.org/docs/docs_412/html/group__wpcapfunc.html#ga98f36e62c95c6ad81eaa8b2bbeb8f16e

If you want the order to be constant, I suggest sorting the devices by their different parameters (like Name and Description) to keep their order the same.

 

Boaz.

Sep 2, 2010 at 12:02 PM

thanks - sounds like a good idea