> -----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-300228-
xxxxx@lists.osr.com] On Behalf Of xxxxx@socket.net
Sent: Wednesday, September 12, 2007 6:03 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] NDIS IM Memory Leak
I have a NDIS IM that modifies packets both incoming and outgoing.
Eventually I get
an error on the send side from the NdisAllocateMemoryWithTag call.
After much debugging, I have not found any problems with the code that
allocs/frees new packets, buffers and VM. So, here is my question:
Is it possible to incorrectly set values in the original or new packet
(OOB, per packet, etc) that could cause another layer to leak memory.
I do not access the buffer chain in the original packets.
I hope I have provided enough info…
[PCAUSA] Key things to look at include returning original packet to the originator. Do you call NdisMReturnPacket on original send packets?
Also, in ProtocolSendComplete do you differentiate between your own packets being completed and Passthru (unmodified) packets - if you have any. You should not call NdisMReturnPacket for your modified packets.
The “original packet” field in your modified packet should point to your own packet - not the original packet.
Can’t think of much else. Somewhere you have overlooked releasing something that you allocated. The fault could be elsewhere than the send path. For example, the receive path could be screwed-up, but the fault finally shows up when you try to make a send.
Take a look at the NDIS debugger extension. Perhaps it has a tool that can show memory hog.
Have you used the pooltag tools to see if, in fact, it is your own allocations that are not being released. That’s what the TAG is for!
Good luck,
Thomas F. Divine
http://www.pcausa.com
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer