Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8316421

libjava should load shell32.dll eagerly

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 22
    • None
    • core-libs
    • b17
    • windows

    Description

      Java.dll is delay-loading shell32.dll. Delay-loading should only be used on libraries that might never be used, to avoid loading them when they are not needed.

      Java.dll is using the following 2 imports from shell32.dll:
      - SHGetKnownFolderPath
      - SHGetFolderPathW

      These functions are used by getHomeFromShell32, which is always used to populate user.home property early during startup.

      A bit of archeology:
      - Delay-loading was introduced in JDK-7030249. When it was implemented, user.home was populated with values taken from the Windows registry, and getHomeFromShell32 was only called if the registry-based method failed.
      - Since JDK-6519127, we are always using getHomeFromShell32 to retrieve user.home. We are still delay-loading shell32, and using try/except to handle missing imports on older shell32 versions (Win2000/XP/2003)

      The imports are guaranteed to be available on anything more recent than Vista, and we no longer support any of the older Windows versions.

      Attachments

        Issue Links

          Activity

            People

              djelinski Daniel Jelinski
              djelinski Daniel Jelinski
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: