Hi,
I’m writing a W2K NDIS WAN driver which has to access the serial IO
port(e.g., 16650 compatible COM). I do’t want to rewrite the serial port
driver. I hope I can use the existing high-leverl APIs in kernel to
read/write/configure the serial port. It seems to me that ZwCreate(
)/ZwRead( )/ZwWrite() in W2K DDK can be used for this purpose. But I don’t
know which API in W2K DDK can be used to configure the serial port, for
example, the speed, the mode, etc. Please point out which API I can use to
configure the serial port, or whether I can’t use the above APIs operate
the serial port at all. Thanks in advance.
Best regards,
He Huang
The serial driver can be accessed by using IoCallDriver().
Build the reference to \Device\Serial0 and \Device\Serial1 using
IoGetDeviceObjectPointer or related functions and then use IoCallDriver()
after that to command the driver. The header file
\ddk\src\comm\inc\ntddser.h shows you what parameters you need for each OID
and MSDN gives a bit more info under
WinNt 4.0 DDK \ Kernel-Mode Drivers \ Reference \ Part2… \ Chapter 4…
On 10/06/00, “xxxxx@eos.ncsu.edu” wrote:
Hi,
I’m writing a W2K NDIS WAN driver which has to access the serial IO
port(e.g., 16650 compatible COM). I do’t want to rewrite the serial port
driver. I hope I can use the existing high-leverl APIs in kernel to
read/write/configure the serial port. It seems to me that ZwCreate(
)/ZwRead( )/ZwWrite() in W2K DDK can be used for this purpose. But I don’t
know which API in W2K DDK can be used to configure the serial port, for
example, the speed, the mode, etc. Please point out which API I can use to
configure the serial port, or whether I can’t use the above APIs operate
the serial port at all. Thanks in advance.
Best regards,
He Huang