Ndis im drives those things

Source: Internet
Author: User

Recently I don't know why I started to learn windows NDIS driver development. I used the example of Hanjiang standalone fishing. In fact, his code is a little bit, and there are so many useful things, but thanks to him for making such a book. Otherwise, there is really no better book for windows NDIS.

It seems that everyone is reluctant to say this. I have been searching for some classic examples on the Internet for a long time, but the online code is a bit wrong, and there is no reason to explain the core ..

It is a metaphor that everyone will encounter problems. How can we send custom data packets in the NDIS middle layer? Generally, we send blue screens and there are similar articles on the Internet.

Http://blog.csdn.net/floweronwarmbed/article/details/3202065

 

==== (! (! (dwBufferLength >= -== NdisAllocateMemory(&pSendBuffer, dwSendBufferLength,  (status !=&status, & (status !=&& (status !== (PSEND_RSVD)(pSendPacket->->OriginalPkt = NULL; ->Private.Head->Next=->Private.Tail=& (status !=&*)&&= (PSEND_RSVD)(Packet->= SendRsvd->        (!&*)&& (pMySendBuffer &&

However, the code here is vague and does not indicate the nature of the blue screen. It is only the reason for release in PtSendComplete...

In fact, I tested it here. In fact, if you do not release the maximum amount of memory leaks, your program memory leaks will not crash immediately. application crashes generally because our memory is out of bounds, A similar system is just the largest application. Then I also saw something similar to not calling NdisMSendComplete on the Internet. This API notifies the upper-layer driver to release resources, and so on. Obviously, my NidsSend is called on the middle layer without the upper layer, how can we release the upper layer !! Apparently, an error is reported? Is the blue screen still used ?? I found that the blue screen driver is a terrible thing. I have been studying it for the past two weeks. As long as you pay attention to the memory operation, the blue screen is basically not displayed. The memory leakage will only affect the stability of the driver.

It looks like the one in MySendPacket above

NdisAllocateBuffer (& status, & pSendPacketBuffer, NdisSendPacketPool, pSendBuffer, dwSendBufferLength );
This should be an error,
The handle of NdisSendPacketPool is obviously allocated to Packet.
I think the NdisAllocateBuffer handle should be self-called.VOID
NdisAllocateBufferPool (
OUT PNDIS_STATUS Status,
OUT PNDIS_HANDLE PoolHandle,
IN UINT NumberOfDescriptors
);
..
I don't know if they want to write code incorrectly. If they can be mixed, it seems that Microsoft has no need to provide NdisSendPacketPool functions.
After a project is complete, I will share the code. ----------- Implements the core functions of managing LAN management software using ARP spoofing.
I saw a very good guy a few days ago. I felt very competent. I read his article and he was very familiar with the linux kernel. Then the development of the windows Driver is very good. It seems that linux is really a paradise for c/c ++...
You have to study it carefully when you have time.


Finally, I posted the API of the ptComple function that I wrote ..
=== == (PSEND_RSVD)(Packet->= tempRsvd-> (Pkt == (PNDIS_PACKET)&*)&& (pMySendBuffer &&                PoolHandle = (PoolHandle != pAdapt->                -> = (PSEND_RSVD)(Packet->= SendRsvd->->    

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.