I'm writing a Windows kernel driver in C and I need to send and receive data over a serial device, specifically COM3. I am stuck on the CreateFile, ReadFile, and WriteFile functions, as these seem to be user space functions that will not work in the kernel. Am I mistaken? Or if not, what is the best way to open and use a serial port from within the Windows kernel?

Many thanks.

有帮助吗?

解决方案

You need ZwCreateFile, ZwReadFile and ZwWriteFile functions for working in kernel mode.

其他提示

You are writing a driver then You must have to write kernel module for windows .

check this

http://www.codeproject.com/Articles/9504/Driver-Development-Part-1-Introduction-to-Drivers

One more thing once you have finished the driver you need a application to test it.

so you need a user space application to test it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top