Hello,
I just completed my driver for virtual device and have some questions about PNP manager and driver loading in general and how it may apply to my virtual joystick device (it just a driver for no tangibale hardware):
The PNP manager enumerates all hardware and loads corresponding drivers but what if my driver is not for real hardware, it just simply a virtual driver. Obviously, then PNP manager will not that driver unless I add it manually via ‘Add Hardware’ wizzard. Is my understanding correct on this? Assuming that virtual driver was added using the ‘Add Hardware’ wizzard will now the system load the driver every time it starts up until the virtual driver is removed?
I’ve seen you can load the driver as a windows service;- what is the difference between loading a driver as a service and installing it via ‘Add Hardware’ wizzard?
Aside from the installation mode/start-up mode, what other differences are there? For example, if my driver launches as windows service will it still operate in kernel mode and be able to access the kernel freely? Will it behave exactly like a windows driver that is installed in Windows?
The OSR driver load tool provided on this site to start/stop the driver, is that using windows service technique?
Thanks again for great support.
xxxxx@hotmail.com wrote:
The PNP manager enumerates all hardware and loads corresponding drivers but what if my driver is not for real hardware, it just simply a virtual driver. Obviously, then PNP manager will not that driver unless I add it manually via ‘Add Hardware’ wizzard. Is my understanding correct on this? Assuming that virtual driver was added using the ‘Add Hardware’ wizzard will now the system load the driver every time it starts up until the virtual driver is removed?
If you put your device in the “Root” or “SW” bus, then once the device
is in the registry, it will persist. Those buses both have special
drivers that enumerate all of the device nodes in their registry keys at
boot time, just like a PCI or USB bus. If you use a custom bus, then
you have to make the nodes appear yourself.
You don’t have to use Add Hardware, however. You can use “devcon
install” to create the device node, or you can steal the code from
“devcon install” and put it in your own installer.
I’ve seen you can load the driver as a windows service;- what is the difference between loading a driver as a service and installing it via ‘Add Hardware’ wizzard?
Aside from the installation mode/start-up mode, what other differences are there? For example, if my driver launches as windows service will it still operate in kernel mode and be able to access the kernel freely? Will it behave exactly like a windows driver that is installed in Windows?
The “driver as service” thing is called a “legacy driver”. Originally,
this was the way ALL NT drivers were loaded. Legacy drivers don’t get
to participate in the plug-and-play world. There is no difference in
functionality.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
So if I install my virtual driver using devcon or using the ‘Add Hardware’ wizard these will only be available only for current user session and be gone when the system reboots (assuming I don’t do anything special)?
If you put your device in the “Root” or “SW” bus, then once the device
is in the registry, it will persist.
Is that on installation that I do this?
I haven’t stated this in my orginal post but my goal is basically to have the virtual driver installed once by the admin and be availalbe for all users when the logg-in.
xxxxx@hotmail.com wrote:
So if I install my virtual driver using devcon or using the ‘Add Hardware’ wizard these will only be available only for current user session and be gone when the system reboots (assuming I don’t do anything special)?
It depends on which bus you install it under. What is the device ID you
match in your INF?
> If you put your device in the “Root” or “SW” bus, then once the device is in the registry, it will persist.
Is that on installation that I do this?
That’s where I’d do it. That’s what triggers the loading of the driver.
I haven’t stated this in my orginal post but my goal is basically to have the virtual driver installed once by the admin and be availalbe for all users when the logg-in.
If you don’t need plug-and-play services, you might as well write a
legacy driver. Then, you just control it with the Services control
panel app (or the “sc” command), and these kinds of questions vanish.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
>It depends on which bus you install it under. What is the device ID you
match in your INF?
I haven’t done the INF file but basically it HID class mini-driver that runs under the HID class driver (it is actually implemented as filter do to KMDF requirements).
I already implemented my virtual joystick driver as PNP driver. All it does - it is controlled by the user app via DeviceIoControl(), and converts received joystick state to HID reports.
I was basically thinking to write the simplest INF file as possible and have it installed simplest way possible.
I apoligize but I know so little about the installation process and learning it as I go.
> The PNP manager enumerates all hardware and loads corresponding drivers but what if my driver is not for real
hardware, it just simply a virtual driver. Obviously, then PNP manager will not that driver unless I add it manually via
‘Add Hardware’ wizzard. Is my understanding correct on this?
Yes.
Assuming that virtual driver was added using the ‘Add Hardware’ wizzard will now the system load the driver every
time it starts up until the virtual driver is removed?
Yes, until removed or disabled.
I’ve seen you can load the driver as a windows service;- what is the difference between loading a driver as a
service and installing it via ‘Add Hardware’ wizzard?
Loading as a service is used for non-PnP drivers.
Aside from the installation mode/start-up mode, what other differences are there? For example, if my driver
launches as windows service will it still operate in kernel mode and be able to access the kernel freely? Will it
behave exactly like a windows driver that is installed in Windows?
Yes. But note that some features of Windows kernel require PnP PDOs, and non-PnP driver will not be able to create them.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
> So if I install my virtual driver using devcon or using the ‘Add Hardware’ wizard these will only be available only for
current user session and be gone when the system reboots (assuming I don’t do anything special)?
No, it will be persistent for all users.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
Thank you so much for super support!