|
我的USB function client驱动为什么总被识别为usb printing support?
[复制链接]
我在usbprn驱动的基础上修改了一个USB function client驱动,我发现无论怎么修改VID/PID,连接到pc机上都被识别usb printing support。请问是哪里的问题?
注册表设置如下
[HKEY_LOCAL_MACHINE\Drivers\USB\FunctionDrivers\PassBy]
"idProduct"=dword:00000001
"idVendor"=dword:0000833c
"Index"=dword:00000000
"FriendlyName"="USB Passby:"
"bcdDevice"=dword:00000000
"Product"="USB Passby Driver"
"Manufacturer"="Magnity"
"DeviceName"="PSB1:"
"Dll"="\\NandFlash\\OtgDriver.dll"
"Prefix"="PSB"
Descriptor配置如下:本结构中的 VID/PID/bcd项会根据注册表设置修改
const USB_DEVICE_DESCRIPTOR HighSpeedDeviceDesc =
{
sizeof(USB_DEVICE_DESCRIPTOR), // bLength
USB_DEVICE_DESCRIPTOR_TYPE, // bDescriptorType
USB_VERSION, // bcdUSB
0x00, // bDeviceClass
0x00, // bDeviceSubClass
0x00, // bDeviceProtocol
EP0_PACKET_SIZE, // bMaxPacketSize0
0, // idVendor
0, // idProduct
0x0000, // bcdDevice
0x01, // iManufacturer
0x02, // iProduct
0x03, // iSerialNumber
0x01 // bNumConfigurations
};
Interface配置如下:
const UFN_INTERFACE HighSpeedInterface =
{
sizeof(UFN_INTERFACE),
{
sizeof(USB_INTERFACE_DESCRIPTOR), // bLength
USB_INTERFACE_DESCRIPTOR_TYPE, // bDescriptorType
0x00, // bInterfaceNumber
0x00, // bAlternateSetting
dim(m_HighSpeedEndpoints), // bNumEndpoints
0x00, // bInterfaceClass
0x00, // bInterfaceSubClass
0x00, // bInterfaceProtocol
0x00 // iInterface
},
NULL, // extended
0,
m_HighSpeedEndpoints // endpoint array
};
m_HighSpeedInterface = HighSpeedInterface;
Config配置如下:
const UFN_CONFIGURATION HighSpeedConfig =
{
sizeof(UFN_CONFIGURATION),
{
sizeof(USB_CONFIGURATION_DESCRIPTOR),// bLength
USB_CONFIGURATION_DESCRIPTOR_TYPE, // bDescriptorType
CB_CONFIG_DESCRIPTOR, // wTotalLength
0x01, // bNumInterfaces
0x01, // bConfigurationValue
0x00, // iConfiguration
USB_CONFIG_RESERVED_ATTRIBUTE | USB_CONFIG_SELF_POWERED, // bmAttributes
0x00 // MaxPower
},
NULL,
0x00,
&m_HighSpeedInterface // interface array
};
|
|