SerCxRetrieveTransmitBuffer method

The SerCxRetrieveTransmitBuffer method obtains an output buffer that contains data that is ready to be transmitted to the serial port.

Syntax


NTSTATUS SerCxRetrieveTransmitBuffer(
  [in]      WDFDEVICE                Device,
  [in]      ULONG                    Length,
  [in, out] PSERCX_BUFFER_DESCRIPTOR BufferDescriptor
);

Parameters

Device [in]

A WDFDEVICE handle to the framework device object that represents the serial controller.

Length [in]

The requested buffer length, in bytes. If the SerCxRetrieveTransmitBuffer call succeeds, the caller receives an output buffer that contains up to Length bytes of available data. (The available data in the buffer might be less than Length bytes.) SerCxRetrieveTransmitBuffer writes the actual number of bytes of available data to the Length member of the structure pointed to by the BufferDescriptor parameter.

BufferDescriptor [in, out]

A pointer to a caller-allocated SERCX_BUFFER_DESCRIPTOR structure. This structure describes the data buffer to use for the transmit operation. The caller previously called the SERCX_BUFFER_DESCRIPTOR_INIT function to initialize this structure. SerCxRetrieveTransmitBuffer writes to the Buffer and Length members of this structure.

Return value

SerCxRetrieveTransmitBuffer returns STATUS_SUCCESS if it is successful. Possible error return values include the following status codes.

Return codeDescription
STATUS_INVALID_DEVICE_REQUEST

The method was called at the wrong IRQL; or the WDFDEVICE handle is not valid; or either Device or BufferDescriptor is NULL; or the driver already has a transmit buffer.

STATUS_INFO_LENGTH_MISMATCH

The wrong size is specified for the SERCX_BUFFER_DESCRIPTOR structure.

STATUS_INSUFFICIENT_RESOURCES

Could not allocate system resources (typically memory).

 

Remarks

The serial controller driver calls this method to acquire a buffer that contains the output data for the current transmit (write) operation.

Requirements

Target platform

Universal

Version

Available starting with Windows 8.

Header

1.0\Sercx.h

IRQL

<= DISPATCH_LEVEL

See also

SERCX_BUFFER_DESCRIPTOR
SERCX_BUFFER_DESCRIPTOR_INIT

 

 

Send comments about this topic to Microsoft

Show: