PcapPlusPlus: PcapLiveDeviceList::getPcapLiveDevicesList() empty vector / error

Hello, had a few issues with the live device list returning 0.

I’ve tried a few solutions discussed in a couple other closed issues to no avail.

int size = pcpp::PcapLiveDeviceList::getInstance().getPcapLiveDevicesList().size();
	std::cout << "size is: " << size << std::endl;

Output: size is: 0

But I have installing npcap and winpcap (npcap before winpcap) and nothing worked, size is always 0.

When I type ipconfig, this is what is returned: image

So clearly there is a network device on the computer.

I am running Windows 10 Pro 22h2, using vcpkg and Visual Studio 2022.

Current Status:

npcap: getPcapLiveDevicesList() empty winpcap: Causes crashes

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 28 (14 by maintainers)

Most upvoted comments

Yes, I do want to note that I recently used this project again for another project, it worked on the same PC

Could be issues with the underlying Windows system calls.

I would recommend trying to:

  1. Factory reset PC
  2. Fresh Windows install from a USB

It’s not the ideal solution but it seems to be what worked for me.

Currently running into the same issue, pcpp installed via vcpkg. Is there any way I can help?

EDIT: tried with conan and pcpp 23.09 and it works.

I checked strdup on this string and it works, I have no idea why it fails on your machine 😕 That’s definitely something internal in WinPcap, but I can’t figure out what the problem might be…