UMDF drivers can receive and send asynchronous I/O. We follow the WDF I/O target model and allow you to issue multiple outstanding operations. Asynchronous completion of I/O you send through the I/O target is handled using completion ports and a thread pool which retrives the OVERLAPPED structure, finds the associated request and invokes your completion routine.
The installation details are in the WDK and in the WDF book. UMDF drivers install through INFs like kernel-mode drivers. You put our reflector on the device stack in the right spot for your design, then use UMDF specific directives to install your user-mode drivers and setup your user-mode driver list. Your INF invokes our coinstaller which installs UMDF if it’s not present and interprets the UMDF specific directives. There isn’t any limit on what you can attach to (as long as the user-mode drivers are the top drivers) - if there’s a PNP device node you can attach to it.
As to the specific examples you cite … for SCSI pass-through I would install on the PDO for the SCSI LUN and then issue pass-through i/o controls through the default I/O target. For serial port you may be able to load your driver on top of the serial port … I’ve never tried that but I think one other team has … or create a root-enumerated device manually and then open \.\COMn to get at the serial port.
I think one thing that’s not clear is how your driver finds the device. In general you rely on PNP for that, by loading in the stack just like any PNP driver would. Hopefully that should also answer your question about the root-enumerated device as well.
-p
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Michal Vodicka
Sent: Friday, November 16, 2007 4:03 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] UMDF questions
From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Peter Wieland[SMTP:xxxxx@windows.microsoft.com]
Reply To: Windows System Software Devs Interest List
Sent: Saturday, November 17, 2007 12:13 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] UMDF questions
UMDF uses the COM programming pattern (reference counted interfaces). It doesn’t use the COM runtime - no registration, no weird memory allocators, etc…
Glad to know. I have nothing against reference counted interface (invented some :); I was worrying about the rest hearing horror stories from my user mode coworkers ![:slight_smile: :slight_smile:](/images/emoji/twitter/slight_smile.png?v=12)
A UMDF driver has to be loaded on a PNP device stack, so whatever you talk to needs some sort of enumerator. However once that’s done it can communicate with other drivers in the following ways:
- When attached to a USB device stack it can use the USB I/O target to talk to control/bulk/interrupt pipes on that device (no isoch).
Are there any limitation against kernel mode driver related to asychrounous I/O? In our case the only way how to achieve necessary performance for USB devices is to have several bulk-in URBs always queued and processed by seperate thread.
- When attached to a device stack that accepts read/write/ioctl (not internal IOCTL) it can use the default I/O target to send those to the lower drivers.
Is it possible to attach any device stack accepting read/write/ioctl or are there some limitations? If yes, it would be sufficient for one case (3rd party driver). How to make this relation? I presume it would have to be made at UMDF driver installation time.
- Sometimes the enumerator may not provide any I/O path. The simplest example is a root-enumerated device. Another is an IP connected device, which is enumerated by UMBUS but must be accessed through sockets. Here you have two options:
3a) You can open a handle to the device and then use our Win32 I/O target to send read/write/ioctl requests to the device even though it’s not in your stack.
It would be the case for SCSI passthrough devices I guess.
3b) You can use other Win32 APIs, say WinSock, to communicate with your device.
I presume serial line which uses more Win32 APIs would need this.
If you already have an application that can talk to your device then you should be able to write a user-mode driver that does the same things the app does.
This is exactly what I’d need.
If I understand correctly, the only real problem is the enumerator. Can you elaborate this part more? There should be one UMDF device per real device instance. I’m not sure if it is possible to achieve using root enumerated device i.e if it is possible to make a dependency on existing devices. Currently, application uses Setup API to enumerate available interfaces or accesses devices based on configuration or user input (for example, user attaches device to COM1 and gives app parameters which says this, speed and so on).
Best regards,
Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer