4

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.

zvoice
  • 183
  • 3
  • 9
  • 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 Feb 14 '18 at 09:55

2 Answers2

2

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://learn.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

Daniel Mazur
  • 63
  • 1
  • 5
0

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