Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > NDIS IM driver usermode app communication

Reply
Thread Tools Display Modes

NDIS IM driver usermode app communication

 
 
Vipin
Guest
Posts: n/a

 
      06-01-2005
Hi,
I know that we can make use of DeviceIoControl(...) to the usermode
app -- driver communication. I am yet to read James's wmi mechanism also.

Thing is I want to send the bits and bytes (the one that comes into the send
routine) back to a user mode app.
I don't think using DeviceIOControl is a good way to acheive this because of
the increased buffering being involved. I thought of logging to file and
then have the usermode app read from it, but that approach would be ugly.

Is there a better, easier and cleaner way to do the communication from
kernel mode to user mode?

Thanks
Vipin


 
Reply With Quote
 
 
 
 
Thomas F. Divine [DDK MVP]
Guest
Posts: n/a

 
      06-02-2005

"Vipin" <> wrote in message
news:%...
> Hi,
> I know that we can make use of DeviceIoControl(...) to the usermode
> app -- driver communication. I am yet to read James's wmi mechanism also.
>
> Thing is I want to send the bits and bytes (the one that comes into the
> send
> routine) back to a user mode app.
> I don't think using DeviceIOControl is a good way to acheive this because
> of
> the increased buffering being involved. I thought of logging to file and
> then have the usermode app read from it, but that approach would be ugly.
>
> Is there a better, easier and cleaner way to do the communication from
> kernel mode to user mode?
>

No, Read or IOCTL is the best way to pass the bytes to user-mode.

If you are monitoring packets, pass a large buffer to the driver and have
the driver fill the buffer with multiple packets. Of course, some sort of
structure will be needed to "package" each received packet.

Examine the use of direct I/O. Using this method the buffer exchanged
between the driver and the application is not copied an extra time. However,
the driver must do a little extra work to get a kernel-mode pointer to the
user-allocated buffer. See MmGetSystemAddressForMdlSafe and friends. There
are always security issues when using method direct, so you should
incorporate schemes to validate the buffer passed to the driver if you go
this route. The DevCon 2003 conference proceeding has a few good talks about
security issues; I believe they can be found online.

If you must handle each packet one-at-a-time, then the kernel-mode/user-mode
latency will certainly cause performance issues at high packet rates. There
is an old article Rawether.Net that talks about this a little. See:

http://www.rawether.net/support/KB06300101.htm

Good luck,

Thomas F. Divine, Windows DDK MVP
http://www.pcausa.com



> Thanks
> Vipin
>
>


 
Reply With Quote
 
Vipin
Guest
Posts: n/a

 
      06-09-2005
ok, thanks for the info.
Vipin

"Thomas F. Divine [DDK MVP]" <> wrote in message
news:...
>
> "Vipin" <> wrote in message
> news:%...
>> Hi,
>> I know that we can make use of DeviceIoControl(...) to the usermode
>> app -- driver communication. I am yet to read James's wmi mechanism also.
>>
>> Thing is I want to send the bits and bytes (the one that comes into the
>> send
>> routine) back to a user mode app.
>> I don't think using DeviceIOControl is a good way to acheive this because
>> of
>> the increased buffering being involved. I thought of logging to file and
>> then have the usermode app read from it, but that approach would be ugly.
>>
>> Is there a better, easier and cleaner way to do the communication from
>> kernel mode to user mode?
>>

> No, Read or IOCTL is the best way to pass the bytes to user-mode.
>
> If you are monitoring packets, pass a large buffer to the driver and have
> the driver fill the buffer with multiple packets. Of course, some sort of
> structure will be needed to "package" each received packet.
>
> Examine the use of direct I/O. Using this method the buffer exchanged
> between the driver and the application is not copied an extra time.
> However, the driver must do a little extra work to get a kernel-mode
> pointer to the user-allocated buffer. See MmGetSystemAddressForMdlSafe and
> friends. There are always security issues when using method direct, so you
> should incorporate schemes to validate the buffer passed to the driver if
> you go this route. The DevCon 2003 conference proceeding has a few good
> talks about security issues; I believe they can be found online.
>
> If you must handle each packet one-at-a-time, then the
> kernel-mode/user-mode latency will certainly cause performance issues at
> high packet rates. There is an old article Rawether.Net that talks about
> this a little. See:
>
> http://www.rawether.net/support/KB06300101.htm
>
> Good luck,
>
> Thomas F. Divine, Windows DDK MVP
> http://www.pcausa.com
>
>
>
>> Thanks
>> Vipin
>>
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Surface management in usermode printer driver Matt Kane Windows Vista Drivers 3 11-23-2004 03:41 PM
hooked functions in usermode printer driver Matt Kane Windows Vista Drivers 12 10-18-2004 01:37 PM
Help required in writing Upper NDIS Filter Driver for NDIS-USB GNRaj Windows Vista Drivers 2 11-13-2003 05:18 AM
Re: NDIS Mux IM Driver : NDIS Test - Incorrect number of reset events Stephan Wolf Windows Vista Drivers 0 08-26-2003 05:31 PM
Recognition of Version-3 Usermode Driver Martin Duemig Windows Vista Drivers 0 08-25-2003 11:01 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59