- Send User Handle to Driver
- Posted by Tamar on November 29th, 2007
Hello
I want to send a user handle to my driver.
Try to use METHOD_BUFFERED io_ctl, but seems that the IoDeviceControl
callback function is not called, when init nInBufferSize ( DeviceIoControl
4th parameter).
What is the correct way to do that?
Thanks
Tamar
- Posted by Doron Holan [MSFT] on November 29th, 2007
first, why do you think you need to send a handle to the driver? a handle
is only valid in the context of the process that created it and the driver
will execute in many contexts that are not the calling process, making the
handle invalid. second, post your user mode code which is sending the
handle value, i am guessing there is an error there.
d
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Tamar" <Tamar@discussions.microsoft.com> wrote in message
news:F0347093-2779-4BFD-A5C5-2839CAC69B73@microsoft.com...
- Posted by Tamar on December 6th, 2007
Driver has to notify the application about HW event .
Thought to send user initialize event , and the driver set the event each
time the hardware event occur.
What is the correct way to do that?
Thanks in advance
"Doron Holan [MSFT]" wrote:
- Posted by Don Burn on December 6th, 2007
Events are a terrible way to do this, since if the application does not act
quickly enough you lose an event. Also, if there is data associated with
the hardware event, using an event adds to the overhead. Take a look at
inverted call's http://www.osronline.com/article.cfm?id=94 this is the
common approach to solving this.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
"Tamar" <Tamar@discussions.microsoft.com> wrote in message
news:19189D94-8921-4071-ADAA-137BC8286BF9@microsoft.com...
- Posted by Maxim S. Shatskih on December 6th, 2007
Pending IOCTL IRP is the better way.
To pass user event handle to the driver (also possible way), call
ObReferenceObjectByHandle(Irp->RequestorMode, *ExEventObjectType) in the driver
dispatch routine. This will give you KEVENT pointer.
Do not forget to ObDereferenceObject it later.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
"Tamar" <Tamar@discussions.microsoft.com> wrote in message
news:19189D94-8921-4071-ADAA-137BC8286BF9@microsoft.com...