Hi all,
I’m maintaining a PCI card driver (mbgclock) which works well if one of the PCI cards manufactured by our company is installed. In this case the mbgclock driver is loaded automatically, as expected.
Now I have a new task where existing applications should be able to use our own API calls even if none of of our own cards is installed, but instead there’s some 3rd party PCI card installed which provides a similar functionality. Of course the 3rd party PCI card has its own driver, which is loaded automatically, and the 3rd party driver exports some functions at the kernel level which could be imported and called by my own mbgclock driver to access the 3rd party device.
I know this sounds strange at the first glance, but the goal is to be able to use existing user space applications without having to modify or recompile them.
I also know it would be possible to to this in the user space DLL that implements my API functions, but it would be hard to have each individual API function distinguish from the device handle if the call is related to a “native” or a 3rd party device.
At the kernel level it would be easy to distinguish this by using a simple flag in the device’s private data, so my IOCTL handler could simply check that flag, and either access the own PCI card directly, or access the 3rd party driver via the 3rd party API functions that have been imported at driver load time.
Usually our mbgclock driver would be loaded if the kernel detects a supported hardware device, but if only a 3rd party device is installed our driver is not loaded automatically, and thus is unable to import the 3rd party API calls and provide the required functionality.
So the problem I’m seeing is to find a way to “force load” my own driver in the absence of any of our own PCI cards, so that it could check if it can import the 3rd party driver’s API calls, and stay loaded if this is the case.
On Linux I would simply do a “modprobe mbgclock” command, and I remember that on old Windows NT without PnP support it was possible to start (load) or stop (unload) a kernel service/module from the command line to let it check if a supported device was detected.
Anybody knows a way to force load a kernel driver on current PnP Windows systems?
Thanks,
Martin