微软例子里的
VOID FilterSendNetBufferLists(
IN NDIS_HANDLE FilterModuleContext,
IN PNET_BUFFER_LIST NetBufferLists,
IN NDIS_PORT_NUMBER PortNumber,
IN ULONG SendFlags
)
{
PMS_FILTER pFilter = (PMS_FILTER)FilterModuleContext;
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
PNET_BUFFER_LIST CurrNbl;
BOOLEAN DispatchLevel;
do
{
DispatchLevel = NDIS_TEST_SEND_AT_DISPATCH_LEVEL(SendFlags);
if (pFilter-> TrackSends)
{
FILTER_ACQUIRE_LOCK(&pFilter-> Lock, DispatchLevel);
CurrNbl = NetBufferLists;
while (CurrNbl)
{
pFilter-> OutstandingSends++;
FILTER_LOG_SEND_REF(1, pFilter, CurrNbl, pFilter-> OutstandingSends);
CurrNbl = NET_BUFFER_LIST_NEXT_NBL(CurrNbl);
}
FILTER_RELEASE_LOCK(&pFilter-> Lock, DispatchLevel);
}
//
// If necessary, queue the NetBufferList in a local structure for later processing
//
NdisFSendNetBufferLists(pFilter-> FilterHandle, NetBufferLists, PortNumber, SendFlags);
}
while (FALSE);
DEBUGP(DL_TRACE, ( " <===SendNetBufferList: Status = %8x.\n ", Status));