Crash when calling NdisMIndicateReceiveNetBufferLists
- From: "Fredrik Jansson" <nospam@xxxxxxxxxxxxxxx>
- Date: Thu, 4 Oct 2007 20:41:28 +0200
I am writing a virtual NDIS 6.0 miniport adapter.
In MiniportSendNetBufferList I am NATing packets and indicates them back:
1. Copy packet data from incoming NetBufferList to a buffer on the stack
2. NAT packet
3. Create 2 MDLs, one for ethernet header and one for the rest:
headerMdl = NdisAllocateMdl(Adapter->AdapterHandle, &data.buf[0], sizeof(CTEthernetHeader));
dataMdl = NdisAllocateMdl(Adapter->AdapterHandle, &data.buf[sizeof(CTEthernetHeader)], data.total_size - sizeof(CTEthernetHeader));
headerMdl->Next = dataMdl;
4. Allocate a new net buffer list:
NdisAllocateNetBufferAndNetBufferList(Adapter->RecvNetBufferListPool,
0, 0,
headerMdl, 0,
data.total_size);
5. Trying to indicate the packet with resources flags set.
NdisMIndicateReceiveNetBufferLists(
Adapter->AdapterHandle,
netlist,
NDIS_DEFAULT_PORT_NUMBER,
1,
NDIS_RECEIVE_FLAGS_RESOURCES);
When calling NdisMIndicateReceiveNetBufferLists it crashes so bad WinDbg doesn't even catch it. Sometimes it successfully indicates one packet, but mostly not.
When I have debugged it has not been running at dispatch level.
Is it ok to indicate packets from MiniportSendNetBufferList at all?
Is there anything obvious (to anyone but me ;) ) I have missed?
If the stack buffer is the problem, how do I handle the case when MiniportSendNetBufferList is called in dispatch level since NdisMoveMemory doesn't work then?
Thanks!
Fredrik
.
- Follow-Ups:
- Re: Crash when calling NdisMIndicateReceiveNetBufferLists
- From: Eric Boudrand
- Re: Crash when calling NdisMIndicateReceiveNetBufferLists
- From: Maxim S. Shatskih
- Re: Crash when calling NdisMIndicateReceiveNetBufferLists
- Prev by Date: Vista change in behavior in TDI and Irp->PendingReturned Flag
- Next by Date: Re: PCI interrupt
- Previous by thread: Vista change in behavior in TDI and Irp->PendingReturned Flag
- Next by thread: Re: Crash when calling NdisMIndicateReceiveNetBufferLists
- Index(es):
Relevant Pages
|