mirror of https://github.com/PCSX2/pcsx2.git
DEV9: Use FriendlyName for Pcap adapters on windows
This commit is contained in:
parent
802c18cb68
commit
33b6cbc2a9
|
@ -326,6 +326,13 @@ std::vector<AdapterEntry> PCAPAdapter::GetAdapters()
|
|||
mbstowcs(wEth, d->name, sizeof(config.Eth) - 1);
|
||||
entry.guid = std::wstring(wEth);
|
||||
|
||||
IP_ADAPTER_ADDRESSES adapterInfo;
|
||||
|
||||
if (GetAdapterFromPcapName(d->name, &adapterInfo))
|
||||
entry.name = std::wstring(adapterInfo.FriendlyName);
|
||||
else
|
||||
{
|
||||
//have to use description
|
||||
//NPCAP 1.10 is using an version of pcap that dosn't
|
||||
//allow us to set it to use UTF8
|
||||
//see https://github.com/nmap/npcap/issues/276
|
||||
|
@ -337,6 +344,7 @@ std::vector<AdapterEntry> PCAPAdapter::GetAdapters()
|
|||
MultiByteToWideChar(CP_ACP, 0, d->description, len_desc, buf, len_buf);
|
||||
entry.name = std::wstring(buf);
|
||||
delete[] buf;
|
||||
}
|
||||
#else
|
||||
entry.name = std::string(d->name);
|
||||
entry.guid = std::string(d->name);
|
||||
|
|
Loading…
Reference in New Issue