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

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.

Thanks
Rama