Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

where to free my own ndis buffer

2 views
Skip to first unread message

fkhg1

unread,
Jul 10, 2008, 11:07:10 AM7/10/08
to
hi, iam currently writing a litte ndis driver based on the passthru sample,
and i have a memory leak, i dont know where to free my own buffers

i have try'd to free it in PtSendComplete but with no result on the memory
leaks.
i see that i get there some packet's but not all of it, is there another
place where i must free my other buffers?

--------------- PtSendComplete
Pkt = SendRsvd->OriginalPkt;

#ifndef WIN9X
NdisIMCopySendCompletePerPacketInfo (Pkt, Packet);
#endif
NdisQueryPacket(Packet,NULL,&BufferCount,&CurrentBuffer,&TotalPacketLength);
NdisUnchainBufferAtFront(Packet,&CurrentBuffer);
if (CurrentBuffer) {
NdisQueryBufferSafe(CurrentBuffer,(PVOID
*)&tempbuffer,&buflen,HighPagePriority);
if (tempbuffer && buflen) {
NdisFreeMemory(tempbuffer,buflen,0);
}
NdisFreeBuffer(CurrentBuffer);
}
NdisDprFreePacket(Packet);
NdisMSendComplete(pAdapt->MiniportHandle,Pkt,Status);
---------------


Maxim S. Shatskih

unread,
Jul 10, 2008, 3:43:58 PM7/10/08
to
What tag is leaking? try !poolused in WinDbg to find this.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com

"fkhg1" <fk...@web.de> wrote in message
news:OUkZu6p4...@TK2MSFTNGP02.phx.gbl...

fkhg1

unread,
Jul 11, 2008, 3:05:24 AM7/11/08
to
its all in my pool, i think it must be a problem with the point where to
free the buffer/memory
when i try to free the memory and buffer at the end part of MPSendPackets,
PTReceive and PTReceivePacket i dont have any memory leak, but than i have
no outgoing or incoming packets :-D
i just need to know where i can free the memory and buffer
in PtSendComplete i only see the half of the packets when they are done,
there must be another place where i can free the memory for the other half
of the packets, but i dont find it


"Maxim S. Shatskih" <ma...@storagecraft.com> schrieb im Newsbeitrag
news:%234jhNVs...@TK2MSFTNGP05.phx.gbl...

fkhg1

unread,
Jul 11, 2008, 3:34:55 AM7/11/08
to
hi, i have found the problem in PtReceivePacket, i think PtReceiveComplete
is the right place to free the memory for the packets that i have send
there, but i dont see there any packets, so where is the right place to free
the memory for received packets? some ideas?

"fkhg1" <fk...@web.de> schrieb im Newsbeitrag
news:enlQPSy4...@TK2MSFTNGP02.phx.gbl...

Maxim S. Shatskih

unread,
Jul 11, 2008, 11:22:17 AM7/11/08
to
In PtReceivePacket, the packet belongs to underlying miniport and you
cannot free it.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
ma...@storagecraft.com
http://www.storagecraft.com

"fkhg1" <fk...@web.de> wrote in message

news:eVyluiy4...@TK2MSFTNGP04.phx.gbl...

fkhg1

unread,
Jul 17, 2008, 4:59:24 AM7/17/08
to
i allocate my own one, and just dont use the old packet or the old packet
buffer, its a tiny encryption driver
the only thing i do, is to alloc a own packet, an own buffer, and dont touch
the old packet anymore, and i know, i cannot free packets or buffers that i
didnt have allocated myself


"Maxim S. Shatskih" <ma...@storagecraft.com> schrieb im Newsbeitrag

news:OjJnon24...@TK2MSFTNGP04.phx.gbl...

0 new messages