"Asaf Shelly" <***@Shelly.co.il> wrote in message news:2CEB94A2-FFAA-45B9-93E8-***@microsoft.com...
..........
Post by Asaf ShellyWhat I am looking for is not a solution to the problem, I am looking for a
way to isolate the rest of the driver from the 'stupid user'.
Not sure if I completely understand this statement, but maybe you need
a better interface concept.
See http://www.osronline.com/showThread.cfm?link=188211
message #26
"you must never, ever, not even once, think that ReadFile, WriteFile, and/or
DeviceIoControl
are the *user visible* interfaces to your driver. Do this, and it warps
your thinking
into trying to make this low-level interface "easy to use". No, decide what
you want the upper-level user interface to look like, to the application
programmer. Then writer a library that translates that into low-level calls
like DeviceIoControl. ...
There is a line between the effort we expend in kernel space and the effort
we expend in user space to make a piece of hardware work. The user space
gets split between what the application writer *has* to see, and what you
can write as a library. The smaller the kernel piece, the faster you get it
done, the more robust it is likely to be. .............
So you design the API *first*, then figure out how you are going to map it
to
low-level calls, then figure out how you are going to get the performance
you need "
( Joseph Newcomer, co-author of the "Developing Windows NT Device Drivers"
book)
IMHO, "stupid users" is a misnomer. Our users are not stupid at all ;)
Instead, how about "users that don't want to care about boring
details" ?
They are not going to access low level interfaces at all, exactly because
these are encumbered with lot of boring details.
These folks should use higher level, more robust interfaces, like message
queues,
and automatic memory management.
Regards,
--pa