hello all,
I copy the NetBufferLists in FilterSendNetBufferLists function , and send it.
Problem a: i use the “ping cmd” ping this “ndislwf PC” at other PC. the ping cmd Request timeout.
Problem b: when i uninstall the ndislwf service, don’t install again.
I do it like this:
-
In the FilterAttach function, allocate the send/recv poolhandle. initialize send/recv queues.this queue be used save original netbufferlist.
PoolParameters.ContextSize = 0; PoolParameters.fAllocateNetBuffer = TRUE; use NdisAllocateNetBufferListPool(pFilter->FilterHandle, &PoolParameters); -
copy the NetBufferLists when FilterSendNetBufferLists function wes called, and send it.
FilterSendNetBufferLists(…)
{
…
do
{
DispatchLevel = NDIS_TEST_SEND_AT_DISPATCH_LEVEL(SendFlags);
#if DBG
…
#endif
// copy NetBufferLists
FILTER_ACQUIRE_LOCK(&pFilter->Lock, DispatchLevel);
pCopyNetBufferLists = CopyNetBufferList(NetBufferLists);
FILTER_RELEASE_LOCK(&pFilter->Lock, DispatchLevel);
// join original NetBufferLists to my Queues.
…
NdisFSendNetBufferLists(pFilter->FilterHandle, pCopyNetBufferLists, PortNumber, SendFlags);
}while(bFalse);
}
pNetBufferList = NdisAllocateNetBufferAndNetBufferList(
pNblPoolHandle,
0, // ContextSize
0, // ContextBackfill
pMdl, // MdlChain
0, // DataOffset
DataSize); // DataLength
copy data,just copy it, i consult NTDEV List. but i don’t know how to set NBLs parameters ,
i set the copied nbl: pCopiedNBL->SourceHandle = NetBufferLists->SourceHandle; pCopiedNBL->NblFlags = NetBufferLists->NblFlags;pCopiedNBL->Flags = NetBufferLists->Flags;pCopiedNBL->Status = NetBufferLists->Status;
- return original NetBufferList in FilterSendNetBufferListsComplete:
VOID
FilterSendNetBufferListsComplete(…)
{
// get the original from my queues
pOriginalNbl=serchqueue(mySendQueueHead,NetBufferLists);
// free NetBufferList
FreeNetBUfferList(NetBufferLists);
NdisFSendNetBufferListsComplete(pFilter->FilterHandle, pOriginalNbl, SendCompleteFlags);
}
- In the FilterDetach free the sedn/recv poolhandle, and send/recv Queues;