0
我有CDC设备。我为他开发驱动程序。 ini文件的 部分:usb cdc设备驱动程序
[ClassInstall32]
CopyFiles=ClassInstall.CopyFiles
AddReg=ClassInstall.AddReg
[ClassInstall.CopyFiles]
My_USBDriver.dll,,,0x2000
[ClassInstall.AddReg]
HKR,,,,%DEVICEMANAGERCATEGORY%
HKR,,Icon,,"102"
HKR,,Installer32,,"My_USBDriver.dll,MyUSBPortsClassInstaller"
HKR,,NoInstallClass,,1
[DriverInstall]
include=mdmcpq.inf
CopyFiles=DriverInstall.CopyFiles
AddReg=DriverInstall.AddReg
[DriverInstall.CopyFiles]
usbser.sys,,,0x2000
[DriverInstall.AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
[DriverInstall.Services]
AddService=usbser, 0x00000002, DriverService
[DriverService]
DisplayName=%SERVICE%
ServiceType=1
StartType=3
ErrorControl=1
ServiceBinary=%12%\%DRIVERFILENAME%.sys
安装功能有码:上desctop(PC)总是
c->ConnectionIndex = iPort;
c->SetupPacket.bmRequest = 0x80;
c->SetupPacket.wValue = (USB_STRING_DESCRIPTOR_TYPE<<8)|descriptorNum;
c->SetupPacket.wLength = n;
Success = DeviceIoControl(
hRoot,
IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION,
c, n,
c, n,
&returnBytes,
NULL);
///Sometime GetLastError == 31 // Device not working
此代码正常工作,但在安装设备时在笔记本电脑(笔记本)只有一段工作(由系统调用的安装功能)。这些mashines的操作系统是Windows7。 但是如果我从我的程序调用安装功能(为调试创建)此代码始终正常工作(在笔记本电脑和PC上)。 有没有人有关于这个问题的想法?
错误代码31表示“此设备无法正常工作,因为Windows无法加载此设备所需的驱动程序。” - 机器是否运行64位操作系统?如果是这样,它需要关闭驱动程序签名验证并启用测试签名。 – Polynomial 2012-02-21 13:21:09
我的动作:1)bcdedit/set testsigning 2)重新启动3)在载入时按f8并选择不需要驱动程序检查但这没有帮助我。 – user1025874 2012-02-22 04:50:06