usb cdc设备驱动程序
我有CDC设备。我为他开发了一个驱动程序。 ini文件的一部分:usb cdc设备驱动程序,usb,Usb,我有CDC设备。我为他开发了一个驱动程序。 ini文件的一部分: [ClassInstall32] CopyFiles=ClassInstall.CopyFiles AddReg=ClassInstall.AddReg [ClassInstall.CopyFiles] My_USBDriver.dll,,,0x2000 [ClassInstall.AddReg] HKR,,,,%DEVICEMANAGERCATEGORY% HKR,,Icon,,"102" HKR,,Installer32,
[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
安装程序函数包含以下代码:
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
此代码始终在desctopPC上正常工作,但在系统调用deviceinstallation函数的安装过程中,有时仅在laptopnotebook上工作。这些mashines的操作系统是Windows7。
但是,如果我从progrmcreated for debuggin调用安装函数,这段代码在笔记本电脑和pc机上都能正常工作。
有人对这个问题有想法吗?你说的是台式机和笔记本电脑,但我认为电脑的形状无关紧要。一个是32位操作系统,另一个是64位操作系统?我没有看到64位INF部分。错误代码31表示此设备工作不正常,因为Windows无法加载此设备所需的驱动程序。-机器是否运行64位操作系统?如果是这样,则需要关闭驱动程序签名验证并启用测试签名。我的操作:1 bcdedit/在2 EBOOT 3加载时按f8并选择“不需要驱动程序检查”,但这对我没有帮助。