Skip to content

Commit

Permalink
Guard references to Loopback to allow SDV to build
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsaiviking committed Jan 4, 2017
1 parent 124c52f commit 8f9c936
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packetWin7/npf/npf/Openclos.c
Original file line number Diff line number Diff line change
Expand Up @@ -1814,11 +1814,13 @@ NOTE: Called at PASSIVE_LEVEL and the filter is in paused state

NPF_CloseBinding(Open);

#ifdef HAVE_WFP_LOOPBACK_SUPPORT
// "Npcap Loopback Adapter" is going to be detached, invalidate its global pointer as well.
if (Open->Loopback && Open == g_LoopbackOpenGroupHead)
{
g_LoopbackOpenGroupHead = NULL;
}
#endif

NPF_RemoveFromOpenArray(Open); // Must add this, if not, SYSTEM_SERVICE_EXCEPTION BSoD will occur.
NPF_ReleaseOpenInstanceResources(Open);
Expand Down
4 changes: 3 additions & 1 deletion packetWin7/npf/npf/Read.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,11 +668,13 @@ NPF_TapExForEachOpen(
// return;
// }

#ifdef HAVE_WFP_LOOPBACK_SUPPORT
if (Open->Loopback && g_DltNullMode)
{
DataLinkHeaderSize = DLT_NULL_HDR_LEN;
}
else
#endif
{
DataLinkHeaderSize = ETHER_HDR_LEN;
}
Expand Down Expand Up @@ -1313,4 +1315,4 @@ NPF_TapExForEachOpen_End:;

//NPF_StopUsingOpenInstance(Open);
//TRACE_EXIT();
}
}

0 comments on commit 8f9c936

Please sign in to comment.