How does it work?¶
Have a closer look at the section describing the implementation in the introduction.
Can it handle structures?¶
Yes, in principle. Though, limitations apply. See next question for details.
Can it handle pointers?¶
Yes and no.
Pointers to simple C data types (int, float, etc.) used as function parameters or within structures can be handled just fine.
Pointers to arbitrary data structures can be handled if another parameter of
the call contains the length of the memory section the pointer is pointing to.
zugbruecke uses a special
memsync protocol for indicating which memory
sections must be kept in sync between the Unix and the Wine side of the code.
If run on Windows, the regular ctypes will just ignore any
directive in the code.
Pointers returned by a DLL pointing to memory allocated by the DLL are currently not handled.
Is it thread-safe?¶
Probably (yes). More extensive tests are required.
If you want to be on the safe side, start one zugbruecke session per thread in your code manually. You can do this as follows:
from zugbruecke import session # start new thread or process (multiprocessing) - then, inside, do: a = session() # now you can do stuff like kernel32 = a.load_library('kernel32', 'cdll') # do not forget to terminate the session (i.e. the Windows Python interpreter) a.terminate()