Skip to content Skip to sidebar Skip to footer

Passing A File Descriptor To A C Library Function Through Ctypes On Windows

I am trying to pass a file descriptor through ctypes, to a C function where writes are performed on the fd. On linux it works. On windows it doesn't and I don't understand why (I

Solution 1:

Windows doesn't use file descriptions like Unix does, so I'm hypothesizing that file descriptors are emulated by the C runtime. If you are using two different C runtimes (for example, if your EXE and DLL are compiled by different compilers, or with the same compiler but with different options), then each runtime will have its own "file descriptor emulation" and you can't pass a descriptor from one to the other.


Post a Comment for "Passing A File Descriptor To A C Library Function Through Ctypes On Windows"