none
how to restore inconsistency between the INF fie, the driver store catalog, and the driver in the driver store RRS feed

  • Question

  • the issue platform is Windows 8.1 x86 and x64

    my install steps are: (works for all win7 ~ 8.1)

    1. SetupCopyOEMInf
    2. UpdateDriverForPlugAndPlayDevices

    and the issue uninstall steps: (proved in windows 8.1, while works great under both win7 and 8.0)

    1. SetupDiCallClassInstaller (is the key point)
    2. Deleting a Driver Package from the Driver Store
    3. Deleting the Binary Files of the Installed Driver (only in %windir%\system32\drivers)

    the problem is after the above 3 steps completed, the device still available in Device Manager (only for windows 8.1), and when I deleted the %windir%\System32\DriverStore\FileRepository\<prefix>* directories manually, the device indeed become unavailable in Device manager, so I think my operation is the solution, which oppositely is totally wrong, according to http://msdn.microsoft.com/en-us/library/windows/hardware/ff546200(v=vs.85).aspx

    so now when I tried to install the driver again, it won't success any longer, maybe it's the inconsistency  between INF files and binary files, according to the post mentioned above; even if make the manually-deleted directories again.

    so, how can I restore the consistency?

    Thanks in advance

    Friday, January 17, 2014 2:16 PM

Answers

  • I'm wondering why you choose these API's when the DifxAPI were designed to do exactly what you wanted to do?  Take a look at DriverPackageInstall and DriverPackageUninstall which are simpler and will do the correct work for uninstall.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    • Marked as answer by micyng Friday, January 17, 2014 3:06 PM
    Friday, January 17, 2014 2:22 PM

All replies

  • I'm wondering why you choose these API's when the DifxAPI were designed to do exactly what you wanted to do?  Take a look at DriverPackageInstall and DriverPackageUninstall which are simpler and will do the correct work for uninstall.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    • Marked as answer by micyng Friday, January 17, 2014 3:06 PM
    Friday, January 17, 2014 2:22 PM
  • actually I have tried to use DifxApi first, but can not compile the sample codes and can not find where DPInst is :(

    I just realized I need to install WDK 8.1 also, although have visual studio 2013 installed in windows 8.1, trapped by documents from micro$oft 

    and I have just tried to use Dfiapi to repair inf files, and ... it failed, with error messages:

    TEST: installing driver package.
    LOG Event: 1, ENTER:  DriverPackageInstallW
    LOG Event: 1, RETURN: DriverPackageInstallW  (0x3)
    ERROR: failed with error code 0x3

    Friday, January 17, 2014 2:48 PM
  • You definitely need the WDK installed, and verify that the VS finds it by looking for the Driver menu which should be added.  I have not had a problem with building install programs with DifxAPI with the WDK.

    The error you are getting is the path is not found.  How are you specifiying the path to the INF in your code, take a look at http://msdn.microsoft.com/en-us/library/windows/hardware/ff552316(v=vs.85).aspx and the referenced pages off of that and be sure you have a valid path.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Friday, January 17, 2014 2:55 PM
  • yes, indeed

    I was trapped by documents from m$, who said WDK 8.1 has included in VS2013, and indeed those setupapi calls can be compiled without explicit WDK 8.1 installed, and so I think it is, so...

    Thanks Don

    Friday, January 17, 2014 3:05 PM
  • Please post the URL which says the wdk is automatically included. Setupapi functions are user mode, as such, are included in the SDK which vs does include.

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

    Friday, January 17, 2014 3:29 PM
  • maybe it's the http://msdn.microsoft.com/en-us/library/windows/hardware/dn308552(v=vs.85).aspx confused me

    "Windows Driver Kit (WDK) 8.1 is integrated into Microsoft Visual Studio 2013 (Professional, Premium, and Ultimate) to provide you with a complete set of tools to develop, build, package, test, and debug drivers."

    Friday, January 17, 2014 3:55 PM
  • the integration in this sentence is trying to say that the WDK integrates into VS, not that VS ships with the WDK integrated into it.

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

    • Proposed as answer by Quad5Ny Monday, May 4, 2015 12:58 PM
    • Unproposed as answer by Quad5Ny Monday, May 4, 2015 12:58 PM
    Saturday, January 18, 2014 7:45 AM