def METHOD_NAME(name):
    if name in ('c', 'm'):
        return ctypes.util.find_msvcrt()
    # See MSDN for the REAL search order.
    search_dirs = [sys._MEIPASS] + os.environ['PATH'].split(os.pathsep)
    for directory in search_dirs:
        fname = os.path.join(directory, name)
        if os.path.isfile(fname):
            return fname
        if fname.lower().endswith(".dll"):
            continue
        fname = fname + ".dll"
        if os.path.isfile(fname):
            return fname
    return None