Hi list,
I am totally a newbie for NT’s device driver developing. Now my task is to write a virtual network adapter driver program which can receive packets from NT’s TCP/IP protocol driver, then send them to a usermode process, and afterwards, get the reply from the process and then send it back to WinNT’s TCP/IP.
For the interaction between usermode process and my driver, I plan to supply DeviceObject->MajorFunction[IRP_MJ_READ/IRP_MJ_WRITE] functions and let usermode process invoke ReadFile()/WriteFile() to interact with my driver just as packet32 sample code does. ReadFile() will read ip packets from NT and WriteFile() inject those into NT.
I have read DDK documentation on NDIS part and some sample codes, including IMSamp, packet32, etc.
It seems NDIS will invoke MiniPortSend handler when TCP/IP have something to transfer, so my question is: in this case, how to let my IRP_MJ_READ function know there is something waiting? the MiniPortSend handler seems did it’s way without any relationship to IRP_MJ_READ function. how could I inform the usermode process the incoming of ip packets?
thanks in advance.
cheers.
(???r??z{e?˛???m?m?{]z???&j)@u?Ӣ?칻?&ޱ??i?Z?G?j)m?W???u?칻-E?"?Ǧm??(Z?X???,??&
>It seems NDIS will invoke MiniPortSend handler when TCP/IP have something to
transfer, so my question is: in this case, how to let my IRP_MJ_READ function
know there is something waiting?
Complete the READ IRP.
Max
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
well, Sir, can you describe it in more detail? How can I complete the READ IRP and where do I do this? In my mind, DeviceObject->MajorFunction[IRP_MJ_READ] will be called if usermode program invoke ReadFile(), and MiniPortSend handler will be called if there is any packet needs to be sent, how can I associate these two figures together? Thank you very much!
regards,
----- Original Message -----
From: Maxim S. Shatskih
To: NT Developers Interest List
Sent: Wednesday, May 23, 2001 3:18 AM
Subject: [ntdev] Re: NDIS3.0: rookie’s question on NT
It seems NDIS will invoke MiniPortSend handler when TCP/IP have something to
>transfer, so my question is: in this case, how to let my IRP_MJ_READ function
>know there is something waiting?
Complete the READ IRP.
Max
You are currently subscribed to ntdev as: xxxxx@sdtm.online.sh.cn
To unsubscribe send a blank email to xxxxx@lists.osr.com
???y˫???+.n?+???u?ڲ˛??^r*D???kN???r??zǧu??jy???^j???ׯ??? 0?j?b??(??(
- Your user mode program must call ReadFile, the IRP must be pended by the
driver and completed only when a network packet arrives.
- If the packet arrives without the IRP pending - then put it to some
queue, where it will reside till the IRP will arrive.
- In the latter case the IRP will be completed immediately after copying
the data from the queued packet.
Max
----- Original Message -----
From: Chen Miaobo
To: NT Developers Interest List
Sent: Wednesday, May 23, 2001 5:08 AM
Subject: [ntdev] Re: NDIS3.0: rookie’s question on NT
well, Sir, can you describe it in more detail? How can I complete the READ
IRP and where do I do this? In my mind,
DeviceObject->MajorFunction[IRP_MJ_READ] will be called if usermode program
invoke ReadFile(), and MiniPortSend handler will be called if there is any
packet needs to be sent, how can I associate these two figures together?
Thank you very much!
regards,
----- Original Message -----
From: Maxim S. Shatskih
To: NT Developers Interest List
Sent: Wednesday, May 23, 2001 3:18 AM
Subject: [ntdev] Re: NDIS3.0: rookie’s question on NT
It seems NDIS will invoke MiniPortSend handler when TCP/IP have something
to
transfer, so my question is: in this case, how to let my IRP_MJ_READ
function
know there is something waiting?
Complete the READ IRP.
Max
You are currently subscribed to ntdev as: xxxxx@sdtm.online.sh.cn
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com