From: Jeff on
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!







From: Doron Holan [MSFT] on
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(a)discussions.microsoft.com> wrote in message
news:F8D5E1DE-62E0-4A97-9493-3633E0C772A4(a)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!
>
>
>
>
>
>
>

From: Tim Roberts on
Jeff <Jeff(a)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(a)probo.com
Providenza & Boekelheide, Inc.
From: Jeff on
actually I fromat a URB called "selurb", it's a typo in this page.

"Tim Roberts" wrote:

> Jeff <Jeff(a)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(a)probo.com
> Providenza & Boekelheide, Inc.
>
From: Jeff on
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);