Hi all,
Is there a queue object that the kernel driver and user mode app can share?
I need transfer data from my driver to my user mode app.
Thanks for your help.
Laura
Post your ad for free now! http://personals.yahoo.ca
Hi all,
Is there a queue object that the kernel driver and user mode app can share?
I need transfer data from my driver to my user mode app.
Thanks for your help.
Laura
Post your ad for free now! http://personals.yahoo.ca
LPC does what you want, but it’s undocumented. O well. Why not use IOCTL’s which is what the rest of us do?
-----Original Message-----
From: Laura Ren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, October 08, 2002 9:19 AM
To: File Systems Developers
Subject: [ntfsd] Is there a queue object that the kernel mode and user
mode can share?
Hi all,
Is there a queue object that the kernel driver and user mode app can share?
I need transfer data from my driver to my user mode app.
Thanks for your help.
Laura
Post your ad for free now! http://personals.yahoo.ca
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
Because I thought IOCTL is good if the user mode know when to request data.
But if it doesn’t, IOCTL is not good enough.
I’d better check LPC first.
I also thought to create a file as the share media between user mode and
kernel mode. but it may be too slow.
Thanks.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Fuller, Rob
Sent: Tuesday, October 08, 2002 10:17 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
LPC does what you want, but it’s undocumented. O well. Why not use IOCTL’s
which is what the rest of us do?
-----Original Message-----
From: Laura Ren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, October 08, 2002 9:19 AM
To: File Systems Developers
Subject: [ntfsd] Is there a queue object that the kernel mode and user
mode can share?
Hi all,
Is there a queue object that the kernel driver and user mode app can share?
I need transfer data from my driver to my user mode app.
Thanks for your help.
Laura
Post your ad for free now! http://personals.yahoo.ca
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@yahoo.ca
To unsubscribe send a blank email to %%email.unsub%%
Post your free ad now! http://personals.yahoo.ca
IOCTL is still good in your scenario. If your driver does not have data for the user-mode component, then your driver should pend the IRP (IoMarkIrpPending, return STATUS_PENDING) then complete it when there is data to be returned.
-----Original Message-----
From: Laura Ren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, October 08, 2002 9:36 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
Because I thought IOCTL is good if the user mode know when to request data.
But if it doesn’t, IOCTL is not good enough.
I’d better check LPC first.
I also thought to create a file as the share media between user mode and
kernel mode. but it may be too slow.
Thanks.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Fuller, Rob
Sent: Tuesday, October 08, 2002 10:17 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
LPC does what you want, but it’s undocumented. O well. Why not use IOCTL’s
which is what the rest of us do?
-----Original Message-----
From: Laura Ren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, October 08, 2002 9:19 AM
To: File Systems Developers
Subject: [ntfsd] Is there a queue object that the kernel mode and user
mode can share?
Hi all,
Is there a queue object that the kernel driver and user mode app can share?
I need transfer data from my driver to my user mode app.
Thanks for your help.
Laura
Post your ad for free now! http://personals.yahoo.ca
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@yahoo.ca
To unsubscribe send a blank email to %%email.unsub%%
Post your free ad now! http://personals.yahoo.ca
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
True, most of us use IOCTL functions to communicate between driver and
user-mode program. But it’s certainly possible to set up a shared memory
section to be used as a queue too. It’s not necessarily slow. Although you
use file-oriented APIs to create a shared section, that doesn’t mean the
shared data actually gets written to disk. The data could stay in memory if
it’s not flushed.
Now, with a queue, you still need some way of notifying a user mode program
that the kernel has put something new in the queue, and probably a mutual
exclusion mechanism to prevent simultaneous modification of the queue. All
those tools are available too.
Carl
“Laura Ren” wrote in message news:xxxxx@ntfsd…
>
> Hi all,
> Is there a queue object that the kernel driver and user mode app can
share?
> I need transfer data from my driver to my user mode app.
>
> Thanks for your help.
>
> Laura
Thanks Carl and Rob.
Laura
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Carl Appellof
Sent: Tuesday, October 08, 2002 11:43 AM
To: File Systems Developers
Subject: [ntfsd] Re: Is there a queue object that the kernel mode and
user mode can share?
True, most of us use IOCTL functions to communicate between driver and
user-mode program. But it’s certainly possible to set up a shared memory
section to be used as a queue too. It’s not necessarily slow. Although you
use file-oriented APIs to create a shared section, that doesn’t mean the
shared data actually gets written to disk. The data could stay in memory if
it’s not flushed.
Now, with a queue, you still need some way of notifying a user mode program
that the kernel has put something new in the queue, and probably a mutual
exclusion mechanism to prevent simultaneous modification of the queue. All
those tools are available too.
Carl
“Laura Ren” wrote in message news:xxxxx@ntfsd…
>
> Hi all,
> Is there a queue object that the kernel driver and user mode app can
share?
> I need transfer data from my driver to my user mode app.
>
> Thanks for your help.
>
> Laura
—
You are currently subscribed to ntfsd as: xxxxx@yahoo.ca
To unsubscribe send a blank email to %%email.unsub%%
______________________________________________________________________
Post your ad for free now! http://personals.yahoo.ca
Of course it’s possible to use shared memory and named events. Note, this is a lot like re-inventing the wheel when LPC already provides these mechanisms. Also, the IRP method is better understood by most developers. They generally don’t have to deal with tricky issues such as getting the security descriptors on the named objects set up correctly if you create them from your driver rather than having your application create them and pass handles to your driver.
-----Original Message-----
From: Carl Appellof [mailto:xxxxx@nospam.veritas.com]
Sent: Tuesday, October 08, 2002 10:43 AM
To: File Systems Developers
Subject: [ntfsd] Re: Is there a queue object that the kernel mode and
user mode can share?
True, most of us use IOCTL functions to communicate between driver and
user-mode program. But it’s certainly possible to set up a shared memory
section to be used as a queue too. It’s not necessarily slow. Although you
use file-oriented APIs to create a shared section, that doesn’t mean the
shared data actually gets written to disk. The data could stay in memory if
it’s not flushed.
Now, with a queue, you still need some way of notifying a user mode program
that the kernel has put something new in the queue, and probably a mutual
exclusion mechanism to prevent simultaneous modification of the queue. All
those tools are available too.
Carl
“Laura Ren” wrote in message news:xxxxx@ntfsd…
>
> Hi all,
> Is there a queue object that the kernel driver and user mode app can
share?
> I need transfer data from my driver to my user mode app.
>
> Thanks for your help.
>
> Laura
—
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
Another variation on the “use file” theme is to use a section object as the IPC channel and an event as the notification mechanism. You can use the ZwCreateSection function in the driver to create a section which it can use to write your IPC messages into, then you can either poll through an IOCTL, block in an IOCTL or just signal an event that something is waiting for your user mode application to go and fetch. This eliminates the case where you have something to deliver, but there is no active thread waiting in your IOCTL function with a pending IRP and eliminates the expense of the file i/o. You can use a circular queue in the shared section and provide wrap checking to avoid overruns which would cause you to lose messages, assuming of course this is important to you. The only other consideration you have to make is the potention process context switch overhead, which is highly dependent on the frequency of messages and the multi-process nature of your driver interaction.
/TomH
-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Tuesday, October 08, 2002 10:36 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
IOCTL is still good in your scenario. If your driver does not have data for the user-mode component, then your driver should pend the IRP (IoMarkIrpPending, return STATUS_PENDING) then complete it when there is data to be returned.
-----Original Message-----
From: Laura Ren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, October 08, 2002 9:36 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
Because I thought IOCTL is good if the user mode know when to request data.
But if it doesn’t, IOCTL is not good enough.
I’d better check LPC first.
I also thought to create a file as the share media between user mode and
kernel mode. but it may be too slow.
Thanks.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Fuller, Rob
Sent: Tuesday, October 08, 2002 10:17 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
LPC does what you want, but it’s undocumented. O well. Why not use IOCTL’s
which is what the rest of us do?
-----Original Message-----
From: Laura Ren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, October 08, 2002 9:19 AM
To: File Systems Developers
Subject: [ntfsd] Is there a queue object that the kernel mode and user
mode can share?
Hi all,
Is there a queue object that the kernel driver and user mode app can share?
I need transfer data from my driver to my user mode app.
Thanks for your help.
Laura
Post your ad for free now! http://personals.yahoo.ca
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@yahoo.ca
To unsubscribe send a blank email to %%email.unsub%%
Post your free ad now! http://personals.yahoo.ca
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@inflectionsystems.com
To unsubscribe send a blank email to %%email.unsub%%
You state, “but there is no active thread waiting in your IOCTL function.” This is also true of a properly written IOCTL scenario. Rather than block the thread in your IOCTL, you should truly pend the request by calling IoMarkIrpPending and returning STATUS_PENDING after setting a cancel routine. Then, if the application wants the thread back, it merely needs to request “overlapped” IO.
-----Original Message-----
From: Tom Hansen [mailto:xxxxx@inflectionsystems.com]
Sent: Tuesday, October 08, 2002 10:58 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
Another variation on the “use file” theme is to use a section object as the IPC channel and an event as the notification mechanism. You can use the ZwCreateSection function in the driver to create a section which it can use to write your IPC messages into, then you can either poll through an IOCTL, block in an IOCTL or just signal an event that something is waiting for your user mode application to go and fetch. This eliminates the case where you have something to deliver, but there is no active thread waiting in your IOCTL function with a pending IRP and eliminates the expense of the file i/o. You can use a circular queue in the shared section and provide wrap checking to avoid overruns which would cause you to lose messages, assuming of course this is important to you. The only other consideration you have to make is the potention process context switch overhead, which is highly dependent on the frequency of messages and the multi-process nature of your driver interaction.
/TomH
-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Tuesday, October 08, 2002 10:36 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
IOCTL is still good in your scenario. If your driver does not have data for the user-mode component, then your driver should pend the IRP (IoMarkIrpPending, return STATUS_PENDING) then complete it when there is data to be returned.
-----Original Message-----
From: Laura Ren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, October 08, 2002 9:36 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
Because I thought IOCTL is good if the user mode know when to request data.
But if it doesn’t, IOCTL is not good enough.
I’d better check LPC first.
I also thought to create a file as the share media between user mode and
kernel mode. but it may be too slow.
Thanks.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Fuller, Rob
Sent: Tuesday, October 08, 2002 10:17 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
LPC does what you want, but it’s undocumented. O well. Why not use IOCTL’s
which is what the rest of us do?
-----Original Message-----
From: Laura Ren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, October 08, 2002 9:19 AM
To: File Systems Developers
Subject: [ntfsd] Is there a queue object that the kernel mode and user
mode can share?
Hi all,
Is there a queue object that the kernel driver and user mode app can share?
I need transfer data from my driver to my user mode app.
Thanks for your help.
Laura
Post your ad for free now! http://personals.yahoo.ca
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@yahoo.ca
To unsubscribe send a blank email to %%email.unsub%%
Post your free ad now! http://personals.yahoo.ca
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@inflectionsystems.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
Right. This also gives you the possibility of driving multiple irps and thereby multiple IPC buffers into your driver without having a number of waiting threads. This model can be used in-place of a section to store the IPC messages. It just requires the async i/o management in the user mode component. /TomH
-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Tuesday, October 08, 2002 12:20 PM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
You state, “but there is no active thread waiting in your IOCTL function.” This is also true of a properly written IOCTL scenario. Rather than block the thread in your IOCTL, you should truly pend the request by calling IoMarkIrpPending and returning STATUS_PENDING after setting a cancel routine. Then, if the application wants the thread back, it merely needs to request “overlapped” IO.
-----Original Message-----
From: Tom Hansen [mailto:xxxxx@inflectionsystems.com]
Sent: Tuesday, October 08, 2002 10:58 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
Another variation on the “use file” theme is to use a section object as the IPC channel and an event as the notification mechanism. You can use the ZwCreateSection function in the driver to create a section which it can use to write your IPC messages into, then you can either poll through an IOCTL, block in an IOCTL or just signal an event that something is waiting for your user mode application to go and fetch. This eliminates the case where you have something to deliver, but there is no active thread waiting in your IOCTL function with a pending IRP and eliminates the expense of the file i/o. You can use a circular queue in the shared section and provide wrap checking to avoid overruns which would cause you to lose messages, assuming of course this is important to you. The only other consideration you have to make is the potention process context switch overhead, which is highly dependent on the frequency of messages and the multi-process nature of your driver interaction.
/TomH
-----Original Message-----
From: Fuller, Rob [mailto:xxxxx@inin.com]
Sent: Tuesday, October 08, 2002 10:36 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
IOCTL is still good in your scenario. If your driver does not have data for the user-mode component, then your driver should pend the IRP (IoMarkIrpPending, return STATUS_PENDING) then complete it when there is data to be returned.
-----Original Message-----
From: Laura Ren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, October 08, 2002 9:36 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
Because I thought IOCTL is good if the user mode know when to request data.
But if it doesn’t, IOCTL is not good enough.
I’d better check LPC first.
I also thought to create a file as the share media between user mode and
kernel mode. but it may be too slow.
Thanks.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Fuller, Rob
Sent: Tuesday, October 08, 2002 10:17 AM
To: File Systems Developers
Subject: [ntfsd] RE: Is there a queue object that the kernel mode and
user mode can share?
LPC does what you want, but it’s undocumented. O well. Why not use IOCTL’s
which is what the rest of us do?
-----Original Message-----
From: Laura Ren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, October 08, 2002 9:19 AM
To: File Systems Developers
Subject: [ntfsd] Is there a queue object that the kernel mode and user
mode can share?
Hi all,
Is there a queue object that the kernel driver and user mode app can share?
I need transfer data from my driver to my user mode app.
Thanks for your help.
Laura
Post your ad for free now! http://personals.yahoo.ca
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@yahoo.ca
To unsubscribe send a blank email to %%email.unsub%%
Post your free ad now! http://personals.yahoo.ca
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@inflectionsystems.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntfsd as: xxxxx@inflectionsystems.com
To unsubscribe send a blank email to %%email.unsub%%