Eoin,
The simplest way to do this is use an inverted call, there is a good
article on this at http://www.osronline.com/article.cfm?id=94. Now the
article is for a WDM driver, but you can easily deal with this in KMDF.
Basically you have the UMDF driver open the KMDF driver’s device with
Overlapped I/O and send one or more IOCTL’s which get pended in the KMDF
driver. When the KMDF driver has information for the UMDF driver, it
finishs an IOCTL filling in the buffer with the data.
–
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
wrote in message news:xxxxx@ntdev…
> Ok got the whole high perssion timer thing going using
> KeQueryPerformanceCounter(),
>
> But the bulk of my code is wriiten in a UMDF Driver, I have a small KM
> driver that contains the HP timer among other things.
>
> I want The kernel mode driver to pass some data to the user mode driver
> as i cannot ascess it from user mode.
>
> Could u point me in the right direction again please.
>
> Kind Regards
> Eoin Ward
>
> Basically you have the UMDF driver open the KMDF driver’s device with
Overlapped I/O and send one or more IOCTL’s which get pended in the KMDF
driver.
You can do all this using WDF constructs without having to deal with raw
win32 I/O.
You can use a pending request (IWDFDevice::CreateRequest and
IWDFIoTarget::FormatRequest*) that you submit to the default I/O target.
Default I/O target automatically binds to your KMDF device (which is the
next logical device object in the hybrid um/km stack). When your KMDF
driver completes the corresponding request, you will get completion
callback invoked for the pending request in the UMDF driver.
One thing that is different from KMDF/WDM is that UMDF enforces file
object with every request so you will need to create a file
(IWDFDevice::CreateWdfFile, IWDFDriverCreateFile::Close) and keep it
around for the duration of your pending request. You will then pass this
file object when you format the request. (If your pending request is
within the context of application request and you pass Create down to
kernel driver, you can also use the fileobject that comes with the
application request.)
UMDF USB fx2 sample driver does something similar to receive switch
state change notifications by keeping a pending read on the interrupt
pipe, so you can look at that. This sample gets fileobject for the
pending I/O from USB pipe target but default I/O target doesn’t have any
file associated with it, so you will have to do what’s mentioned in the
previous paragraph. Rest of the functionality should be very similar.
HTH,
Praveen