How can i communicate with a user process ?

hi !
i am trying to tell a user process that a particular task has been completed
in the driver.
i am trying to use Events for this purpose.
i create an event in the driver, and i want to wait on that event in the
user process.
but i am not able to open the event in the user process.

any ideas ?

thanks
-girish


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Have you looked at the ddk\src\general\async sample driver? It
demonstrates exatly what you are talking about. That being said, depending
on how many user processes you are trying to notify, perhaps you should
simply create an event in user mode and pass the handle to the driver.
This way you do not have to come up with names for all the different types
of events and you can explicitly associate events with particular clients.
If you need an example of this I can dig it up for you.

Shaun
xxxxx@tenpennies.com

On 04/25/01, ““Girish Dattatreya Kulkarni” ”
wrote:
> hi !
> i am trying to tell a user process that a particular task has been completed
> in the driver.
> i am trying to use Events for this purpose.
> i create an event in the driver, and i want to wait on that event in the
> user process.
> but i am not able to open the event in the user process.
>
> any ideas ?
>
> thanks
> -girish
>
>
> —
> You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

You need to create the named event in the \BaseNamedObjects directory for it
to be visible to win32 programs. other oddities that bit me include:

. \BaseNamedObjects doesn’t exist until some time after the system is
booted; I could
not create the event in the DriverEntry of my PnP driver because this
directory didn’t
yet exist; I had to do it some time later when the user mode app opened my
device.

. Following on to the above; you need to ensure you are running in the
system process
context when you create the event - otherwise, when the process in which
you were
running dies, the handle to the event gets automatically closed and your
event will
quietly disappear (of course, that may be exactly what you want, but it
wasn’t in
my case so I got very confused for a while!) My ugly solution to this was
to queue
a work item in my open routine (which runs in the context of the user app
process);
this work item actually creates the event in the context of the system
process; yuck!

/simgr

-----Original Message-----
From: Girish Dattatreya Kulkarni [mailto:xxxxx@wipro.com]
Sent: Wednesday, April 25, 2001 2:07 AM
To: NT Developers Interest List
Subject: [ntdev] How can i communicate with a user process ?

hi !
i am trying to tell a user process that a particular task has been completed
in the driver.
i am trying to use Events for this purpose.
i create an event in the driver, and i want to wait on that event in the
user process.
but i am not able to open the event in the user process.

any ideas ?

thanks
-girish


You are currently subscribed to ntdev as: xxxxx@stratus.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Hello,

I was working on similar problem some time back. But my system was sharing
some memory between user mode and kernel mode. So I used one of the byte in
the shared memory as a flag to tell event has occured. Hope this will help
you…

thanks,
Girish

===== Original Message From “Graham, Simon” =====
>You need to create the named event in the \BaseNamedObjects directory for it
>to be visible to win32 programs. other oddities that bit me include:
>
>. \BaseNamedObjects doesn’t exist until some time after the system is
>booted; I could
> not create the event in the DriverEntry of my PnP driver because this
>directory didn’t
> yet exist; I had to do it some time later when the user mode app opened my
>device.
>
>. Following on to the above; you need to ensure you are running in the
>system process
> context when you create the event - otherwise, when the process in which
>you were
> running dies, the handle to the event gets automatically closed and your
>event will
> quietly disappear (of course, that may be exactly what you want, but it
>wasn’t in
> my case so I got very confused for a while!) My ugly solution to this was
>to queue
> a work item in my open routine (which runs in the context of the user app
>process);
> this work item actually creates the event in the context of the system
>process; yuck!
>
>/simgr
>
>-----Original Message-----
>From: Girish Dattatreya Kulkarni [mailto:xxxxx@wipro.com]
>Sent: Wednesday, April 25, 2001 2:07 AM
>To: NT Developers Interest List
>Subject: [ntdev] How can i communicate with a user process ?
>
>
>hi !
>i am trying to tell a user process that a particular task has been completed
>in the driver.
>i am trying to use Events for this purpose.
>i create an event in the driver, and i want to wait on that event in the
>user process.
>but i am not able to open the event in the user process.
>
>any ideas ?
>
>thanks
>-girish
>
>
>—
>You are currently subscribed to ntdev as: xxxxx@stratus.com
>To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>—
>You are currently subscribed to ntdev as: xxxxx@operamail.com
>To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

------------------------------------------------------------
This e-mail has been sent to you courtesy of OperaMail, as a free service from
Opera Software, makers of the award-winning Web Browser, Opera. Visit us at
http://www.opera.com/ or our portal at: http://www.myopera.com/ Your free e-mail
account is waiting at: http://www.operamail.com/
------------------------------------------------------------


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

On 04/25/01, ““Graham, Simon” ” wrote:
> . Following on to the above; you need to ensure you are running in the
> system process
> context when you create the event - otherwise, when the process in which
> you were
> running dies, the handle to the event gets automatically closed and your
> event will
> quietly disappear (of course, that may be exactly what you want, but it
> wasn’t in
> my case so I got very confused for a while!) My ugly solution to this was
> to queue
> a work item in my open routine (which runs in the context of the user app
> process);
> this work item actually creates the event in the context of the system
> process; yuck!
>

Couldn’t you use ObReferenceObjectByXxx to forcibly increment the reference
count to prevent the system from automatically deleting it?


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Girish,

By far the simplest way to do that is use Readfile, WriteFile, or
DeviceIoControl commands. The driver completes the resulting IRP if it can
or marks it pending and hangs it on a queue. When the IRP is completed or
cancelled the user the receives event notification using
GetOverlappedResult, or WaitForSingleObject, to name a couple of the
functions involved.

Gary

-----Original Message-----
From: Girish Dattatreya Kulkarni
[mailto:xxxxx@wipro.com]
Sent: Tuesday, April 24, 2001 11:07 PM
To: NT Developers Interest List
Subject: [ntdev] How can i communicate with a user
process ?

hi !
i am trying to tell a user process that a particular task
has been completed
in the driver.
i am trying to use Events for this purpose.
i create an event in the driver, and i want to wait on that
event in the
user process.
but i am not able to open the event in the user process.

any ideas ?

thanks
-girish


You are currently subscribed to ntdev as:
xxxxx@delphieng.com
To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

thanks all to everybody who suggested solutions.
ddk\src\general\async sample driver proved to be
really helpful as suggested by Shaun.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@tenpennies.com
Sent: Wednesday, April 25, 2001 12:00 AM
To: NT Developers Interest List
Subject: [ntdev] Re: How can i communicate with a user process ?

Have you looked at the ddk\src\general\async sample driver? It
demonstrates exatly what you are talking about. That being said, depending
on how many user processes you are trying to notify, perhaps you should
simply create an event in user mode and pass the handle to the driver.
This way you do not have to come up with names for all the different types
of events and you can explicitly associate events with particular clients.
If you need an example of this I can dig it up for you.

Shaun
xxxxx@tenpennies.com

On 04/25/01, ““Girish Dattatreya Kulkarni” ”
wrote:
> hi !
> i am trying to tell a user process that a particular task has been
completed
> in the driver.
> i am trying to use Events for this purpose.
> i create an event in the driver, and i want to wait on that event in the
> user process.
> but i am not able to open the event in the user process.
>
> any ideas ?
>
> thanks
> -girish
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@wipro.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@wipro.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com