FAQ

Why? Seriously, why?

Good question. Have a look at the motivation section in the introduction.

What are actual use cases for this project?

Read the section on use cases in the introduction.

How does it work?

Have a closer look at the section describing the implementation in the introduction.

Is it secure?

No. See chapter on security.

How fast/slow is it?

It performs reasonably well. See benchmark section.

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 memsync 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()