The IOCTL_SERIAL_SET_MODEM_CONTROL request sets the modem control register (MCR) in the UART. No parameter checking is done on the client-supplied register settings.

To obtain the value of the MCR, a client can use an IOCTL_SERIAL_GET_MODEM_CONTROL request.

Major code


Input buffer

The AssociatedIrp.SystemBuffer member points to a client-allocated ULONG that is used to input modem control information.

Input buffer length

The Parameters.DeviceIoControl.InputBufferLength member is set to the size, in bytes, of a ULONG.

Output buffer


Output buffer length


Status block

The Information member is set to zero.

The Status member is set to one of the Generic Status Values for Serial Device Control Requests.


The implementation of this I/O control request (IOCTL) is hardware-specific because no standard layout is defined for the modem control register (MCR) across 16550-compatible UART devices. The drivers for peripheral devices that connect to serial ports should avoid using this IOCTL, which might work with some UARTs but not with others. This IOCTL is primarily used to configure the UART into loopback mode for testing, but only if the UART has an MCR that supports loopback mode.

For an example layout of an MCR, see the definition of the MCR bits (SERIAL_MCR_DTR through SERIAL_MCR_LOOP) in the Serial.h header file in the Serial driver sample on GitHub.


Requirement Value
Header ntddser.h (include Ntddser.h)

See also