How can I develop a Windows driver that is not hardware related?

I need to create a WDM driver that emulates a device that is not there. The driver must be loaded when O / S is loaded, opened and closed via SetupDiXXX and CreateFile , it must respond to DeviceIoControl , etc.

I have a driver, but XP refuses to download it. System Event Viewer says:

The MyDevice service could not start because of the following error: the service cannot be started, either because it is disconnected or because it has no connected devices connected to it.

Given this, I think the problem is in the INF file (link below). It? How can I fix it?

  ;;  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"
+6
windows inf wdk
source share
1 answer

Answer:

I changed INF to include the following:

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

"\ ipm1" is new and a little voodoo in my eyes. I got it from the example in Chris Kent "Writing Windows WDM Device Drivers."

The big change is using the Add New Hardware wizard from the control panel to install the driver. Right-clicking on the INF setting is not enough. I suspect the reason is that it calls the PnP manager, which does not correctly find the driver management hardware.

+4
source share

All Articles