WPD Upper Filter causing MTP device installation fail

3.3k Views Asked by At

I've been writing a KMDF filter driver for WPD (Portable Devices) class (based on example in http://www.osronline.com/article.cfm?article=446). The driver purpose is the block write requests to the device.
I set it up in the registry in UpperFilters for WPD class, and when plugging in Samsung Galaxy S3, I was able to catch the WPD IOCTLs sent to the device (currently the driver does nothing but forwarding the request to the next driver). So far so good.
I then installed Samsung Kies to see if the filter driver still works, but when I plugged in the device, Windows tried to install the "Samsung Mobile MTP Device" and failed. I tried it several times (I verified the driver is still installed, and this is not a missing driver issue). When I removed my driver from the UpperFilters, the device was installed and working. When I put the filter back, the device failed to start (code 10). Using Windbg I can see that my driver starts, device is added, and then the driver unloads (I don't know what happens in the middle...)
When I tried to put it as a lower filter, it again worked fine.
While searching the net, I found out it also happens when using WDM and not WDK.

Why is putting UpperFilter causing the device to fail to start in this case?
Is there a way to resolve it?

2

There are 2 best solutions below

1
On

Have you tried other devices to see if this is specific to the Samsung?

Also, this looks like something introduced by the Samsung Kies software, perhaps they are installing another filter driver. You can find this out by inspecting %windir%\inf\setupapi.dev.log to see if there are driver entries related to Kies or Samsung.

0
On

Oren, What machine are you testing your code on? Can you describe in general terms what your code actually does?

I am using the same sample as a baseline for my project and it's working fine for me as an upper-filter driver on top of a GS3 - with Kies installed - on a VMWare running Win7/32.

Most importantly - which class did you add your driver as an upper filter to?

I added mine over HKLM\XxXControlSet\Control\Class{EEC5AD98-8080-425F-922A-DABF3DE3F69A} and it's running smoothly over the GS3.

Did you use the installer app in the sample to install the driver/service?

good luck Uriel