IODataQueueDequeue

Function IODataQueueDequeue 

Source
pub unsafe extern "C-unwind" fn IODataQueueDequeue(
    data_queue: *mut IODataQueueMemory,
    data: *mut c_void,
    data_size: *mut u32,
) -> IOReturn
Expand description

Dequeues the next available entry on the queue and copies it into the given data pointer.

This function will dequeue the next available entry on the queue. If a data pointer is provided, it will copy the data into the memory region if there is enough space available as specified in the dataSize parameter. If no data pointer is provided, it will simply move the head value past the current entry.

Parameter dataQueue: The IODataQueueMemory region mapped from the kernel.

Parameter data: A pointer to the data memory region in which to copy the next entry data on the queue. If this parameter is 0 (NULL), it will simply move to the next entry.

Parameter dataSize: A pointer to the size of the data parameter. On return, this contains the size of the actual entry data - even if the original size was not large enough.

Returns: Returns kIOReturnSuccess on success. Other return values possible are: kIOReturnUnderrun - queue is empty, kIOReturnBadArgument - no dataQueue or no dataSize, kIOReturnNoSpace - dataSize is too small for entry.

ยงSafety

  • data_queue must be a valid pointer.
  • data must be a valid pointer.
  • data_size must be a valid pointer.