Jump-start your project by learning from devs who
write Windows drivers and file systems every day.
Take an OSR seminar!

OSR is Hiring! Click here to find out more.

Upcoming OSR Seminars:
Kernel Debugging & Crash Analysis Lab, Palo Alto, CA 18-22 August, 2014
Writing WDF Drivers for Windows Lab, Boston/Waltham, MA 22-26 September, 2014
Windows Internals & Software Drivers Lab, Dulles/Sterling, VA, 20-24 October, 2014
Developing File Systems for Windows, Seattle, WA 4-7 November, 2014


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 9  
17 Nov 06 09:48
Lucas Bracher
xxxxxx@yahoo.com
Join Date: 16 Nov 2006
Posts To This List: 30
Beginner - How to communicate to a UMDF driver from my application?

Hi there! I´m very confused about communications between my application and my driver, that was build under Microsoft UMDF 1.0. Should I comm using CreateFile, WriteFile and ReadFile, likewise former frameworks? Thank you so much! Lucas M. Bracher __________________________________________________ Fale com seus amigos de graça com o novo Yahoo! Messenger http://br.messenger.yahoo.com/ --
  Message 2 of 9  
17 Nov 06 10:18
ntdev member 31002
xxxxxx@microsoft.com
Join Date:
Posts To This List: 539
Beginner - How to communicate to a UMDF driver from my application?

That, and DeviceIoControl (if you defined and used IOCTLs). --
  Message 3 of 9  
17 Nov 06 12:42
Lucas Bracher
xxxxxx@yahoo.com
Join Date: 16 Nov 2006
Posts To This List: 30
Beginner - How to communicate to a UMDF driver from my application?

Ok. And how I can "wake up" my application to send data from driver to application? Same way I make callbacks in dlls? Thanks! Bob Kjelgaard <xxxxx@microsoft.com> escreveu: That, and DeviceIoControl (if you defined and used IOCTLs). --- Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer --------------------------------- Yahoo! Search Música para ver e ouvir: You're Beautiful, do James Blunt --
  Message 4 of 9  
17 Nov 06 12:46
Chris Aseltine
xxxxxx@gmail.com
Join Date: 23 Sep 2006
Posts To This List: 1113
Beginner - How to communicate to a UMDF driver from my application?

Lucas Bracher wrote: > Ok. And how I can "wake up" my application to send data > from driver to application? Same way I make callbacks in dlls? Just pend some IOCTLs inside your driver, and when you need to communicate something back to userspace, complete them.
  Message 5 of 9  
17 Nov 06 13:15
ntdev member 31002
xxxxxx@microsoft.com
Join Date:
Posts To This List: 539
Beginner - How to communicate to a UMDF driver from my application?

Your driver and the application reside in separate address spaces, so callbacks of this sort aren't generally something to attempt. Not that people don't at least try to cheat that principle on occasion... One way of accomplishing this is to have a "wait for input" IOCTL that the app sends to the driver. The driver pends it until input is ready, then completes it, perhaps with some details as to how much is available (on an IOCTL you can define the input and output blocks, so this is usually plenty of flexibility for this sort of a need). The serial driver sample in the DDK/WDK uses this approach. Your app thread can basically just synchronously send this, and do the I/O after it returns. IN practice, you usually add some timeout and cancellation logic on both ends of that, but I believe the sample shows a fine way to handle that. Another is to signal this with a notification event. There is a DDK sample (or used to be, anyway) that illustrates this. I've used this approach along with a shared buffer mapped between the address spaces on occasion, so it can be made to work. But the IOCTL approach is easier to follow and maintain [and will raise a lot fewer eyebrows], so I'd recommend it as the better way to do this. I don't believe UMDF directly supports user-mode only callbacks from the UMDF driver to your app, but if they do, someone who knows more about it than I do should say so.
  Message 6 of 9  
17 Nov 06 13:28
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 9020
Beginner - How to communicate to a UMDF driver from my application?

UMDF does not support a callback back into the calling process. The pattern in UMDF is the same, you send the driver an IOCTL, the driver pends it and is completed when the "event" occurs. d -----Original Message----- From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Bob Kjelgaard Sent: Friday, November 17, 2006 10:15 AM To: Windows System Software Devs Interest List Subject: RE: [ntdev] Beginner - How to communicate to a UMDF driver from my application? Your driver and the application reside in separate address spaces, so callbacks of this sort aren't generally something to attempt. Not that people don't at least try to cheat that principle on occasion... One way of accomplishing this is to have a "wait for input" IOCTL that the app sends to the driver. The driver pends it until input is ready, then completes it, perhaps with some details as to how much is available (on an IOCTL you can define the input and output blocks, so this is usually plenty of flexibility for this sort of a need). The serial driver sample in the DDK/WDK uses this approach. Your app thread can basically just synchronously send this, and do the I/O after it returns. IN practice, you usually add some timeout and cancellation logic on both ends of that, but I believe the sample shows a fine way to handle that. Another is to signal this with a notification event. There is a DDK sample (or used to be, anyway) that illustrates this. I've used this approach along with a shared buffer mapped between the address spaces on occasion, so it can be made to work. But the IOCTL approach is easier to follow and maintain [and will raise a lot fewer eyebrows], so I'd recommend it as the better way to do this. I don't believe UMDF directly supports user-mode only callbacks from the UMDF driver to your app, but if they do, someone who knows more about it than I do should say so. --- Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
  Message 7 of 9  
18 Nov 06 09:47
Lucas Bracher
xxxxxx@yahoo.com
Join Date: 16 Nov 2006
Posts To This List: 30
Beginner - How to communicate to a UMDF driver from my application?

Sorry, I tried to understand this approach, but I couldn´t (maybe due to my little experience). Where I can find a example about pending IOCTL? Thank you so much! :) Lucas. xxxxx@gmail.com escreveu: Lucas Bracher wrote: > Ok. And how I can "wake up" my application to send data > from driver to application? Same way I make callbacks in dlls? Just pend some IOCTLs inside your driver, and when you need to communicate something back to userspace, complete them. --- Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer --------------------------------- Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora! --
  Message 8 of 9  
18 Nov 06 10:07
Don Burn
xxxxxx@acm.org
Join Date:
Posts To This List: 3179
Beginner - How to communicate to a UMDF driver from my application?

The following is a good reference for the concept http://www.osronline.com/article.cfm?id=94 the examples here are for a stock Windows driver (no framework), you will need to apply this to UMDF by having a queue that you take a reqest off of when you need to communicate with the application. -- Don Burn (MVP, Windows DDK) Windows 2k/XP/2k3 Filesystem and Driver Consulting http://www.windrvr.com Remove StopSpam from the email to reply "Lucas Bracher" <xxxxx@yahoo.com> wrote in message news:84282@ntdev... > Sorry, I tried to understand this approach, but I couldn´t (maybe due to > my little experience). Where I can find a example about pending IOCTL? > > Thank you so much! :) > > Lucas. > > xxxxx@gmail.com escreveu: Lucas Bracher wrote: > >> Ok. And how I can "wake up" my application to send data <...excess quoted lines suppressed...>
  Message 9 of 9  
20 Nov 06 00:26
ntdev member 8437
xxxxxx@windows.microsoft.com
Join Date:
Posts To This List: 1404
Beginner - How to communicate to a UMDF driver from my application?

The UMDF OSR-FX2 driver (src\umdf\usb\fx2_driver\final) does this for the I/O control which waits for the state of the DIP switches to change. -p From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Lucas Bracher Sent: Saturday, November 18, 2006 6:47 AM To: Windows System Software Devs Interest List Subject: RE:[ntdev] Beginner - How to communicate to a UMDF driver from my application? Sorry, I tried to understand this approach, but I couldn?t (maybe due to my little experience). Where I can find a example about pending IOCTL? Thank you so much! :) Lucas. xxxxx@gmail.com escreveu: Lucas Bracher wrote: > Ok. And how I can "wake up" my application to send data > from driver to application? Same way I make callbacks in dlls? Just pend some IOCTLs inside your driver, and when you need to communicate something back to userspace, complete them. --- Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer ________________________________ Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora! <http://us.rd.yahoo.com/mail/br/tagline/mobile_alerts/*http:/br.mobile.yahoo.com/ mailalertas/> --- Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer --
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 22:08.


Copyright ©2014, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license