@oren671: You should be able to install a UMDF filter driver on a MTP stack as an upper filter. I tried using the same inf shared above and found that the WpdMtpDriver_Install section defined in your inf caused an error since it is already included from in wpdmtp.inf 'WPD.MTP.Wdf' section (see Include/Needs under DDInstall.Wdf).
Error found in %SystemDrive%\Windows\setupact.log: "...Error reading section [WpdMtpDriver_Install] key UmdfLibraryVersion - duplicate key found..." Please check SystemDrive%\Windows\Inf\setupapi.dev.log & %SystemDrive%\Windows\setupact.log for failures.
Removing the 'WpdMtpDriver_Install' section from the above inf, I was able to install the UMDF filter on the MTP stack.
I’ve modified the sample inf to use the MTP Setup inf directions link. MTP with USB transport uses both WPD (which is UMDF) and WINUSB, so including the relevant sections (DDInstall, DDInstall.hw, DDInstall.Services, DDInstall.CoInstallers, DDInstall.Wdf) from wpdmtp.inf in your filter inf should eliminate the need to duplicate them.
;
; WUDFOsrUsbFilterOnMTPDriver.inf - Install a UM Filter driver on an MTP device'
;
[Version]
Signature="$Windows NT$"
Class=WPD
ClassGuid={EEC5AD98-8080-425f-922A-DABF3DE3F69A}
Provider=%MSFTUMDF%
DriverVer=02/03/2014,18.8.52.851
CatalogFile=wudf.cat
[Manufacturer]
%MSFTUMDF%=Microsoft,NTamd64
[Microsoft.NTamd64]
%OsrUsbDeviceName%=OsrUsb_Install, USB\VID_04E8&PID_6860&MI_00
%OsrUsbDeviceName%=OsrUsb_Install, USB\VID_04E8&PID_6860
[SourceDisksFiles]
WudfOsrUsbFilter.dll=1
[SourceDisksNames]
1 = %MediaDescription%
; =================== UMDF OSR Filter Driver ==================================
[OsrUsb_Install.NT]
CopyFiles=UMDriverCopy
Include = wpdmtp.inf, WINUSB.INF
Needs = WPD.MTP, WINUSB.NT
[OsrUsb_Install.NT.hw]
Include = wpdmtp.inf
Needs = WPD.MTP.Registration
[OsrUsb_Install.NT.Services]
Include = wpdmtp.inf
Needs = WPD.MTP.Services
[OsrUsb_Install.NT.Wdf]
Include = wpdmtp.inf
Needs = WPD.MTP.Wdf
UmdfService=WudfOsrUsbFilter, WudfOsrUsbFilter_Install
UmdfServiceOrder=WpdMtpDriver, WUDFOsrUsbFilter
[OsrUsb_Install.NT.CoInstallers]
Include = wpdmtp.inf
Needs = WPD.MTP.CoInstallers
[WudfOsrUsbFilter_Install]
UmdfLibraryVersion=1.11.0
DriverCLSID = "{422d8dbc-520d-4d7e-8f53-920e5c867e6c}"
ServiceBinary = "%12%\UMDF\WUDFOsrUsbFilter.dll"
[DestinationDirs]
UMDriverCopy=12,UMDF ; copy to drivers\umdf
[UMDriverCopy]
WudfOsrUsbFilter.dll
; =================== Generic ==================================
[Strings]
MSFTUMDF="Microsoft Internal (WDF:UMDF)"
MediaDescription="Microsoft UMDF OSR USB Sample Device Installation Media"
OsrUsbDeviceName="Microsoft UMDF OSR Usb Sample Device With Filter on User-mode Driver"