In Linux we can read/write from an associated driver file object and those function calls would be carried by the driver read/write functions. Is it the same in Windows?
Do we associate a file to the driver and access the driver functions by reading/writing to this file?
(I’ve been programming drivers under Linux and now am trying to understand “the Windows way” to do it.)
Device drivers on Windows do not work in the same way that drivers do on Linux. For a quick introduction to the overall structure of Windows drivers you can check MSDN. There are several classes of drivers but they are not tied to the VFS as in Linux, instead they are represented as nodes in a tree of devices
From MSDN the purpose of the
DriverEntryprocedure is this:This means that the I/O manager will call the procedure and you fill out the structure with pointers to the procedures that your driver implememnts. You can create individual device objects with
IoCreateDeviceand store them in yourDRIVER_OBJECTstructure.To create a block device style device I believe you want to create a
FILE_DEVICE_DISKtype device.There is a series of driver creation tutorials by Microsoft, the second one might be a good place to start.