Hello.
I am upgrading our usb drivers to UMDF (because of 64 bit support and faster work with a simple toolkit), which was easy in the beginning (thanks to the fx2 example), but I am now hanging on the interprocess communication between application and driver.
Driver installs without problems, is found with SetupDiGetClassDevs(), and is accessible through File operation (CreateFile, ReadFile, …). Read and Write operates directly on the both available bulk pipes.
The difficulty is now to upgrade the implementation for handling the interrupt pipe respectively inform the application about (surprised) removed devices. In the old drivers we transfer three handles per DeviceIoControl to the driver, which are then used to inform the application about specific tasks. The handles are duplicated with ObReferenceObjectByHandle() and later signaled by KeSetEvent().
Following things I have tested in the new implementation (and all of them failed):
-
To use the handles directly. Gives ERROR_INVALID_HANDLE because of complete other process the driver is running.
-
Use DuplicateHandle. Tried to transfer also the PID of the application will result in ERROR_ACCESS_DENIED for OpenProcess() of the app-PID called in driver.
-
Use a global Event. Call CreateEvent(…, “Global\UNIQUE_NAME”) in application and call then also in driver results also in ERROR_ACCESS_DENIED.
-
Use old Kernel Mode Driver implementation. Tried to use ObReferenceObjectByHandle() from kernel implementation (was difficult, because headers “wudfddi.h” and “wdm.h” are NOT compatible!), this needs linking of the Ntoskrnl.lib and therefore the driver dll has a dependency to NTOSKRNL.EXE. This makes the driver dll not loading successfully on the target platform.
I am at one’s wits’ end. ![]()
My Questions:
-
Is there a possibility besides the preferred way of intercommunication (as to use pending events, forward to other io queues and use overlapped file communication)?
-
What is the expected way to inform the application about (surprise) removal of devices or other malfunctions? And how should it be handled by the application? (I found nothing to this topic in the wddk help).
Many thanks in advance,
Tristan.