I want to change interface setting, and the code as below:

PURB urb;
USBD_CONFIGURATION_HANDLE hConfig;
PUSB_CONFIGURATION_DESCRIPTOR pcd;
USBD_INTERFACE_LIST_ENTRY interfaces[4];
PUSB_INTERFACE_DESCRIPTOR pid;
PURB pUrbSelIntf = NULL;


...
urb = USBD_CreateConfigurationRequestEx(pcd, interfaces);
status = SendUrb (Adapter, selurb);
hconfig = selurb->UrbSelectConfiguration.ConfigurationHandle;
..


pUrbSelIntf = (PURB)ExAllocatePool(NonPagedPool,
GET_SELECT_INTERFACE_REQUEST_SIZE(pid->bNumEndpoints));

UsbBuildSelectInterfaceRequest(pUrbSelIntf,
GET_SELECT_INTERFACE_REQUEST_SIZE(pid->bNumEndpoints),
hconfig,
0,
1);

status = SendUrb (Adapter, pUrbSelIntf);


but when I submit the pUrbSelIntf, OS bring blue screen. why? How can I do
this?

Tks!

Re: about URB_FUNCTION_SELECT_INTERFACE by Doron

Doron
Mon May 05 12:24:38 CDT 2008

callstack and output of !analyze -v would help

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.


"Jeff" <Jeff@discussions.microsoft.com> wrote in message
news:F8D5E1DE-62E0-4A97-9493-3633E0C772A4@microsoft.com...
>I want to change interface setting, and the code as below:
>
> PURB urb;
> USBD_CONFIGURATION_HANDLE hConfig;
> PUSB_CONFIGURATION_DESCRIPTOR pcd;
> USBD_INTERFACE_LIST_ENTRY interfaces[4];
> PUSB_INTERFACE_DESCRIPTOR pid;
> PURB pUrbSelIntf = NULL;
>
>
> ...
> urb = USBD_CreateConfigurationRequestEx(pcd, interfaces);
> status = SendUrb (Adapter, selurb);
> hconfig = selurb->UrbSelectConfiguration.ConfigurationHandle;
> ..
>
>
> pUrbSelIntf = (PURB)ExAllocatePool(NonPagedPool,
> GET_SELECT_INTERFACE_REQUEST_SIZE(pid->bNumEndpoints));
>
> UsbBuildSelectInterfaceRequest(pUrbSelIntf,
> GET_SELECT_INTERFACE_REQUEST_SIZE(pid->bNumEndpoints),
> hconfig,
> 0,
> 1);
>
> status = SendUrb (Adapter, pUrbSelIntf);
>
>
> but when I submit the pUrbSelIntf, OS bring blue screen. why? How can I
> do
> this?
>
> Tks!
>
>
>
>
>
>
>


Re: about URB_FUNCTION_SELECT_INTERFACE by Tim

Tim
Tue May 06 00:39:16 CDT 2008

Jeff <Jeff@discussions.microsoft.com> wrote:
>...
>urb = USBD_CreateConfigurationRequestEx(pcd, interfaces);
>status = SendUrb (Adapter, selurb);
>hconfig = selurb->UrbSelectConfiguration.ConfigurationHandle;

You format an URB called "urb", then you submit an URB called "selurb". Is
that a typo?
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: about URB_FUNCTION_SELECT_INTERFACE by Jeff

Jeff
Tue May 06 03:58:00 CDT 2008

actually I fromat a URB called "selurb", it's a typo in this page.

"Tim Roberts" wrote:

> Jeff <Jeff@discussions.microsoft.com> wrote:
> >...
> >urb = USBD_CreateConfigurationRequestEx(pcd, interfaces);
> >status = SendUrb (Adapter, selurb);
> >hconfig = selurb->UrbSelectConfiguration.ConfigurationHandle;
>
> You format an URB called "urb", then you submit an URB called "selurb". Is
> that a typo?
> --
> Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.
>

Re: about URB_FUNCTION_SELECT_INTERFACE by Jeff

Jeff
Tue May 06 04:10:01 CDT 2008

I have resolve this problem. before the sample code as below:

USBD_CONFIGURATION_HANDLE hConfig;
PUSB_CONFIGURATION_DESCRIPTOR pcd;
USBD_INTERFACE_LIST_ENTRY interfaces[4];
PUSB_INTERFACE_DESCRIPTOR pid;
PURB pUrbSelIntf = NULL;


...

selurb= USBD_CreateConfigurationRequestEx(pcd, interfaces);
status = SendUrb (Adapter, selurb);
hconfig = selurb->UrbSelectConfiguration.ConfigurationHandle;
..


pid = USBD_ParseConfigurationDescriptorEx(pcd, pcd, 0, alt, -1, -1, -1);
pUrbSelIntf = (PURB)ExAllocatePool(NonPagedPool,
GET_SELECT_INTERFACE_REQUEST_SIZE(pid->bNumEndpoints));

UsbBuildSelectInterfaceRequest(pUrbSelIntf,
GET_SELECT_INTERFACE_REQUEST_SIZE(pid->bNumEndpoints),
hconfig,
0,
1);
interfaceInfo = &pUrbSelIntf->UrbSelectInterface.Interface;
interfaceInfo->Length = GET_USBD_INTERFACE_SIZE(pid2->bNumEndpoints);
for (index = 0; index < pid2->bNumEndpoints; ++index)
{
interfaceInfo->Pipes[index].MaximumTransferSize =
USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE;
}
status = SendUrb (Adapter, pUrbSelIntf);







Re: about URB_FUNCTION_SELECT_INTERFACE by Jeff

Jeff
Tue May 06 05:46:01 CDT 2008

Now I have a new problem that USB device have no any action although the
IoCallDriver() routine return OK. Why? How can I format the URB?


"Jeff" wrote:

> I have resolve this problem. before the sample code as below:
>
> USBD_CONFIGURATION_HANDLE hConfig;
> PUSB_CONFIGURATION_DESCRIPTOR pcd;
> USBD_INTERFACE_LIST_ENTRY interfaces[4];
> PUSB_INTERFACE_DESCRIPTOR pid;
> PURB pUrbSelIntf = NULL;
>
>
> ...
>
> selurb= USBD_CreateConfigurationRequestEx(pcd, interfaces);
> status = SendUrb (Adapter, selurb);
> hconfig = selurb->UrbSelectConfiguration.ConfigurationHandle;
> ..
>
>
> pid = USBD_ParseConfigurationDescriptorEx(pcd, pcd, 0, alt, -1, -1, -1);
> pUrbSelIntf = (PURB)ExAllocatePool(NonPagedPool,
> GET_SELECT_INTERFACE_REQUEST_SIZE(pid->bNumEndpoints));
>
> UsbBuildSelectInterfaceRequest(pUrbSelIntf,
> GET_SELECT_INTERFACE_REQUEST_SIZE(pid->bNumEndpoints),
> hconfig,
> 0,
> 1);
> interfaceInfo = &pUrbSelIntf->UrbSelectInterface.Interface;
> interfaceInfo->Length = GET_USBD_INTERFACE_SIZE(pid2->bNumEndpoints);
> for (index = 0; index < pid2->bNumEndpoints; ++index)
> {
> interfaceInfo->Pipes[index].MaximumTransferSize =
> USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE;
> }
> status = SendUrb (Adapter, pUrbSelIntf);
>
>
>
>
>
>

Re: about URB_FUNCTION_SELECT_INTERFACE by Tim

Tim
Wed May 07 23:24:52 CDT 2008

Jeff <Jeff@discussions.microsoft.com> wrote:
>
>Now I have a new problem that USB device have no any action although the
>IoCallDriver() routine return OK. Why? How can I format the URB?

What did you expect it to do?
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.