Given that you have an application that is always running and never goes
away, which wants to load a driver which never goes away, why not simply
make the application a service existing in a LocalXxxx context? Given the
right context, the application, as a service, will have the privileges it
needs to load the driver…
Gary G. Little
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of S. Drasnin
Sent: Wednesday, June 21, 2006 2:45 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] inf files versus dynamic loading of drivers
Thanks - I didn’t know that about Windows 2000. I always thought people
have always been suffering with putting together inf files.
I think an issue with the Service Control Manager calls is they require
administrative privileges.
So, if a user logged into the PC didn’t have administrative privileges the
calls would fail.
I haven’t looked at how easy it is to get around the privilege issue, but
that seems to be the biggest issue.
(These particular apps can be run by anyone.)
That issue alone seems like a good reason to put together a null inf file.
Also, the function of the driver is such that it needs to be loaded
always. The app should always be running and should never go away. No
reason for it to be unloaded and reloaded multiple times.
Do you still disagree? (I do want to make sure I do the right thing.)
thanks very much for the input…
----- Original Message -----
From: Tim mailto:xxxxx Roberts
To: Windows System Software Devs Interest List
mailto:xxxxx
Sent: June 21, 2006 8:59 AM
Subject: Re: [ntdev] inf files versus dynamic loading of drivers
S. Drasnin wrote:
>
> I am taking over a simple driver that does simple I/O. This driver
> doesn’t use an inf file to install. Instead it has an application
> associated with it that manages it. This app actually uses Service
> Control Manager calls to install and uninstall the driver, etc.
>
> My gut feel on this is that this adds unnecessary layers of
> abstraction and more things to go wrong with all the installing and
> uninstalling going on.
>
> Just curious about what you have done…and if you had any strong
> thoughts one way or the other.
>
> I was thinking of just putting together a (null) inf file and have it
> loaded once during boot-up automatically. (I haven’t put one of these
> inf files together before, but I know there is a sample somewhere in
> the DDK.)
“Unnecessary layers of abstraction”? The service control manager calls
do almost nothing. They manipulate a few settings in the registry, and
they cause the driver to be loaded. These are not complicated and
heavyweight operations. Remember that, prior to Windows 2000, ALL
NT drivers were loaded via the service control manager. This is a
process that is well-tested and well-understood.
The advantage of SCM is that you can control the lifetime, rather than
forcing the driver to be loaded at boot and live until shutdown.
If you have a PnP event that can trigger the device, then an INF is
clearly the way to go. If not, then there is nothing wrong with using
SCM.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
—
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</mailto:xxxxx></mailto:xxxxx>