mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-16 02:02:53 -07:00
Also updates: - importlib-metadata-0.7 - jaraco-windows - jaraco.classes-1.5 - jaraco.collections-1.6.0 - jaraco.functools-1.20 - jaraco.structures-1.1.2 - jaraco.text-1.10.1 - jaraco.ui-1.6 - more-itertools-4.3.0 - path.py-11.5.0 - six-1.12.0
21 lines
415 B
Python
21 lines
415 B
Python
import ctypes
|
|
|
|
from .api import library
|
|
|
|
|
|
def find_lib(lib):
|
|
r"""
|
|
Find the DLL for a given library.
|
|
|
|
Accepts a string or loaded module
|
|
|
|
>>> print(find_lib('kernel32').lower())
|
|
c:\windows\system32\kernel32.dll
|
|
"""
|
|
if isinstance(lib, str):
|
|
lib = getattr(ctypes.windll, lib)
|
|
|
|
size = 1024
|
|
result = ctypes.create_unicode_buffer(size)
|
|
library.GetModuleFileName(lib._handle, result, size)
|
|
return result.value
|