我不太明白你的意思,既然主机已经检测到我的usb设备,提示我安装驱动,那么说明我在00 09 01 00 00 00 00 00 之前的程序应该都是正确的,而我现在按照ddk+vc+driverstudio编写的sys和inf文件就是通不过,真是搞不懂,到底我还忽略了那个方面。
;~~~~~~~~~~~~~~~~~~~~~~~~~~~
;设备描述符
;~~~~~~~~~~~~~~~~~~~~~~~~~~~
TAB_DEVICE_DESCRIPTOR:
DB 12H ;size of descriptor
DB 01H ;device descriptor type
DB 10H,01H ;usb specification
DB 0DCH ;device class
DB 00H ;deivice sub class
DB 00H ;device protocol
DB 10H ;MAX packet size
DB 071H,04H ;id vendor C4H,07H, 5EH,04H
DB 66H,06H ;product ID 00H, 0A4H
DB 00H,01H ;device release 13H,01H
DB 00H ;index of manufacture string
DB 00H ;index of product string
DB 00H ;serial number of string
DB 01H ;Nomber of possible configration
;~~~~~~~~~~~~~~~~~~~~~~~~~~~
TAB_Configration_Descriptor:
DB 09H ;Blength
DB 02H ;descripter type
DB CON_Descripter_Total_length,00H ;total length--2EH
DB 01H ;number of interface
DB Con_configration_Value ;configration Value--01H
DB 00H ;configration string index
DB 040H ;attributes--自供电方式
DB 32H ;max power
;~~~~~~~~~~~~~~~~~~~~~~~~~~~
TAB_Interface_Descriptor:
DB 09H ;length
DB 04H ;descriptor type
DB 00H ;interface number
DB 00H ;alternate setting
DB 04H ;number of endpoint
DB 0DCH ;interface class
DB 0A0H ;interface sub class
DB 0B0H ;interface protocol
DB 00H ;interface index
;~~~~~~~~~~~~~~~~~~~~~~~~~~~
TAB_Endpoint1_output:
DB 07H ; length
DB 05H ; descripter type
DB 81H ; endpoint address output addr=81
DB 02H ; mattributes
DB 10H,00H ; max packet size
DB 10H ; interval
;~~~~~~~~~~~~~~~~~~~~~~~~~~~
TAB_Endpoint1_input:
DB 07H ; length
DB 05H ; descripter type
DB 01H ; endpoint address input addr=01
DB 02H ; mattributes
DB 10H,00H ; max packet size
DB 10H ; interval
;~~~~~~~~~~~~~~~~~~~~~~~~~~~
TAB_Mainoint_output:
DB 07H ; length
DB 05H ; descripter type
DB 82H ; endpoint address output addr=82
DB 02H ; mattributes 02H ÅúÁ¿´«Êä
DB 40H,00H ; max packet size
DB 10H ; interval
;~~~~~~~~~~~~~~~~~~~~~~~~~~~
TAB_Mainoint_input:
DB 07H ; length
DB 05H ; descripter type
DB 02H ; endpoint address input addr=02
DB 02H ; mattributes 02H ÅúÁ¿´«Êä
DB 40H,00H ; max packet size
DB 10H ; interval
根据这些描述符,我在编写驱动的时候,设置如图:
在IOCTL上添加了一个测试函数,加入的代码
PURB pUrb=m_Lower.BuildVendorRequest(
NULL,
0,
0,
0,
0
);
status=m_Lower.SubmitUrb(pUrb,NULL,NULL,5000L);