(name)
| 53 | return clibname+'.dll' |
| 54 | |
| 55 | def find_library(name): |
| 56 | if name in ('c', 'm'): |
| 57 | return find_msvcrt() |
| 58 | # See MSDN for the REAL search order. |
| 59 | for directory in os.environ['PATH'].split(os.pathsep): |
| 60 | fname = os.path.join(directory, name) |
| 61 | if os.path.isfile(fname): |
| 62 | return fname |
| 63 | if fname.lower().endswith(".dll"): |
| 64 | continue |
| 65 | fname = fname + ".dll" |
| 66 | if os.path.isfile(fname): |
| 67 | return fname |
| 68 | return None |
| 69 | |
| 70 | # Listing loaded DLLs on Windows relies on the following APIs: |
| 71 | # https://learn.microsoft.com/windows/win32/api/psapi/nf-psapi-enumprocessmodules |
searching dependent graphs…