Which way to sending data from driver to user mode is better?

I want to send the data from IRP_MJ_WRITE to user mode in my volume filter driver…
but which way is better?TDI,writing file or others?
Any suggestion will be appreciated!

> I want to send the data from IRP_MJ_WRITE to user mode in my volume filter

driver…
but which way is better?TDI,writing file or others?

I just wonder how *TDI* (i.e. network-related driver interface) may be possibly related
to a *volume* filter driver…

Concerning your actual question, the best thing to do here is to use “inverted call”. Please search OSR archives for the article that gives a precise description of this technique…

Anton Bassov

Pend several “get next data” IOCTLs from the app. When the data arrives,
copy it to the IOCTLs buffer and complete it.

Do not forget to provide cancellation support for pending IOCTLs.

This is called “inverted call”.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> I want to send the data from IRP_MJ_WRITE to user mode in my volume filter
driver…
> but which way is better?TDI,writing file or others?
> Any suggestion will be appreciated!
>

Thanks anton bassov,
I use TDI,because I want to send data from my volume filter driver to a remote machine.
So another question, if I want to send data from kernel mode to a remote machine, should I use TDI to send data directly or should I send them to user mode and send them to remote machin using winsock?

> I use TDI,because I want to send data from my volume filter driver to a

remote machine.

This is what you should have said from the very beginning…

So another question, if I want to send data from kernel mode to a remote
machine, should I use TDI to send data directly or should I send them to user
mode and send them to remote machin using winsock?

It depends on your objectives - you can do it either way, so that everything depends on which of them is more appropriate and convenient in context of a particular project…

Anton Bassov

thanks anton Bassov,
Actually I’m trying to send the data from IRP_MJ_WRITE to remote machine as quickly as possible, because I don’t want to hold the IRP_MJ_WRITE too long…
So which one you think is more efficient?

> Actually I’m trying to send the data from IRP_MJ_WRITE to remote machine as

quickly as possible,because I don’t want to hold the IRP_MJ_WRITE too long…

The only thing I can tell you is that you should send data to the remote machine in context of a dedicated thread(s) and not in context of the one that processes IRP_MJ_WRITE - your IRP_MJ_WRITE handler should copy contents of the buffer that comes with IRP, queue a request to a dedicated thread, and pass IRP_MJ_WRITE to the lower driver without waiting for send operation to complete.

It does not really matter if actual send operation is done by app or by driver , but, for the sake of simplicity, I would send data from an app.

Anton Bassov