3
votes

As far as I can see - the only entrypoint to communicate with DeviceDriver - is using CreateFile.

Q1 - Is there any other way to communicate with device driver other than using CreateFile

Q2 - When using pseudo file access approach - what are common ways people use ReadFile and WriteFile? Only for passing data in-out or is there any other special purpose to use these?

Any link to appropriate article would be VERY appreciated.

2
You always need CreateFile() to get a handle. Communicate with the driver with Read/WriteFile(), useful for bulk I/O, or DeviceIoControl(). The latter is the "anything is possible" backdoor, commonly used for device configuration for example. A driver has distinct entrypoints for these three functions. - Hans Passant

2 Answers

2
votes

These articles may be very useful for you

http://www.osronline.com/article.cfm?id=24

http://www.osronline.com/article.cfm?article=39

https://docs.microsoft.com/en-us/windows-hardware/drivers/wdf/working-with-usb-pipes

A1: Yes, there is few like Pipes but afair it uses CreateFileA

A2: This is not a pseudofile (kernel objects are not quite files, you can mainly read/write data from them), but read/writefile function are designed to pass data

0
votes

If your driver is a minifilter driver (file system filter driver) working with filter manager you can use CommunicationPorts. See FltCreateCommunicationPort.