Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-55283

IDC 5.6.0 regression: Cannot LoadLibrary DLL with dependencies in other folders

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.2
    • 5.6.1
    • ActiveX Support
    • None
    • Windows Vista and newer.
    • f922dc165c61faeba39441595cb67dcf088ee8c8 (qtactiveqt, 5.6, 16.8.2016, 5.6.2)

    Description

      Since commit "IDC: Add folder containing DLL to search path for dependencies." 824df695ad99 (https://codereview.qt-project.org/#/c/127118/, QTBUG-48586) introduced in Qt 5.6.0, idc.exe replaced use of plain ::LoadLibrary() with this function:

      static HMODULE loadLibraryQt(const QString &input)
      {
          if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA)
              return LoadLibrary((const wchar_t *)input.utf16()); // fallback for Windows XP and older
      
          // Load DLL with the folder containing the DLL temporarily added to the search path when loading dependencies
          return LoadLibraryEx((const wchar_t *)input.utf16(), NULL,
                               LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
      }
      

      The result of this is that for Windows Vista and newer %PATH% is no longer checked for dependencies - only the following paths are checked

      • [winroot]\system32
      • idc.exe application directory
      • target dll directory

      Not searching $PATH is a regression. The intention of QTBUG-48586 was just to add the target dll directory to the list of searched directories - not to remove other until that point searched directories specified in %PATH%.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            ts Thomas Sondergaard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes