Hi,
I have an NDIS IM driver working smoothly on WXP and now I’m testing on W2K.
Found a couple minor issues to get me rolling, but now I have a problem on
W2K that I don’t have on WXP with the same code block (see below). So, this
code is running in the context of a system thread that my IM driver has
established.
I’m attempting to indicate a packet received previously where I
- extracted the data from a miniport driver’s up call,
- cached the data in my own allocated buffer
- then performed some processing on the data on my system thread.
This is a VPN-like product, so the original packet came in on a physical
miniport interface, but I want it to look like it came from a virtual
miniport interface to the protocol stack above.
So, when I step into the NDIS code to see what I can see, it appears that
NDIS thinks I’m trying to indicate a packet I don’t own. (I can see it
sending a DbgPrint message to that effect.)
Any insight is appreciated.
// allocate a packet
NdisAllocatePacket(&Status,
&pPacket,
pAdapt->SendPacketPoolHandle);
if (NDIS_STATUS_SUCCESS != Status)
{
// handle the error and get out
…snip
}
// Allocate a buffer descriptor
NdisAllocateBuffer(&Status,
&pNewNdisBfr,
pAdapt->hRecvBufferPool,
pNewPayload,
ulNewPayloadSize);
if (NDIS_STATUS_SUCCESS!=Status)
{
// handle the error and get out
…snip
}
// Show new NDIS_BUFFER used.
RecvRsvd = (PRECV_RSVD) (pPacket->MiniportReserved);
RecvRsvd->bNewBuffer = TRUE;
RecvRsvd->bInjectedPacket = FALSE;
// Chain new buffer descriptor to new packet.
NdisChainBufferAtFront(pPacket,
pNewNdisBfr);
// Set the header size
NDIS_SET_PACKET_HEADER_SIZE(pPacket, sizeof(ETHHDR));
// Set the packet status so that the upper layer protocol
will // copy the buffer immediately
NDIS_SET_PACKET_STATUS(pPacket, NDIS_STATUS_RESOURCES);
// indicate the packet to the upper level protocol
NdisMIndicateReceivePacket(pAdapt->MiniportHandle, &pPacket,
1);
Paul Benware
KoolSpan Inc.
www.koolspan.com