Can someone at microsoft clarify NDIS perpacketinfo concept Pleasssssssssssssssssssssssse

If we look at IM sample driver passthru. We see functions like



These functions are getting the media specific info pointers and setting
them in destination packet.

As they give us the MediaSpecficiInfoSize we can even consider
allocating the memory and copy this from source area to target area and
use this new address to set in target packet.

When I looked more into NdisIMCopySendPerPacketInfo. I see this function
copying the pointers of






from source packet to destination packet. These are addresses and
pointing to predefined size of memory locations.

My Requirement is I need to keep the packet for a long time and I do not
know how long. So I copy all the packet information including data in
NDIS_BUFFERS into my own buffers. Now the question is what I should do
with perpacketinfo pointers and mediaspecificinfo pointers.

Logical answer is I have to allocate memory for each packet info and
copy into this allocated memory and use these pointers in my target
packet. But docs do not say anything for NdisIMCopySendPerPacketInfo
that I should not free the src packet etc… Is there any magic done by
NDIS to keep these pointers …?

So I believe if I just use the above function to copy per packet info
and return SUCCESS to protocol driver. Protocol driver would free the
packet and I would have pointers to freed memory in my target packet. Am
I right here?