This is workaround a bug in ironpython implementation of ctypes. I will add link to bug report.