Reference: http://docs.python.org/dev/lib/ctypes-calling-functions- with-own-custom-data-types.html According to this document, I should be able to use my own objects with ctypes, provided I have an _as_parameter_ attribute set on my object. However, this does not work properly when the foreign function's argtypes have been set. This is because the _as_parameter_ access is not done until after the argument types are checked. Attached is a patch that adds _as_parameter_ checking to the types provided by _ctypes.c so that the feature works as documented for both typed and untyped foreign functions. (Patch is against: svn rev 50859)