Installing UMDF2 Device Filter Driver

How would i install a UMDF2 Device (not class) Filter driver for an existing device.

An inf is not appropriate (being a device filter), so i figure i need to directly add the filter via the registry and power cycle the port

It seems i need to add the LowerFilter (or UpperFilter) REGMULTISZ of WUDFRd and then somehow add values under WUDF key under Device Parameters ? So WUDFRd knows what to do.

Ive tried this but the device would start saying invalid registry entry. There seems to be no documented way to add a UMDF2 Device Filter?

Device filters are typically installed with an INF. Especially with UMDF where the install sets up UMDF properties properly. What is the minimum OS you are targeting? If win10, the INF can simply be an extension INF and you don’t need to duplicate the FDO’s INF.

Windows 10

Essentially my UMDF2 filter is a LowerFilter of WINUSB. (I need this filter work around WinUSB limitations, e.g 4k control limit etc.)

Can UMDF2 filter go below WinUSB?

I don’t think it can as umdf doesn’t know how to marshal the URB into user mode. You should use a KMDF filter. Look into installing your lower filter with an extension INF.

Hmm … I wasn’t aware that any kind of filter driver was possible in UMDF, since everything has to go through the reflector and everything I might want to filter (USB, network, file system, storage device) has it’s stack in kernel space anyway …

What kind of stacks could I filter in UMDF?

OK that is unfortunate, i was hoping to keep it all userspace. Is there are reason why winusb is limited to 4k control transfers?

Control transfers are the least efficient of all USB transfer types. A 4k transfer has to get chopped up into 64 individual packets, each of which has to be scheduled individually. If you need to transfer that much data you should be using a bulk pipe anyway.

Agreed, however the spec can support up to 64k in length, anyway Ive optimistically added it to Microsoft Q&A as an enhancement request :slight_smile: