Hi, I have a driver that communicates with a svc via ioctls, the svc then sends data from driver to singleton clients per windows sessions (think citrix / RDS). The driver organizes its data via session ids and the svc only sends the data to the client that is running in that windows session.
Everything works fine.
Now, I’d like to improve on this by eliminating the svc and modifying the driver so a win32 client in a given session can connect to it like a file.
Something like this (note the device name, I’m pretty clueless here on what to do)
CreateFileA( “\\.\MY_DEVICE\session_id_x”,
GENERIC_WRITE,
FILE_SHARE_READ,
0,
OPEN_EXISTING,
0,
NULL);
while ReadFile()
{
process_line()
}
// then in the drivers ioctl for read it would send back line by line
What is the best way to achieve something like this? Or does it even make sense?
In the driver I could create a device each time I see items for a new session. The client running in a new windows session would “know” the device name, but that doesn’t seem right to me.
Can’t my one device just have a memory only file of some type created on the fly that the client in the new session could read from like a normal file / pipe?
Is this a job for ZwCreateSection? Can that be accessed like a normal file from usermode?
What’s the best way to organize something like this?
Thanks.