Hi
I have 2 questions about SetCommTimeouts API function.
Documentation says: "Sets the time-out parameters for all read and write operations on a specified communications device."
I looked Device_Object, Driver_Object, IRP data structures, none of them have any member related to timeout. My first question is, Which data structure does this function set?
The second is, Why does documentation especially say "communication device"? Isn't this concept related to disk or other device types, Can't we use them with other devices?
Thank you all...
No. It is specifically for serial port devices, and it's stored in a data structure within serial.sys.
The terminology used here is very old. Serial ports are still commonly used, especially for out of band management and in industrial applications, but back in the 1980's, before the rise of more extensible networking technologies like Ethernet, a communications device, was a device that could communicate outside of the local system. Specifically serial and parallel ports.
This API exists because the underlying hardware does not have any built in link control - just wires that are tx / rx with basic high / low voltage. And they operate at speeds that are slow enough that applications can directly intervene. Both things are not true for even gigabit Ethernet, much less much faster protocols like 100 Gb/s Ethernet, or much more complex protocols like WiFi.
No disk IO protocol has ever allowed applications to set parameters for its operation. Certainly not the modern NVMe ones, but even the ancient SCSI or PIO ones.
That's not to say that applications have no control, but they don't have control at this level because it makes no sense. The device ASIC or FPGA or firmware generally control things at this level for any modern hardware. Even the device driver is too far removed