SerCxRetrieveTransmitBuffer function (sercx.h)
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
[in] Device
A WDFDEVICE handle to the framework device object that represents the serial controller.
[in] Length
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.
[in, out] BufferDescriptor
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 code | Description |
---|---|
|
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. |
|
The wrong size is specified for the SERCX_BUFFER_DESCRIPTOR structure. |
|
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
Requirement | Value |
---|---|
Minimum supported client | Available starting with Windows 8. |
Target Platform | Universal |
Header | sercx.h |
IRQL | <= DISPATCH_LEVEL |