Setting a service registry key at install time.

Hi folks,

Probably a simple query here, but I can’t quite seem to find an elegant
way to do what I want.

When my install app installs our drivers, it installs a bus driver,
followed by various child drivers. All of these are PnP devices, and
hence use UpdateDriverForPlugAndPlayDevices or SetupCopyOEMInf to
install and/or update the drivers for the device.

However, in some cases, I want to be able to specify that the install
app performs a “test mode” install. In such cases, it will install more
drivers than the standard install. However, it also needs to be able to
inform the bus driver to create more PDO’s for the child devices. Since
“test mode” is invoked for services (running a test version of the
drivers), I suspect what I want to do is to put a registry value in
HKLM\System\Services<our main device service>.

The problem is - how to do this cleanly? The registry key needs to be
present before the bus driver starts up, so that it creates the
appropriate child devices, but I don’t want to hack about with creating
keys in that part of the registry manually, especially if it’s a
first-time install and the specified branch of the registry doesn’t
already exist.

I’ve taken a look at QueryServiceConfig, SetServiceConfig, & also
Create/Open/Delete/ControlService functions, but can’t find a way of
cleanly doing what I want without second guessing what the PnP manager
will do with the installs.

Any ideas?

MH.

This email and any attachments is confidential, may be legally privileged and is intended for the use of the addressee only. If you are not the intended recipient, please note that any use, disclosure, printing or copying of this email is strictly prohibited and may be unlawful. If received in error, please delete this email and any attachments and confirm this to the sender.

Have a 2nd INF for the test install. The 2nd INF can add the registry entries in its addreg section… for instance, from %windir%\inf\keyboard.inf

[STANDARD_AddReg.HW]
. . .
; global to i8042prt.sys (affects both keyboard and mouse)
HKLM,“SYSTEM\CurrentControlSet\Services\i8042prt\Parameters”,“PollingIterations”,0x00010003,12000

d


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Martin C Harvey
Sent: Thursday, April 14, 2005 3:21 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Setting a service registry key at install time.

Hi folks,
?
Probably a simple query here, but I can’t quite seem to find an elegant way to do what I want.
?
When my install app installs our drivers, it installs a bus driver, followed by various child drivers. All of these are PnP devices, and hence use UpdateDriverForPlugAndPlayDevices or SetupCopyOEMInf to install and/or update the drivers for the device.
?
However, in some cases, I want to be able to specify that the install app performs a “test mode” install. In such cases, it will install more drivers than the standard install. However, it also needs to be able to inform the bus driver to create more PDO’s for the child devices. Since “test mode” is invoked for services (running a test version of the drivers), I suspect what I want to do is to put a registry value in HKLM\System\Services<our main device service>.
?
The problem is - how to do this cleanly? The registry key needs to be present before the bus driver starts up, so that it creates the appropriate child devices, but I don’t want to hack about with creating keys in that part of the registry manually, especially if it’s a first-time install and the specified branch of the registry doesn’t already exist.
?
I’ve taken a look at QueryServiceConfig, SetServiceConfig, & also Create/Open/Delete/ControlService functions, but can’t find a way of cleanly doing what I want without second guessing what the PnP manager will do with the installs.
?
Any ideas?
?
MH.

This email and any attachments is confidential, may be legally privileged and is intended for the use of the addressee only. If you are not the intended recipient, please note that any use, disclosure, printing or copying of this email is strictly prohibited and may be unlawful. If received in error, please delete this email and any attachments and confirm this to the sender.

Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com