N
N
Nick V2015-12-27 17:00:55
linux
Nick V, 2015-12-27 17:00:55

Error when working with dll (NameError: name 'WinDLL' is not defined) how to overcome this?

Good day. There is a dll library and a wrapper for it written in python. The bottom line is that when running scripts using this wrapper, an error appears. The scripts run on a machine with ElementaryOS Luna, Python 3.5.0.

/home/user/Envs/test/bin/python3.5 /home/user/PycharmProjects/StealthScripts/py_stealth.py
Traceback (most recent call last):
  File "/home/user/PycharmProjects/StealthScripts/py_stealth.py", line 35, in <module>
    stealth_dll = WinDLL('/home/user/Stealth/Script.dll')
NameError: name 'WinDLL' is not defined

Process finished with exit code 1

While achieved start in such a way. I installed python 3.4.2 in wine and run the script through it. It turns out like this:
/home/user/.wine/drive_c/Python34/python.exe /home/user/PycharmProjects/StealthScripts/py_stealth.py
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
fixme:msvcrt:__clean_type_info_names_internal (0x1d1b51cc) stub
fixme:msvcrt:__clean_type_info_names_internal (0x1e290f6c) stub

Process finished with exit code 0

Is it possible to somehow do without the python from Vine? If I use it, then step-by-step debugging for some reason does not work.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nirvimel, 2015-12-27
@half-life

The fact is that ctypes, which deals with loading dynamic libraries, is not completely cross-platform. As the documentation says , the WinDLL function only exists in ctypes under Windows. From Python on Linux, you will not be able to load a dynamic library compiled on Windows.

C
Che_Bu_Rashka, 2015-12-28
@Che_Bu_Rashka

Does this dll work with some kind of hardware?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question