none
Shared use of WdfCoinstaller01009.dll by several drivers RRS feed

  • Question

  • Hi,

    We have two drivers that both use WdfCoinstaller01009.dll. Both drivers include reference to it in their Inf files, and both install this file to the Windows\System32, as per MS examples.

    We install and remove the drivers using MSI installers, that internally use DifXAPI, and include the option to cleanup the binary files after the driver is being uninstalled. That seems to cause the issue with WdfCoinstaller DLL file, as during the uninstallation it's being removed by the DifxAPI code for the first driver, and then the second driver can't be removed as the WdfCoInstaller DLL had been already removed by that time, and it's required to uninstall the second device driver.

    What is the proposed solution for this case ? How generally this case of shared DLL in driver should be handled ?

    If the file would be installed/removed by our code we could use the standard shared files reference counter, and thus never remove the WdfCoinstaller DLL unless all our drivers had been removed (that doesn't handle the third party that uses WdfCoinstaller and puts the DLL into the same location, as per MS examples) - however since the DLL is installed by DifXAPI as per Inf file  we have no control over the process, unless we decide to put the DLL into some other location.

    Thanks in advance,

    Lev Veyde.

    Monday, July 8, 2013 10:10 AM

Answers

  • You can remove the driver packages from the system (e.g. SetupUninstallOEMInf if you are writing your own uninstaller, or DriverPackageUninstall for DIFx).  However, any files that were copied out due to the driver being installed on a device should not be touched.  They were put there by the operating system and the choice to clean them up or not should be made by the operating system.  Removing those files can cause problems as you have seen with WdfCoInstaller.  In fact, for recent releases, the delete files flag of DriverPackageUninstall is ignored:

    http://msdn.microsoft.com/en-us/windows/hardware/ff553587(v=vs.85).aspx

    Note   Starting with Windows 7, the DRIVER_PACKAGE_DELETE_FILES flag is ignored by DriverPackageUninstall. Binary files, which were copied to a system when a driver package was installed, can no longer be deleted by calling this function.

    Monday, July 8, 2013 4:37 PM
  • Once you install the coinstaller, do not uninstall it. You have no way to track all of the dependencies on it

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, July 8, 2013 1:03 PM

All replies

  • Once you install the coinstaller, do not uninstall it. You have no way to track all of the dependencies on it

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, July 8, 2013 1:03 PM
  • Once you install the coinstaller, do not uninstall it. You have no way to track all of the dependencies on it

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    So all drivers that depend on WdfCoInstaller are a one way street - you can never uninstall them?

    That doesn't sound reasonable - especially, as removing the WdfCoInstaller DLL doesn't really removes the KMDF driver that it installs, as far as I understand.

    The main issue here is how to track the shared DLL itself (WdfCoInstaller), or any other binary that is shared by a number of drivers, for that matter.

    Monday, July 8, 2013 3:41 PM
  • You can remove the driver packages from the system (e.g. SetupUninstallOEMInf if you are writing your own uninstaller, or DriverPackageUninstall for DIFx).  However, any files that were copied out due to the driver being installed on a device should not be touched.  They were put there by the operating system and the choice to clean them up or not should be made by the operating system.  Removing those files can cause problems as you have seen with WdfCoInstaller.  In fact, for recent releases, the delete files flag of DriverPackageUninstall is ignored:

    http://msdn.microsoft.com/en-us/windows/hardware/ff553587(v=vs.85).aspx

    Note   Starting with Windows 7, the DRIVER_PACKAGE_DELETE_FILES flag is ignored by DriverPackageUninstall. Binary files, which were copied to a system when a driver package was installed, can no longer be deleted by calling this function.

    Monday, July 8, 2013 4:37 PM
  • You can remove the driver packages from the system (e.g. SetupUninstallOEMInf if you are writing your own uninstaller, or DriverPackageUninstall for DIFx).  However, any files that were copied out due to the driver being installed on a device should not be touched.  They were put there by the operating system and the choice to clean them up or not should be made by the operating system.  Removing those files can cause problems as you have seen with WdfCoInstaller.  In fact, for recent releases, the delete files flag of DriverPackageUninstall is ignored:

    http://msdn.microsoft.com/en-us/windows/hardware/ff553587(v=vs.85).aspx

    Note   Starting with Windows 7, the DRIVER_PACKAGE_DELETE_FILES flag is ignored by DriverPackageUninstall. Binary files, which were copied to a system when a driver package was installed, can no longer be deleted by calling this function.

    Thanks Jason,

    The issue we have is on XP SP3, and leaving the files behind unfortunately is not an option - as it causes other strange behaviours i.e. after the uninstall if the user manually searches for new hardware then the device is re-installed, however in a faulty way, with just the .sys driver appearing for the device (no coinstaller) and no other info.

    Thanks in advance,

    Lev Veyde.

    Tuesday, July 9, 2013 9:35 PM