Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Sept/Oct 2019 Issue of The NT Insider available

Download PDF here:

It’s a particularly BIG issue, too: 40 pages of technical goodness, ranging from WDF to Minifilters. Check it out.
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

How to differentiate between multiple interfaces created a single PDO?.

Ramakrishna_SaripalliRamakrishna_Saripalli Member Posts: 30

I have a KMDF PCI function driver. The FDO exposes 2 interfaces (one for regular IOCTL and read/write and another for some hardware dependent features like FW upgrade). Both interfaces are exposed with one GUID but 2 reference strings

So I am calling WdfDeviceCreateDeviceInterface(FDO, &GUID, ref1) followed by WdfDeviceCreateDeviceInterface(FDO, &GUID, ref2). Both seem to succeed just fine.
First interface supports IOCTLs + Read/Write and the 2nd one also supports IOCTLs and read write. The IOCTL address space is different between the 2 interfaces. The Read/write functionality is also different

When the application dispatches IOCTLs, obviously since I only have one single DeviceControl entry point, in my Ioctl entry point (which I have created using a Sequential queue) how do I differentiate in the driver between the 2 interfaces that are exposed to the application?

Another question. If instead of using reference strings, I use 2 separate GUIDs but on the same FDO, how would I differentiate in the driver between the 2 interfaces?.

It looks like there is more than one obvious way of doing this.
a) I can use WdfFileObjectGetFileName() in my CreateAdd() method (where I have the FileObject) to get the reference string to differentiate between the 2. This is probably good enough for the first variation above but it does not work for the 2nd variation where I want to use one GUID for each interface

b) I was thinking WdfDeviceRetrieveDeviceInterfaceString can also be used but I am not so sure now whether it will help me differentiate between the 2 interfaces.

My user mode code is fine. It is able to use SetupApi to discover the full paths to the interfaces and do a CreateFile

Any suggestions would be appreciated.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 21 Oct 2019 OSR Seminar Space & ONLINE
Internals & Software Drivers 18 Nov 2019 Dulles, VA
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 27 Apr 2020 OSR Seminar Space & ONLINE