PNDIS_PACKET data results in crash when used in NdisMSendPacket

Hi,

I have prepared the NDIS packet for Windows XP in the following way. The data buffer and data length are available as arguments.

NdisAllocatePacket();
NdisAllocateMemoryWithTag()
Use data buffer from above in NdisAllocateBuffer()
pNdisAllocateBuffer->Next = NULL;
NdisChainBufferAtFront()

So obtained Ndis packet is the sent using NdisMSendPacket. Currently I observe a crash in while the data is sent.

Please suggest if the above method of preparing the packet is correct?
Or if anymore thing need to be done to prepare the Ndis packet?

Hi,

Also please suggest how to add tx complete handle in the case of Ndis Packet?