SerCxRetrieveReceiveMdl function (sercx.h)

The SerCxRetrieveReceiveMdl method retrieves the MDL that describes the buffer to use to receive the next block of input data.

Syntax

NTSTATUS SerCxRetrieveReceiveMdl(
  [in]  WDFDEVICE Device,
  [out] PMDL      *Mdl
);

Parameters

[in] Device

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

[out] Mdl

A pointer to a location into which the method writes a pointer to the MDL.

Return value

SerCxRetrieveReceiveMdl returns STATUS_SUCCESS if the call is successful. Possible return values include the following error codes.

Return code Description
STATUS_INVALID_DEVICE_REQUEST
This value is returned if one of the following occurs:
  • There is no outstanding receive request to get an MDL from.
  • The current number of bytes received (as reported by the SerCxProgressReceive method) does not equal zero.
  • The buffer has already been retrieved (and the corresponding call to the SerCxProgressReceive method has not yet occurred).
  • The MDL has already been retrieved (and the corresponding call to the SerCxProgressReceive method has not yet occurred).

Remarks

The serial controller driver calls this function to obtain an MDL to use for the current receive (read) operation. The MDL describes the buffer memory into which the driver is to transfer the received data. The driver is the exclusive owner of this MDL until it calls the SerCxProgressReceive method, after which the MDL pointer is invalid and the driver must no longer try to access either the MDL or the buffer memory that the MDL describes.

For more information about MDLs, see Using MDLs.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 8.
Target Platform Universal
Header sercx.h
IRQL <= DISPATCH_LEVEL

See also

SerCxProgressReceive