Dear all,
-----start of code-------
NdisZeroMemory(pPacketContent, totalLength ) ;
NdisQueryBufferSafe(
NdisBuffer,
&tembuffer,
©size,
NormalPagePriority
…blah blah
now i have the “pPacketcontent = full network packets” & “DataOffset=Length of packets”
i try to use sprintf to grep the pPacketContent[54] until end of the packet, it will always cause the BSOD. Code as below:
--------------start of code----------
for(j=54;j<=DataOffset;j++)
{
sprintf(Buffer1,“%.*s”,pPacketContent[j]);
}
MyDriverWriteFile((PVOID)pPacketContent, DataOffset, m_ghFileHandle);
…
-----end-----------
The purpose of the code above, i want to copy the pPacketContent start from byte 54 until the end to Buffer1, and i will use the MyDriveWriteFile to write the content to text file in c:\xxx.txt using WorkItem method.
But it will always cause the blue screen. Anyone can help to see any problems in my code above? thanks