Chaining Problems (and no I am not Mr. T ;-)

Hi folks, I wonder if someone could assist me.
I want to unchain the first buffer from the packet, chain my own buffer at
front and then chain the original buffer at front again. I would end up with
my buffer inserted between the first and second buffers in the original
packet.
I am using the following code to do this in MPSend( ). Here
¡®originalPacket¡¯ is the packet to be sent, ¡®firstBuffer¡¯ is first buffer
in that packet and ¡®myBuffer¡¯ is the buffer I construct and want to insert
in the packet.

NdisAllocateBufferPool(&myStatus,&myBufferPool,3);
if(myStatus==NDIS_STATUS_SUCCESS){
NdisAllocateMemoryWithTag(&myBaseAddress,60,‘toor’);
NdisAllocateBuffer(&myStatus,&myBuffer,myBufferPool,myBaseAddress,14);
if(myStatus==NDIS_STATUS_SUCCESS){
NdisQueryBuffer(myBuffer,&myVirtualAddress,&myLength);
if(myBuffer){
//I write my own buffer
here NdisUnchainBufferAtFront(originalPacket,&firstBuffer);
if(firstBuffer){
NdisChainBufferAtFront(originalPacket,myBuffer);
NdisChainBufferAtFront(originalPacket,firstBuffer);
}
}
}

However this gives a blue screen with the error ¡®BAD_POOL_CALL¡¯. What am I
doing wrong. Any suggestions would be much appreciated. Thanks in advance
Regards,
Yasser Toor

P.S I get the same error when I try to chain a buffer at the back.


The new MSN 8: smart spam protection and 3 months FREE*.
http://join.msn.com/?page=features/junkmail&xAPID=42&PS=47575&PI=7324&DI=7474&SU=
http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_smartspamprotection_3mf