docs: def _resolveCtypesImports(cbinaries):
      """Completes ctypes BINARY entries for modules with their full path.
      """
      if is_unix:
          envvar = "LD_LIBRARY_PATH"
      elif is_darwin:
          envvar = "DYLD_LIBRARY_PATH"
      else:
          envvar = "PATH"
  
      def _setPaths():
          path = os.pathsep.join(PyInstaller.__pathex__)
          old = compat.getenv(envvar)
          if old is not None:
              path = os.pathsep.join((path, old))
          compat.setenv(envvar, path)
          return old
  
      def _restorePaths(old):
          if old is None:
              compat.unsetenv(envvar)
          else:
              compat.setenv(envvar, old)
  
      ret = []
  
      # Try to locate the shared library on disk. This is done by
      # executing ctypes.utile.find_library prepending ImportTracker's
      # local paths to library search paths, then replaces original values.
      old = _setPaths()
      for cbin in cbinaries:
          # Ignore annoying warnings like:
          # 'W: library kernel32.dll required via ctypes not found'
          # 'W: library coredll.dll required via ctypes not found'
          if cbin in ['coredll.dll', 'kernel32.dll']:
              continue
          ext = os.path.splitext(cbin)[1]
          # On Windows, only .dll files can be loaded.
          if os.name == "nt" and ext.lower() in [".so", ".dylib"]:
              continue
          cpath = find_library(os.path.splitext(cbin)[0])
          if is_unix:
              # CAVEAT: find_library() is not the correct function. Ctype's
              # documentation says that it is meant to resolve only the filename
              # (as a *compiler* does) not the full path. Anyway, it works well
              # enough on Windows and Mac. On Linux, we need to implement
              # more code to find out the full path.
              if cpath is None:
                  cpath = cbin
              # "man ld.so" says that we should first search LD_LIBRARY_PATH
              # and then the ldcache
              for d in compat.getenv(envvar, '').split(os.pathsep):
                  if os.path.isfile(os.path.join(d, cpath)):
                      cpath = os.path.join(d, cpath)
                      break
              else:
                  text = compat.exec_command("/sbin/ldconfig", "-p")
                  for L in text.strip().splitlines():
                      if cpath in L:
                          cpath = L.split("=>", 1)[1].strip()
                          assert os.path.isfile(cpath)
                          break
                  else:
                      cpath = None
          if cpath is None:
              logger.warn("library %s required via ctypes not found", cbin)
          else:
              ret.append((cbin, cpath, "BINARY"))
      _restorePaths(old)
      return ret