ctypes.string_at()

ctypes.string_at(address, size=-1) This function returns the C string starting at memory address address as a bytes object. If size is specified, it is used as size, otherwise the string is assumed to be zero-terminated.

ctypes.sizeof()

ctypes.sizeof(obj_or_type) Returns the size in bytes of a ctypes type or instance memory buffer. Does the same as the C sizeof operator.

ctypes.set_last_error()

ctypes.set_last_error(value) Windows only: set the current value of the ctypes-private copy of the system LastError variable in the calling thread to value and return the previous value.

ctypes.set_errno()

ctypes.set_errno(value) Set the current value of the ctypes-private copy of the system errno variable in the calling thread to value and return the previous value.

ctypes.resize()

ctypes.resize(obj, size) This function resizes the internal memory buffer of obj, which must be an instance of a ctypes type. It is not possible to make the buffer smaller than the native size of the objects type, as given by sizeof(type(obj)), but it is possible to enlarge the buffer.

ctypes.py_object

class ctypes.py_object Represents the C PyObject * datatype. Calling this without an argument creates a NULL PyObject * pointer.

ctypes.PYFUNCTYPE()

ctypes.PYFUNCTYPE(restype, *argtypes) The returned function prototype creates functions that use the Python calling convention. The function will not release the GIL during the call.

ctypes.PyDLL._name

PyDLL._name The name of the library passed in the constructor.

ctypes.PyDLL._handle

PyDLL._handle The system handle used to access the library.

ctypes.PyDLL

class ctypes.PyDLL(name, mode=DEFAULT_MODE, handle=None) Instances of this class behave like CDLL instances, except that the Python GIL is not released during the function call, and after the function execution the Python error flag is checked. If the error flag is set, a Python exception is raised. Thus, this is only useful to call Python C api functions directly.