Filter Driver Installation and position/class/etc confusion

Hi. I’m working on a disk filter driver (like many others) and the things I read keep me going around in circles. It’s a simple raid driver, designed to duplicate IRPs to multiple disks. It’s in the loadordergroup “PnP filter” and class “Diskdrive”.

I don’t understand the install process for a driver; there are too many ways. API calls like inDIFxAPI, SetupCopyOEMInf, pnputil and enum.exe (toaster example), “rundll32 setupapi.dll,InstallHinfSection”, right click install, and probably more I don’t know about.

I can install my driver using either right click install or rundll32.exe setupapi methods and the DefaultInstallSection of the inf file (though it ignores my request to suppress reboot mode in the former). The service works after the reboot.

But I read that you’re not supposed to install plug and play devices with the Default section (something about not properly registering, signing, etc), and that the proper method is to use pnputil.exe. So I rewrote my inf file without a default install section. Then I was able to inf2cat it and install with pnputil.exe. The only problem is that now the service doesn’t start, because I assume I have to install a device that will trigger windows to recognize. But that brings another problem, I don’t want to attach to a specific device.

So I’m confused.

  1. If it’s not a specific device driver, is it even PnP?
  2. If it isn’t PnP, what is it? A class driver? Does a class driver make sense in “PnP Filter” ?
  3. Does that mean I should be using the inf file after all? If so, are there additional steps I should be taking to properly register?
  4. Do I need to change DefaultInstall to ClassInstall32? I read that this is supposed to be only if I’m creating a new class? What class should this be?
  5. Do I have to be concerned about this “legacy” install method for future support?
  6. This is supposed to be raid, so how can I ensure the PnP stack puts my driver in before any writes are sent?

Thanks,

After some reading and a long period of searching I found this, which answers some of my questions:

http://www.osronline.com/DDKx/install/inf-format_33ea.htm

“DefaultInstall sections are not generally used for device installations. More typically, they are used for the installation of class filter drivers, class co-installers, file system filters, and kernel driver services that are not associated with a device node.”

So then my conclusions are as follows:

  1. pnputil is for setting up actual connectable devices that need to be recognized at the time of “plug”
  2. DefaultInstall is for Class filter drivers. DDInstall is for a specific device, similar to 1, but also connects the hardware. And class32 is for creating a new class.
  3. “PnP” is a rather loose concept that has more to do with windows internal device handling naming conventions than anything else

I would still like to know how to specify a load (and run) order before the primary disk (disk.sys?) If it place it before partMgr would that be sufficient?