阅读:1484回复:5
USBD_CreateConfigurationRequest????
USBD_CreateConfigurationRequest的使用方法,同时帮忙解释一下调用参数和返回值!
谢谢!!! |
|
|
沙发#
发布于:2003-06-05 12:09
建议不要用这个函数,用USBD_CreateConfigurationRequestEx(),下面是msdn中的解释:
USBD_CreateConfigurationRequestEx allocates and formats an URB to select a configuration for a USB device. PURB USBD_CreateConfigurationRequestEx( IN PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, IN PUSBD_INTERFACE_LIST_ENTRY InterfaceList ); Parameters ConfigurationDescriptor Points to a configuration descriptor, that includes all interface, endpoint, vendor, and class-specific descriptors, retrieved from a USB device. InterfaceList Points to the first element, in a variable-length array of the following structures, that describes interfaces to be made part of the configuration request: typedef struct _USBD_INTERFACE_LIST_ENTRY { PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor; PUSBD_INTERFACE_INFORMATION Interface; } USBD_INTERFACE_LIST_ENTRY, *PUSBD_INTERFACE_LIST_ENTRY; The USBD_INTERFACE_LIST_ENTRY structure has the following members: InterfaceDescriptor Points to a interface descriptor returned from the device as part of a configuration descriptor. Interface Points to memory containing information about the interface and all of the endpoints associated with that interface. 使用方法如下: USBD_INTERFACE_LIST_ENTRY interfaceList[2]; urb = USBD_CreateConfigurationRequestEx(ConfigurationDescriptor, &interfaceList[0]); 其中第一个参数是你已经获得的配置描述符,其中包含接口和端点描述符,第二个参数是存放搜索到的接口和端点描述符的结构,具体定义可以参考msdn或者ddk的帮助。 |
|
板凳#
发布于:2003-06-05 12:51
但是我需要使用这个函数,这个函数第一个参数可以理解,但是第二个参数不知道做什么用!请帮帮忙!
|
|
|
地板#
发布于:2003-06-05 13:37
这个函数比较陈旧了,MSDN和DDK的帮助上都没有说明,而且都建议用USBD_CreateConfigurationRequestEx()代替,
你要是一定要用这个的话,我看过这个函数的使用例子,用法如下: urb = USBD_CreateConfigurationRequest(ConfigurationDescriptor, &siz); 第二个参数里存放的是等号左边urb的长度,这个长度后面需要使用,比如: UsbBuildSelectConfigurationRequest(urb,(USHORT) siz, ConfigurationDescriptor); 里面的第二个参数就是从前面那个函数得到的。 |
|
地下室#
发布于:2003-06-05 14:48
多谢多谢!大佬就是厉害!!
多多交流! |
|
|
5楼#
发布于:2003-06-05 16:35
老大,看过micosoft的umss驱动例程吗?
我现在不明白他的cbi和bulkonly怎么和派遣例程挂接的,希望你能讲一讲! 谢谢啦!一定给分!!! |
|
|