DriverStudio Bug?? [Not From me,but A friend]

everwalking (BbSlOvEr) From DriverDev SMTH

The usb driver usbtest.sys generated by DS wizard can not be loaded, system
thread is always busy.
I trace it,and find the problem may be here below:
LocateInterface() in kusb.cpp:


PUSB_INTERFACE_DESCRIPTOR pDesc;
if ( *pStart == NULL )
*pStart = m_Config;
pDesc = USBD_ParseConfigurationDescriptorEx(,);// parameters
*pStart = &pDesc[1];
if (pDesc && pDesc->bNumEndpoints)
{
PUSB_ENDPOINT_DESCRIPTOR ped = (PUSB_ENDPOINT_DESCRIPTOR)&pDesc[1];

while ( ped->bDescriptorType != 5 ) // if not endpoint descriptor,go
on

{
ped = (PUSB_ENDPOINT_DESCRIPTOR) (ped->bLength +
(PCHAR)ped);
}
*ppEndpoints = ped;
}

if the interface desc is not 9 bytes,then it will trapped in a definite
loop.

Try xxxxx@compuware.com !

Alberto.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Ming
Sent: Tuesday, December 23, 2003 12:00 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] DriverStudio Bug?? [Not From me,but A friend]

everwalking (BbSlOvEr) From DriverDev SMTH

The usb driver usbtest.sys generated by DS wizard can not be loaded, system
thread is always busy.
I trace it,and find the problem may be here below:
LocateInterface() in kusb.cpp:


PUSB_INTERFACE_DESCRIPTOR pDesc;
if ( *pStart == NULL )
*pStart = m_Config;
pDesc = USBD_ParseConfigurationDescriptorEx(,);// parameters
*pStart = &pDesc[1];
if (pDesc && pDesc->bNumEndpoints)
{
PUSB_ENDPOINT_DESCRIPTOR ped = (PUSB_ENDPOINT_DESCRIPTOR)&pDesc[1];

while ( ped->bDescriptorType != 5 ) // if not endpoint descriptor,go
on

{
ped = (PUSB_ENDPOINT_DESCRIPTOR) (ped->bLength +
(PCHAR)ped);
}
*ppEndpoints = ped;
}

if the interface desc is not 9 bytes,then it will trapped in a definite
loop.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.