I know I may use regedit and on the
\HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\myDriver
key simply modify the ‘Start’ entry to 0 (SERVICE_BOOT_START). This
will work, but I want to know how to do it programmatically. Also, when
I
use this approach I see that the System Information tool displays:
File: \systemroot\??\c:\test\mydriver.sys
instead of
File: ??\c:\test\mydriver.sys
Does this mean that:
a) To enable my driver at boot time, is enough to copy it to the
%WINDIR%\system32 directory (instead of using a test directory like I’ve
been doing)?
b) There’s a way (what?) to enable the driver at boot-time, by adding
changes
to the driver source code? (I usually apply the \Device\myDriver and
\DosDevices\myDriver unicode strings; however, I’ve also seen
\??\myDriver
on some driver’s source code… what’s the difference, btw, between the
\DosDevices\ and \??\ strings?)
Miguel Monteiro
xxxxx@criticalsoftware.com
www.criticalsoftware.com
«Humour and love are God’s answers
to Human weaknesses»
— Original Message —
Hi,
Until now I’ve been installing/starting kernel-mode driver experiments
using local Service Control Manager (SCM) services; these allow me
to install the driver on-demand basis:
hService = CreateService (hSCM, szDriver, szDriver,
SERVICE_ALL_ACCESS,
SERVICE_KERNEL_DRIVER,
SERVICE_DEMAND_START, // On-demand
start
SERVICE_ERROR_NORMAL,
szPath,
NULL, NULL, NULL, NULL, NULL);
Now I need to install my driver at boot time. However, using
SERVICE_BOOT_START returns the “invalid parameter” error.
I’m not sure, but on NT 4 I think it was simple to change this. But on
Win2K SP1 (my driver-development environment) the
Settings>Control Panel>Administrative Tools>Services doesn’t help
much. I can see my driver at the Software Environment>Drivers on
the System Information tool, but it doesn’t help much either, as I
don’t know how to change the Start Mode field:
Name/Description: myDriver
File: ??\c:\test\mydriver.sys
Type: Kernel Driver
Started: True
Start Mode: Manual <— (I need to change this to “Boot”)
State: Running
Status: OK
Error Control: Normal
Accept Pause: False
Accept Stop: True
The idea is simply to install the driver in such a way it remains active
(being re-enabled at boot time - and though surviving reboots) until
explicitly stopped/removed (which is also convenient, of course).
Help would be appreciated.
Thanks in advance,
Miguel Monteiro
xxxxx@criticalsoftware.com
www.criticalsoftware.com
«Humour and love are God’s answers
to Human weaknesses»
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com