Need some help with drivers

Hi,

I want to print some messages(strings) from driver to the application whenever application calls it. Is there any function to do this ?

Also is there an easy way to pass an integer type from kernel mode to user mode and from User mode to kernel mode.

-Brett.

Like DebugView,right ?

I remember some topic talking about putting some driver message to application in OSR. But i forget the title.Search on it.

Use IoCtls to have the application send data to the driver (actually the
specific device opened by the application). Use another IoCtl, or several,
that the driver pends until it has something to say. Look at the IOCTL
example in the WDK 7600.1. Using strings is usually not advisable. Use
codes and have the appropriate text in the application so it can be
multi-language enabled. You really don’t want to do this in the driver.
Until you get your string code in a driver you will see lots of BSODs and it
can be an attack vector to BSOD the system.

To be successful in writing drivers you have to eliminate almost any mindset
developed when doing applications. Most applications are single-threaded
using one CPU as assigned by the OS. Drivers must be able to handle
multiple requests at the same time and don’t just put them in a single queue
and grab them out as you might do in an application. A design like that may
be appropriate but almost never.

wrote in message news:xxxxx@ntdev…

Hi,

I want to print some messages(strings) from driver to the application
whenever application calls it. Is there any function to do this ?

Also is there an easy way to pass an integer type from kernel mode to user
mode and from User mode to kernel mode.

-Brett.

@Craig Thank you very much. So the only way to send codes is using IOCTLS using DeviceIoControl fn right ?

xxxxx@gmail.com wrote:

@Craig Thank you very much. So the only way to send codes is using IOCTLS using DeviceIoControl fn right ?

Yes. The only ways to communicate with a driver are ReadFile,
WriteFile, and DeviceIoControl, and in all but a few specific types of
devices, DeviceIoControl is the one you want.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.