ctypes._CData._objects

_objects This member is either None or a dictionary containing Python objects that need to be kept alive so that the memory block contents is kept valid. This object is only exposed for debugging; never modify the contents of this dictionary.

ctypes._CData._b_needsfree_

_b_needsfree_ This read-only variable is true when the ctypes data instance has allocated the memory block itself, false otherwise.

ctypes._CData._b_base_

_b_base_ Sometimes ctypes data instances do not own the memory block they contain, instead they share part of the memory block of a base object. The _b_base_ read-only member is the root ctypes object that owns the memory block.

ctypes._CData.in_dll()

in_dll(library, name) This method returns a ctypes type instance exported by a shared library. name is the name of the symbol that exports the data, library is the loaded shared library.

ctypes._CData.from_param()

from_param(obj) This method adapts obj to a ctypes type. It is called with the actual object used in a foreign function call when the type is present in the foreign function’s argtypes tuple; it must return an object that can be used as a function call parameter. All ctypes data types have a default implementation of this classmethod that normally returns obj if that is an instance of the type. Some types accept other objects as well.

ctypes._CData.from_buffer_copy()

from_buffer_copy(source[, offset]) This method creates a ctypes instance, copying the buffer from the source object buffer which must be readable. The optional offset parameter specifies an offset into the source buffer in bytes; the default is zero. If the source buffer is not large enough a ValueError is raised.

ctypes._CData.from_buffer()

from_buffer(source[, offset]) This method returns a ctypes instance that shares the buffer of the source object. The source object must support the writeable buffer interface. The optional offset parameter specifies an offset into the source buffer in bytes; the default is zero. If the source buffer is not large enough a ValueError is raised.

ctypes._CData.from_address()

from_address(address) This method returns a ctypes type instance using the memory specified by address which must be an integer.

ctypes._CData

class ctypes._CData This non-public class is the common base class of all ctypes data types. Among other things, all ctypes type instances contain a memory block that hold C compatible data; the address of the memory block is returned by the addressof() helper function. Another instance variable is exposed as _objects; this contains other Python objects that need to be kept alive in case the memory block contains pointers. Common methods of ctypes data types, these are all class methods (to

ctypes.wstring_at()

ctypes.wstring_at(address, size=-1) This function returns the wide character string starting at memory address address as a string. If size is specified, it is used as the number of characters of the string, otherwise the string is assumed to be zero-terminated.