You need ZwCreateFile, ZwReadFile and ZwWriteFile functions for working in kernel mode.
Opening, reading, and writing to a serial port in the Windows kernel
-
03-06-2022 - |
Question
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.
Solution
OTHER TIPS
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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow