Skip to content

Commit

Permalink
allow WlanHelper to communicate with Packet.dll
Browse files Browse the repository at this point in the history
  • Loading branch information
theHawke committed Dec 6, 2022
1 parent f7837ff commit 7112e53
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packetWin7/Dll/Packet32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,12 +616,17 @@ static PCHAR NpcapGetAdapterID(_In_ LPCSTR AdapterName, _Out_opt_ PULONG pNpfOpe
const char *src = NULL;
ULONG NpfOpenFlags = 0;

if (0 != _strnicmp(AdapterName, WINPCAP_COMPAT_DEVICE_PREFIX, sizeof(WINPCAP_COMPAT_DEVICE_PREFIX) - 1)) {
if (0 == _strnicmp(AdapterName, WINPCAP_COMPAT_DEVICE_PREFIX, sizeof(WINPCAP_COMPAT_DEVICE_PREFIX) - 1)) {
src = AdapterName + sizeof(WINPCAP_COMPAT_DEVICE_PREFIX) - 1;
}
else if (0 == _strnicmp(AdapterName, NPF_DRIVER_COMPLETE_DEVICE_PREFIX, sizeof(NPF_DRIVER_COMPLETE_DEVICE_PREFIX - 1))) {
src = AdapterName + sizeof(NPF_DRIVER_COMPLETE_DEVICE_PREFIX) - 1;
}
else {
// Not expected format
SetLastError(ERROR_INVALID_NAME);
return NULL;
}
src = AdapterName + sizeof(WINPCAP_COMPAT_DEVICE_PREFIX) - 1;

// Look for tags (case sensitive)
// First the most common case: no tag or it's loopback
Expand Down

0 comments on commit 7112e53

Please sign in to comment.