Uninstalling PCIe Filter Driver

Hi,
I encounter an issue with DifxApi inside Windows Installer on XML. After uninstalling the .msi file, if the system is rebooted, the OS will attempt to load the filter driver. It will never call EvtDriverDeviceAdd(), only DriverEntry(). The issue here is that the file is missing, which results in a corrupt image: a new reboot cycle, attempt to repair, startup errors are not found, sfc.exe /scannow has no effect. This happens on Windows 10. It is unknown if the issue is present on previous Windows versions.
As a test, running “storage\filters\addfilter” WDK sample with “/remove CustomPCIeFilter” shows the following:

  • the 1st reboot calls DriverEntry()
  • the 2nd reboot does not search for a filter driver
    Since AddFilter sample and DifxApi have the same outcome, this indicates that the issue is common. Perhaps a flag inside SetupApi can tune this.
    It is possible that the INF file is “weird”, although I used the guidelines from the samples. Is there a way to prevent the OS from loading the filter driver on the 1st reboot?
    Thank you,
    Calin

What is the start type of the service in the INF? If it is not 3, you could have a stale service entry that is configured to auto load the driver no matter if it is configured on a device or not.

Hi Doron,
I have tried with both “3” = SERVICE_DEMAND_START and “0” = SERVICE_BOOT_START. There is no difference in behavior. Based on \INF\SetupApi.dev.log, the StartType is changed to the type of the service below. For PCI.INF, the StartType = 0.
Regards,
Calin

Using “sc.exe delete PCIeFilterName” works. I am adding DeleteService() API into the setup program. Thanks!