Tech Support > Microsoft Windows > Drivers > Get service from a user mode application/ service
Get service from a user mode application/ service
Posted by kuasha on July 25th, 2007


I am doing the following to get service from a user mode service application:

From user mode I send an IOCTRL request to driver. Driver keeps that IRP
pending. When the driver needs a service from the application it completes
that IRP with service description in application supplied output buffer. When
the user mode application found the IOCTL completed by driver it looks at the
buffer for predefined service request type and perporm the operation and
sends the result using another IOCTL request.

At any moment the driver has a user IOCTL pending. The application uses a
separate thread to do it.

How can I improve the performance?

--
--
Sincerely,
Maruf Maniruzzaman,
Software Engineer,
KAZ Software Limited,
Dhaka, Bangladesh.
http://www.kaz.com.bd
http://www.kuashaonline.com

Posted by kuasha on July 25th, 2007


Is it possible to use KEVENT object for event noyification portable to all
OSes?
--
--
Sincerely,
Maruf Maniruzzaman,
Software Engineer,
KAZ Software Limited,
Dhaka, Bangladesh.
http://www.kaz.com.bd
http://www.kuashaonline.com



"kuasha" wrote:

Posted by kuasha on July 25th, 2007


Get the answer:

http://www.microsoft.com/whdc/driver...M-UMGuide.mspx

--
--
Sincerely,
Maruf Maniruzzaman,
Software Engineer,
KAZ Software Limited,
Dhaka, Bangladesh.
http://www.kaz.com.bd
http://www.kuashaonline.com



"kuasha" wrote:

Posted by Don Burn on July 25th, 2007


Do not use EVENT's by the time you do it right, you will decrease
performance. The typical problem here is that you need more than one
request at a time, or that your handling in the service is too slow. For
concurrent requests, have the application use overlapped I/O and send a
bunch of IRP's to the driver. For faster response on the application end,
look at completion ports in the SDK.

Every time I have been asked to fix (or speed up) and event based
interface, I have first junked the events and found that I got a 10 to 30%
speed increase by good development of the IOCTL approach. Also, I have in
all these cases, been able to point out the the original event based
solutuon had logic holes that would cause problems. Finally, I can show
that there is a heck of a lot less code with IOCTL than wth doing event's
correctly.


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply


"kuasha" <kuasha@discussions.microsoft.com> wrote in message
newsAC81FFE-DD2B-42AF-93D1-B2AB69B452DA@microsoft.com...


Posted by Maxim S. Shatskih on July 27th, 2007


- associate an IO completion port with the file handle
- allocate lots of data buffers, each with OVERLAPPED structure - I would
allocate 1 large chunk by VirtualAlloc and then subdivide it, all OVERLAPPED at
its tail, all page-aligned buffers at its start
- send each of the buffers to the driver using DeviceIoControl
- GetQueuedCompletionStatus will return you the next driver's request, you can
use several threads to wait on GetQueuedCompletionStatus
- after you're done with the driver's request, either resubmit the buffer to
DeviceIoControl or free it
- design the heuristic of how many active buffers will you have

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com