Basic questions on driver installation.

Hello experts,

I was looking into IOCTL example given in WDK. I looked into how to load a
driver and I have following doubts.
1.) Is this a common way to load any driver?
2.) I have seen, to install few driver we need INF file, can’t we install
them this way?
3.) When I am running that installer it is creating regentry in
HKLM.…\Services\SIOCTL that is fine but few registry entries are
getting created like Start,ErrorControl,Type,ImagePath,…etc. Who is
creating those registries? One register is having value
“Root\LEGACY_SIOCTL\0000”. Who is deciding whether this is a legacy driver
or not?

Thanks and regards
/sarbojit

Ravi Gupta wrote:

I was looking into IOCTL example given in WDK. I looked into how to
load a driver and I have following doubts.

The IOCTL example is a “legacy” driver, leftover from the original
driver model in Windows NT 3, where drivers were loaded individually by
name, instead of being automatically loaded by plug-and-play. It is a
simpler model, but it does not apply to drivers for real hardware.

1.) Is this a common way to load any driver?

It is the way you load legacy drivers.

2.) I have seen, to install few driver we need INF file, can’t we
install them this way?

PnP drivers must be installed through an INF file. Legacy drivers are
not. (Well, it is possible to use an INF with [DefaultInstall] to
install a legacy driver, but it’s just as easy to do it with an
application, or even a batch file and the “sc” command.)

3.) When I am running that installer it is creating regentry in
HKLM.…\Services\SIOCTL that is fine but few registry entries are
getting created like Start,ErrorControl,Type,ImagePath,…etc. Who is
creating those registries? One register is having value
“Root\LEGACY_SIOCTL\0000”. Who is deciding whether this is a legacy
driver or not?

The Service Manager creates these entries when you call CreateService.
All drivers need the Services key, to map a driver name to a driver file
name. In the case of a PnP driver, the AddService entry ends up calling
CreateService to create these entries.

A legacy driver is one that does not register an AddDevice callback in
its DriverEntry. Without that, it is a non-PnP driver, and needs to
have a Root\LEGACY devnode created for it.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

This IOCTL driver is what is known as a ‘legacy’ driver. In particular, it
does not support PNP, so you don’t need an INF to install it.

I imagine that you could install it with an INF, but that would be somewhat
masochistic.

No, most drivers do not load this way. Non-legacy drivers cannot be loaded
this way, and some legacy drivers just use a registry ini file that creates
the appropriate service entry, or use something like the OSR loader, or use
‘sc.’

Those entries are created by the Service Control Manager.

Good luck,

mm

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ravi Gupta
Sent: Thursday, May 12, 2011 2:57 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Basic questions on driver installation.

Hello experts,

I was looking into IOCTL example given in WDK. I looked into how to load a
driver and I have following doubts.
1.) Is this a common way to load any driver?
2.) I have seen, to install few driver we need INF file, can’t we install
them this way?
3.) When I am running that installer it is creating regentry in
HKLM.…\Services\SIOCTL that is fine but few registry entries are
getting created like Start,ErrorControl,Type,ImagePath,…etc. Who is
creating those registries? One register is having value
“Root\LEGACY_SIOCTL\0000”. Who is deciding whether this is a legacy driver
or not?

Thanks and regards
/sarbojit

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Thanks a lot Tim and Martin.

On Fri, May 13, 2011 at 12:39 AM, Martin O’Brien <
xxxxx@gmail.com> wrote:

This IOCTL driver is what is known as a ?legacy? driver. In particular,
it does not support PNP, so you don?t need an INF to install it.

I imagine that you could install it with an INF, but that would be somewhat
masochistic.

No, most drivers do not load this way. Non-legacy drivers cannot be loaded
this way, and some legacy drivers just use a registry ini file that creates
the appropriate service entry, or use something like the OSR loader, or use
?sc.?

Those entries are created by the Service Control Manager.

Good luck,

mm

*From:* xxxxx@lists.osr.com [mailto:
xxxxx@lists.osr.com] *On Behalf Of *Ravi Gupta
*Sent:* Thursday, May 12, 2011 2:57 PM
*To:* Windows System Software Devs Interest List
*Subject:* [ntdev] Basic questions on driver installation.

Hello experts,

I was looking into IOCTL example given in WDK. I looked into how to load a
driver and I have following doubts.
1.) Is this a common way to load any driver?
2.) I have seen, to install few driver we need INF file, can’t we install
them this way?
3.) When I am running that installer it is creating regentry in
HKLM.…\Services\SIOCTL that is fine but few registry entries are
getting created like Start,ErrorControl,Type,ImagePath,…etc. Who is
creating those registries? One register is having value
“Root\LEGACY_SIOCTL\0000”. Who is deciding whether this is a legacy driver
or not?

Thanks and regards
/sarbojit

— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and
other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

> have a Root\LEGACY devnode created for it.

BTW, Tim, do you know the purpose of this registry key? I think it is volatile.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Maxim S. Shatskih wrote:

> have a Root\LEGACY devnode created for it.
BTW, Tim, do you know the purpose of this registry key? I think it is volatile.

It’s not volatile in the usual registry sense of the word, because it
survives a reboot.

I assume that, somewhere in the kernel, there is some entity that wants
each and every driver (including legacy drivers) to have a devnode that
maps to a key in the Enum tree.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.