Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-9406

PATCH:SetupDiInstallClassExW fails if the INF file does not have a [ClassInstall32.nt.Services] section



    • Bug
    • Resolution: Fixed
    • Major
    • 0.4.0
    • None


      Title is not really descriptive but hope my follow explanation is:

      Battery.inf is an INF file which has a [ClassInstall32.nt] section but which lacks a [ClassInstall32.nt.Services] section.

      Battery.inf is tried to be installed via InstallSysSetupInfDevices() during the 2nd stage since it appears listed in [DeviceInfsToInstall] section of sysetup.inf.

      InstallSysSetupInfDevices() ends calling SetupDiInstallClassExW to install battery.inf.
      However, SetupDiInstallClassExW tries "forcely" to install the ClassInstall32.nt.Services section:
      /* Install .Services section */
      lstrcatW(SectionName, DotServices);
      ret = SetupInstallServicesFromInfSectionExW( hInf, SectionName, 0, hDeviceInfo, NULL, NULL, NULL);
      if (!ret) goto cleanup;

      So if the INF, as this case is, does not have a .Services section, SetupDiInstallClassExW returns FALSE (BUG!!), this FALSE is sent upwards in the call chain, making InstallSysSetupInfDevices() fail and hence 2nd stage fails with a FATAL error.

      For curious ones: Why we don't have a FATAL ERROR right now?
      Basically because this bug is hidden by another bug in SetupInstallServicesFromInfSectionExW reported in CORE-9398 Fixing SetupInstallServicesFromInfSectionExW bug has led me to hit this bug.
      (Basically right now the Reactos SetupInstallServicesFromInfSectionExW returns TRUE even if the Section does not exist, hidden the bug, while Windows counterpart fails. Testcases provided in CORE-9398)


        1. devclass.c.patch
          1 kB
        2. devclass.c.patch
          1 kB
        3. log4.txt
          28 kB

        Issue Links



              AmineKhaldi AmineKhaldi
              vicmarcal vicmarcal
              0 Vote for this issue
              2 Start watching this issue