2013-01-16 13 views
2

파일 작업을 기록하고 특정 파일 작업을 차단하기 위해 Windows 7에 MTP 장치 용 필터 드라이버를 쓰려고합니다. Windows에서 MTP를 처리하는 드라이버는 WpdMtpDr.dll 인 UMDF 드라이버이며, WpdMtpDr.dll을 함수 드라이버로 처리 할 때이 example (UMDF 함수 드라이버 위의 샘플 UMDF 필터 드라이버)에 따라 UMDF 필터 드라이버를 작성했습니다. 또한 드라이버가 위 또는 아래 필터로 설치되었는지 확인하기 위해 참조로 this을 사용했습니다. dpinst.exe를 사용하여 드라이버를 설치했습니다. 아래는 나의 INF 파일입니다.MTP 장치 용 UMDF 필터 드라이버

설치에 오류가 없었지만 MTP 장치 (삼성 Galaxy S3)를 연결할 때 필터 드라이버가 드라이버 목록 (장치 관리자를 통해 보임)에 없었으며 해당 DllMain이 호출되지 않았습니다.

나는 아래쪽과 위쪽 필터 사이를 전환하려고 시도했지만 어느 쪽도 도움이되지 못했습니다.

내가 뭘 잘못하고 있니?

; 
; umdffilter.inf 
; 

[Version] 
Signature="$Windows NT$" 
Class=WPD 
ClassGuid={EEC5AD98-8080-425f-922A-DABF3DE3F69A} 
Provider=%ManufacturerName% 
CatalogFile=umdffilter.cat 
DriverVer=01/02/2013,18.8.52.851` 

[Manufacturer] 
%ManufacturerName%=Standard,NTamd64 

[Standard.NTamd64] 
%DeviceName%=MyDevice_Install, usb\vid_04e8&pid_6860 

[SourceDisksFiles] 
umdffilter.dll=1 
WudfUpdate_01011.dll=1 
WdfCoInstaller01011.dll=1 
WinUsbCoinstaller2.dll=1 

[SourceDisksNames] 
1 = %DiskName% 

; =================== UMDF Filter Driver ================================== 

[MyDevice_Install.NT] 
CopyFiles=UMDriverCopy 
Include=wpdmtp.inf, WINUSB.INF   ; Import sections from wpdmtp.inf and WINUSB.INF 
Needs=WPD.MTP, WINUSB.NT    ; Run the CopyFiles & AddReg directives for wpdmtp.inf and WINUSB.INF 

[MyDevice_Install.NT.hw] 
Include = wpdmtp.inf 
Needs = WPD.MTP.Registration 
AddReg = MyDevice_AddReg 

[MyDevice_Install.NT.Services] 
AddService=WUDFRd,0x000001fa,WUDFRD_ServiceInstall ; flag 0x2 sets this as the service for the device 
AddService=WinUsb,0x000001f8,WinUsb_ServiceInstall ; this service is installed because its a filter. 

[MyDevice_Install.NT.CoInstallers] 
CopyFiles=CoInstallers_CopyFiles 
AddReg=CoInstallers_AddReg 

[MyDevice_Install.NT.Wdf] 
Include = wpdmtp.inf 
Needs = WPD.MTP.Wdf 
KmdfService=WINUSB, WinUsb_Install 
UmdfService=umdffilter,umdffilter_Install 
UmdfServiceOrder=umdffilter,WpdMtpDriver ; upper filter 

[WinUsb_Install] 
KmdfLibraryVersion=1.11 

[WpdMtpDriver_Install] 
UmdfLibraryVersion=1.11.0 

[umdffilter_Install] 
UmdfLibraryVersion=1.11.0 
ServiceBinary=%12%\UMDF\umdffilter.dll 
DriverCLSID={8cec927c-219a-4777-baea-8626d6a0ce50} 

[MyDevice_AddReg] 
HKR,,"LowerFilters",0x00010008,"WinUsb" ; FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND 

[WUDFRD_ServiceInstall] 
DisplayName = %WudfRdDisplayName% 
ServiceType = 1 
StartType = 3 
ErrorControl = 1 
ServiceBinary = %12%\WUDFRd.sys 
LoadOrderGroup = Base 

[WinUsb_ServiceInstall] 
DisplayName  = %WinUsb_SvcDesc% 
ServiceType  = 1 
StartType  = 3 
ErrorControl = 1 
ServiceBinary = %12%\WinUSB.sys 

[CoInstallers_CopyFiles] 
WdfCoInstaller01011.dll 
WudfUpdate_01011.dll 
WinUsbCoinstaller2.dll 

[CoInstallers_AddReg] 
HKR,,CoInstallers32,0x00010000,"WudfUpdate_01011.dll", "WinUsbCoinstaller2.dll", "WdfCoInstaller01011.dll,WdfCoInstaller" 

[DestinationDirs] 
UMDriverCopy=12,UMDF  ; copy to drivers\umdf 
CoInstallers_CopyFiles=11 ; copy to system32 

[UMDriverCopy] 
umdffilter.dll 

; =================== Generic ================================== 

[Strings] 
ManufacturerName="Me" 
ClassName="Samples" ; TODO: edit ClassName 
DiskName = "umdffilter Installation Disk" 
WinUsb_SvcDesc="WinUSB Driver" 
WudfRdDisplayName="Windows Driver Foundation - User-mode Driver Framework Reflector" 
DeviceName="umdffilter Device"` 
+0

분명히 UMDF 필터는 타사 드라이버로 설치할 수 없습니다. 이는 공급 업체 패키지의 일부로 설치하기위한 것입니다. 특히 Samsung Galaxy S3에서 장치가 시작되지 않게했습니다 (코드 10). – oren671

답변

1

@ oren671 : UMDF 필터 드라이버를 상단 필터로 MTP 스택에 설치할 수 있어야합니다. 위의 동일한 inf를 사용하여 시도했는데 wpdmtp.inf 'WPD.MTP.Wdf'섹션 (DDInstall.Wdf의 Include/Needs 참조)에서 이미 포함되어 있으므로 inf에 정의 된 WpdMtpDriver_Install 섹션에서 오류가 발생한다는 것을 알았습니다. % 시스템 드라이브 % \ WINDOWS \ setupact.log를 발견

오류 : "... 오류 읽기 섹션 [WpdMtpDriver_Install] 키 UmdfLibraryVersion - ... 발견 키를 복제" 시스템 드라이브 % \ WINDOWS \ INF \의 setupapi을 확인하시기 바랍니다. dev.log & % SystemDrive % \ Windows \ setupact.log에 오류가 있습니다.

위의 inf에서 'WpdMtpDriver_Install'섹션을 제거하면 UMDF 필터를 MTP 스택에 설치할 수있었습니다.

inf를 MTP 설정 inf 방향 link으로 수정했습니다. USB 전송을 사용하는 MTP는 WPDF (UMDF)와 WINUSB를 모두 사용하므로 필터 inf의 wpdmtp.inf에서 관련 섹션 (DDInstall, DDInstall.hw, DDInstall.Services, DDInstall.CoInstallers, DDInstall.Wdf)을 포함하면 그들을 복제해야합니다.

; 
; 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"