I have a requirement where my current WDM driver needs to send the data to my user mode application. Data patterns are such that the driver needs to send small buffers of data immediately whenever it has and the driver can’t wait to accumulate the data to send large buffers.
The filesystem filter manager provides a mechanism for communication between user mode application and minifilter driver, which is pretty good. This can be achieved between a WDM driver and a user mode application by
Associating the file handle with an IO completion port
Sending the Asynchronous IO to the driver
And receiving the responses with GetQueuedCompletionStatus.
I can increase the number of threads in user application to send and receive the IOs based on the load. And WDM driver completes the simultaneous IOs asynchronously by queuing the IRPs and completing them later when it has data to complete the requests. However, I do need to handle the cancellation of IRPs and the context data is high for this.
My question is:
Is there any alternate mechanism which can achieve the above in a WDM driver similar to
Communication port in Min filter drivers?
Nothing equivalent exists in WDM. Communication Ports are just a convenient
wrapper around using IRPs as you have described below. It’s unfortunate that
they require a filter handle to create a communication port because it would
be a generically useful thing to have.
I have a requirement where my current WDM driver needs to send the data to
my user mode application. Data patterns are such that the driver needs to
send small buffers of data immediately whenever it has and the driver can’t
wait to accumulate the data to send large buffers.
The filesystem filter manager provides a mechanism for communication between
user mode application and minifilter driver, which is pretty good. This can
be achieved between a WDM driver and a user mode application by
Associating the file handle with an IO completion port
Sending the Asynchronous IO to the driver
And receiving the responses with GetQueuedCompletionStatus.
I can increase the number of threads in user application to send and receive
the IOs based on the load. And WDM driver completes the simultaneous IOs
asynchronously by queuing the IRPs and completing them later when it has
data to complete the requests. However, I do need to handle the cancellation
of IRPs and the context data is high for this.
My question is:
Is there any alternate mechanism which can achieve the above in a WDM driver
similar to
Communication port in Min filter drivers?
The filesystem filter manager provides a mechanism for communication between user mode application and minifilter driver, which is pretty good. This can be achieved between a WDM driver and a user mode application by
Associating the file handle with an IO completion port
Sending the Asynchronous IO to the driver
And receiving the responses with GetQueuedCompletionStatus.
I/O completion ports are not a file system thing. It’s a user-mode technique that can be used with ANY kernel-mode driver.
—
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
On Oct 3, 2016, at 9:50 PM, Tim Roberts wrote: > > On Oct 3, 2016, at 9:59 AM, xxxxx@gmail.com wrote: >> >> The filesystem filter manager provides a mechanism for communication between user mode application and minifilter driver, which is pretty good. This can be achieved between a WDM driver and a user mode application by >> >> 1) Associating the file handle with an IO completion port >> 2) Sending the Asynchronous IO to the driver >> 3) And receiving the responses with GetQueuedCompletionStatus. > > I/O completion ports are not a file system thing. It’s a user-mode technique that can be used with ANY kernel-mode driver.
Or so I thought. — Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
Don?t increase the number of threads in UM. Except in special circumstances, use the thread pool APIs and pend several overlapped reads (IRPs). The number of UM threads should approximate the number of CPUs and tune the number of pending reads (IOCTL) based on your data rate and reliability requirments
From: xxxxx@gmail.commailto:xxxxx Sent: October 3, 2016 1:00 PM To: Windows System Software Devs Interest Listmailto:xxxxx Subject: [ntdev] Communication from WDM driver to user mode application
Hi,
I have a requirement where my current WDM driver needs to send the data to my user mode application. Data patterns are such that the driver needs to send small buffers of data immediately whenever it has and the driver can’t wait to accumulate the data to send large buffers.
The filesystem filter manager provides a mechanism for communication between user mode application and minifilter driver, which is pretty good. This can be achieved between a WDM driver and a user mode application by
1) Associating the file handle with an IO completion port 2) Sending the Asynchronous IO to the driver 3) And receiving the responses with GetQueuedCompletionStatus.
I can increase the number of threads in user application to send and receive the IOs based on the load. And WDM driver completes the simultaneous IOs asynchronously by queuing the IRPs and completing them later when it has data to complete the requests. However, I do need to handle the cancellation of IRPs and the context data is high for this.
My question is:
Is there any alternate mechanism which can achieve the above in a WDM driver similar to Communication port in Min filter drivers?
Exactly this. You can send multiple io requests on the same thread. You might not even need a thread pool, especially in the case where order matters. If it matters, you need to include a sequence number in the output buffer.
________________________________ From: xxxxx@lists.osr.com on behalf of Marion Bond Sent: Tuesday, October 4, 2016 4:13:41 PM To: Windows System Software Devs Interest List Subject: RE: [ntdev] Communication from WDM driver to user mode application
Don?t increase the number of threads in UM. Except in special circumstances, use the thread pool APIs and pend several overlapped reads (IRPs). The number of UM threads should approximate the number of CPUs and tune the number of pending reads (IOCTL) based on your data rate and reliability requirments
From: xxxxx@gmail.commailto:xxxxx Sent: October 3, 2016 1:00 PM To: Windows System Software Devs Interest Listmailto:xxxxx Subject: [ntdev] Communication from WDM driver to user mode application
Hi,
I have a requirement where my current WDM driver needs to send the data to my user mode application. Data patterns are such that the driver needs to send small buffers of data immediately whenever it has and the driver can’t wait to accumulate the data to send large buffers.
The filesystem filter manager provides a mechanism for communication between user mode application and minifilter driver, which is pretty good. This can be achieved between a WDM driver and a user mode application by
1) Associating the file handle with an IO completion port 2) Sending the Asynchronous IO to the driver 3) And receiving the responses with GetQueuedCompletionStatus.
I can increase the number of threads in user application to send and receive the IOs based on the load. And WDM driver completes the simultaneous IOs asynchronously by queuing the IRPs and completing them later when it has data to complete the requests. However, I do need to handle the cancellation of IRPs and the context data is high for this.
My question is:
Is there any alternate mechanism which can achieve the above in a WDM driver similar to Communication port in Min filter drivers?
MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers! Details at http:
To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:></http:></http:></http:></mailto:xxxxx></mailto:xxxxx></https:></https:>