Function

IOSurfaceCreateMachPort

Returns a mach_port_t that holds a reference to the IOSurface.

Declaration

mach_port_t IOSurfaceCreateMachPort(IOSurfaceRef buffer);

Discussion

This is useful if you need to atomically or securely pass an IOSurface to another task without making the surface global to the entire system. The returned port must be deallocated with mach_port_deallocate or the equivalent.