2009-12-22 6 views
6

존재하지 않는 장치를 에뮬레이션하는 WDM 드라이버를 만들어야합니다. 드라이버는,의 O/S 부팅이 열리고 SetupDiXXXCreateFile를 통해 닫을 때로드해야 DeviceIoControl에 응답해야하는 등하드웨어를 만지지 않는 Windows 드라이버를 어떻게 개발합니까?

내가 코딩 드라이버를 가지고 있지만 XP를로드 거부합니다. 시스템 이벤트 뷰어는 말한다 :

The MyDevice service failed to start due to the following error: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

내가 문제가 INF 파일 (아래 참조)에 생각 감안할. 그렇지? 그것을 고정시키는 방법은 무엇입니까?

 
;; MyDevice.inf 

[Version] 
Signature="$Windows 95$" 

Class=MyDeviceDeviceClass 
ClassGUID={ff646f80-8def-11d2-9449-00105a075f6b} 
Provider=%ProviderName% 
DriverVer= 12/21/2009,1.0.0.1 

[ClassInstall32] 
Addreg=Class_AddReg 

[Class_AddReg] 
HKR,,,,%DeviceClassName% 
HKR,,Icon,,"-18" 

[DestinationDirs] 
MyDevice_Files_Driver = 10,System32\Drivers 


[Manufacturer] 
%MfgName%=Mfg0 

[Mfg0] 
%DeviceDesc%=MyDevice_DDI, *MyDevice 


[MyDevice_DDI] 
CopyFiles=MyDevice_Files_Driver 
AddReg=MyDevice_9X_AddReg 


[MyDevice_DDI.NT] 
CopyFiles=MyDevice_Files_Driver 
AddReg=MyDevice_NT_AddReg 

[MyDevice_DDI.NT.Services] 
Addservice = MyDevice, 0x00000002, MyDevice_AddService 

[MyDevice_AddService] 
DisplayName = %SvcDesc% 
ServiceType = 1 
StartType  = 3 
ErrorControl = 1 
ServiceBinary = %10%\System32\Drivers\MyDevice.sys 

[MyDevice_NT_AddReg] 
HKLM, "System\CurrentControlSet\Services\MyDevice\Parameters","BreakOnEntry", 0x00010001, 0 

[MyDevice_Files_Driver] 
MyDevice.sys 


[Strings] 
ProviderName="Acme" 
MfgName="Acme" 
DeviceDesc="Acme" 
DeviceClassName="Device class for MyDevice" 
SvcDesc="MyDevice NT service" 
+1

대답을 모르지만 Null 모뎀 에뮬레이터 (http://com0com.sourceforge.net/)와 같은 프로젝트는 가능하다는 것을 나타냅니다. 아마도 그 프로젝트를 통해 뭔가를 수집 할 수 있을까요? –

+0

com0com 드라이버는 필자가 필요로하는 것에 가깝지만 솔루션의 100 %는 아닙니다. "새로운 하드웨어 추가"제어판에서 드라이버를 설치해야했습니다. INF를 설치하는 것만으로는 충분하지 않았습니다. – Clay

답변

4

은 자기가 대답

나는 다음을 포함하는 INF 변경 :

[Mfg0] %DeviceDesc%=MyDevice_DDI, *MyDevice\ipm1

은 "\ ipm1"새로운, 내 눈에 약간의 부두. 나는 Chris Cant의 "Writing Windows WDM Device Drvers"에서 예를 들어 설명했다.

큰 변화는 제어판에서 "새 하드웨어 추가"마법사를 사용하여 드라이버를 설치하는 것입니다. 마우스 오른쪽 버튼으로 INF를 설치하는 것만으로는 충분하지 않습니다. 그 이유는 드라이버가 제어 할 하드웨어를 찾지 못하는 PnP 관리자를 호출하기 때문입니다.