How replace some netlink features on windows?

Hi,

I’m quite new and my experience with windows kernel driver are very low.
I’m doing the port of linux module on windows and I have problem with named pipes.
The communication between kernel module and userspace program on linux is using netlink.
I’m using named pipes on windows.
On linux we can use nlmsg_unicast which is sending msg to socket buffer.
And after that, I can use recvmsg from userspace and got response. The response is read not from kernel module, but from socket buffer.

I don’t know how I can emulate this scenario on windows - I created new device by
IoCreateDevice and now I can use CreateFile and write something to my driver.
I don’t know how I can store my message (maybe should I create some kind of queue?) and return that message when userspace program will be reading.

Thanks for help!

xxxxx@gmail.com wrote:

I’m quite new and my experience with windows kernel driver are very low.
I’m doing the port of linux module on windows and I have problem with named pipes.
The communication between kernel module and userspace program on linux is using netlink.
I’m using named pipes on windows.

This is almost never a successful strategy. Sockets and pipes are
integral to Linux, but not so much in Windows.

I don’t know how I can emulate this scenario on windows - I created new device by
IoCreateDevice and now I can use CreateFile and write something to my driver.
I don’t know how I can store my message (maybe should I create some kind of queue?) and return that message when userspace program will be reading.

The right answer on Windows is to keep the messages in a buffer within
your driver. Have the user-mode application do ReadFile or
DeviceIoControl calls, and have your driver copy messages from your
buffer directly. How much data are we talking about? How large are the
messages? How often do they arrive? Is the traffic always one way?

If you are interested in contracting this work out, so that you get a
working baseline driver that you can use as a starting point for your
own enhancements, there are certainly people on this list who do that
kind of thing.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.