NDIS IM Driver Question

Can I use shared memory between NDIS IM Driver and an Win 32 Application?

Actually i want to pass UDP Packets from NDIS IM Driver to an Win 32
application and receive them back.Can i achieve this using shared memory or
pipes or something else?

Thanks in advance.

Sunny.

While using shared memory is technically possible, it’s strongly discouraged for a number of reasons, among which synchronization (which can be a pain to get it right) and security (you need to be careful to expose only the shared memory you are interested in).

The “blessed” approach for these problems is using IOCTLs and the so-called “inverted call” method to move packets from kernel to user mode. You can find a description of the inverted call model on the OSRonline website.

Hope it helps
GV
----- Original Message -----
From: shobhit shingla
To: Windows System Software Devs Interest List
Sent: Wednesday, June 06, 2007 8:23 AM
Subject: [ntdev] NDIS IM Driver Question

Can I use shared memory between NDIS IM Driver and an Win 32 Application?

Actually i want to pass UDP Packets from NDIS IM Driver to an Win 32 application and receive them back.Can i achieve this using shared memory or pipes or something else?

Thanks in advance.

Sunny.
— Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Best method is to use IOCTL using the “inverted call method” that is widely
discussed in archived postings over several years.

Here your application makes an asynchronous IOCTL call that passes a buffer
to the driver to be filled with one or more packet’s data. The driver pends
the operation and fills the buffer as packets are received. When the buffer
is full it completes the pended I/O request.

Please poke through the archives. This has been widely discussed, so your
answers and well as discussion of the pros and cons of various approaches is
already there for you to find without taking up lots of list bandwidth.

Thomas F. Divine

http://www.pcausa.com

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of shobhit shingla
Sent: Wednesday, June 06, 2007 11:23 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] NDIS IM Driver Question

Can I use shared memory between NDIS IM Driver and an Win 32 Application?

Actually i want to pass UDP Packets from NDIS IM Driver to an Win 32
application and receive them back.Can i achieve this using shared memory or
pipes or something else?

Thanks in advance.

Sunny.

— Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Using this approches can achieve something like this

NDIS IM Driver receives all the packets from TCP/IP Stack . It selects only
UDP Packets and send them to user mode application using “inverted call”.
Then the user mode application returns the UDP Packet to the NDIS Driver
which will then send them to the network.

I want to know Is this Feasible?

Thanks in Advance.

On 6/6/07, Thomas F. Divine wrote:
>
> Best method is to use IOCTL using the “inverted call method” that is
> widely discussed in archived postings over several years.
>
>
>
> Here your application makes an asynchronous IOCTL call that passes a
> buffer to the driver to be filled with one or more packet’s data. The driver
> pends the operation and fills the buffer as packets are received. When the
> buffer is full it completes the pended I/O request.
>
>
>
> Please poke through the archives. This has been widely discussed, so your
> answers and well as discussion of the pros and cons of various approaches is
> already there for you to find without taking up lots of list bandwidth.
>
>
>
> Thomas F. Divine
>
> http://www.pcausa.comhttp:</http:>
>
>
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *shobhit shingla
> Sent: Wednesday, June 06, 2007 11:23 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] NDIS IM Driver Question
>
>
>
> Can I use shared memory between NDIS IM Driver and an Win 32 Application?
>
>
>
> Actually i want to pass UDP Packets from NDIS IM Driver to an Win 32
> application and receive them back.Can i achieve this using shared memory
> or pipes or something else?
>
>
>
> Thanks in advance.
>
>
>
> Sunny.
>
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256http:To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServerhttp:
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256http:
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServerhttp:
></http:></http:></http:></http:>

Yep.

On Jun 6, 2007, at 11:36 AM, shobhit shingla wrote:

Using this approches can achieve something like this

NDIS IM Driver receives all the packets from TCP/IP Stack . It
selects only UDP Packets and send them to user mode application
using “inverted call”. Then the user mode application returns the
UDP Packet to the NDIS Driver which will then send them to the
network.

I want to know Is this Feasible?

Thanks in Advance.

On 6/6/07, Thomas F. Divine wrote:
> Best method is to use IOCTL using the “inverted call method” that
> is widely discussed in archived postings over several years.
>
>
> Here your application makes an asynchronous IOCTL call that passes
> a buffer to the driver to be filled with one or more packet’s data.
> The driver pends the operation and fills the buffer as packets are
> received. When the buffer is full it completes the pended I/O request.
>
>
> Please poke through the archives. This has been widely discussed,
> so your answers and well as discussion of the pros and cons of
> various approaches is already there for you to find without taking
> up lots of list bandwidth.
>
>
> Thomas F. Divine
>
> http://www.pcausa.com
>
>
>
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of shobhit
> shingla
> Sent: Wednesday, June 06, 2007 11:23 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] NDIS IM Driver Question
>
>
> Can I use shared memory between NDIS IM Driver and an Win 32
> Application?
>
>
> Actually i want to pass UDP Packets from NDIS IM Driver to an Win
> 32 application and receive them back.Can i achieve this using
> shared memory or pipes or something else?
>
>
> Thanks in advance.
>
>
> Sunny.
>
> — Questions? First check the Kernel Driver FAQ at http://
> www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
> Server section of OSR Online at http://www.osronline.com/page.cfm?
> name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://
> www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> — Questions? First check the Kernel Driver FAQ at http://
> www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
> Server section of OSR Online at http://www.osronline.com/page.cfm?
> name=ListServer