My USB driver sends Irp to query USB_BUS_INTERFACE_USBDI_V1
from bus driver. It returns STATUS_SUCCESS and fills the structure.
I use USB_BUS_INTERFACE_USBDI_V1.IsDeviceHighSpeed() to query
the device running speed mode.
However, the IsDeviceHighSpeed() function pointer is invalid and not NULL.
The system crashes immediately after the driver call the function pointer.
The USB EHCI driver is 3rd party driver. I'm not surprised.
I want to know how the kernel driver to identify whether the function
pointer
is valid before it calls the function pointer.
Or how the kernel driver handle this kind of case.

Best Regards
Jack Huang

Re: How to identify whether a function pointer is valid? by Doron

Doron
Mon Oct 15 10:42:15 PDT 2007

you can't detect a bogus pointer. are you zero initializing teh structure
before sending the QI?

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.


"Jack Huang" <huangjj@hotmail.com> wrote in message
news:e46h2d0DIHA.4584@TK2MSFTNGP03.phx.gbl...
> My USB driver sends Irp to query USB_BUS_INTERFACE_USBDI_V1
> from bus driver. It returns STATUS_SUCCESS and fills the structure.
> I use USB_BUS_INTERFACE_USBDI_V1.IsDeviceHighSpeed() to query
> the device running speed mode.
> However, the IsDeviceHighSpeed() function pointer is invalid and not NULL.
> The system crashes immediately after the driver call the function pointer.
> The USB EHCI driver is 3rd party driver. I'm not surprised.
> I want to know how the kernel driver to identify whether the function
> pointer
> is valid before it calls the function pointer.
> Or how the kernel driver handle this kind of case.
>
> Best Regards
> Jack Huang
>


Re: How to identify whether a function pointer is valid? by SergeV

SergeV
Mon Oct 15 19:46:07 PDT 2007

Apparently, this is not the case, but in some cases "try" helps.

>"Doron Holan [MSFT]" wrote in message you can't detect a bogus
>pointer. are you zero initializing teh structure before sending the
>QI?
>
> d
> "Jack Huang" > wrote in message
> news:e46h2d0DIHA.4584@TK2MSFTNGP03.phx.gbl...
>> My USB driver sends Irp to query USB_BUS_INTERFACE_USBDI_V1
>> from bus driver. It returns STATUS_SUCCESS and fills the structure.
>> I use USB_BUS_INTERFACE_USBDI_V1.IsDeviceHighSpeed() to query
>> the device running speed mode.
>> However, the IsDeviceHighSpeed() function pointer is invalid and not
>> NULL.
>> The system crashes immediately after the driver call the function
>> pointer.
>> The USB EHCI driver is 3rd party driver. I'm not surprised.
>> I want to know how the kernel driver to identify whether the function
>> pointer
>> is valid before it calls the function pointer.
>> Or how the kernel driver handle this kind of case.
>>
>> Best Regards
>> Jack Huang
>>
>



Re: How to identify whether a function pointer is valid? by Alexander

Alexander
Mon Oct 15 19:52:55 PDT 2007

Are you running x64?

"Jack Huang" <huangjj@hotmail.com> wrote in message
news:e46h2d0DIHA.4584@TK2MSFTNGP03.phx.gbl...
> My USB driver sends Irp to query USB_BUS_INTERFACE_USBDI_V1
> from bus driver. It returns STATUS_SUCCESS and fills the structure.
> I use USB_BUS_INTERFACE_USBDI_V1.IsDeviceHighSpeed() to query
> the device running speed mode.
> However, the IsDeviceHighSpeed() function pointer is invalid and not NULL.
> The system crashes immediately after the driver call the function pointer.
> The USB EHCI driver is 3rd party driver. I'm not surprised.
> I want to know how the kernel driver to identify whether the function
> pointer
> is valid before it calls the function pointer.
> Or how the kernel driver handle this kind of case.
>
> Best Regards
> Jack Huang
>



Re: How to identify whether a function pointer is valid? by Jack

Jack
Tue Oct 16 08:12:27 PDT 2007

The driver runs on WinME x86 platform.
I didn't clear USB_BUS_INTERFACE_USBDI_V1 structure.
The function pointer value is filled by the bus driver.
I will zero the structure and check the return version number again.
Thanks for all suggestions.

Best Regards
Jack Huang

"Alexander Grigoriev" <alegr@earthlink.net> ...
> Are you running x64?
>
> "Jack Huang" <huangjj@hotmail.com> wrote in message
> news:e46h2d0DIHA.4584@TK2MSFTNGP03.phx.gbl...
>> My USB driver sends Irp to query USB_BUS_INTERFACE_USBDI_V1
>> from bus driver. It returns STATUS_SUCCESS and fills the structure.
>> I use USB_BUS_INTERFACE_USBDI_V1.IsDeviceHighSpeed() to query
>> the device running speed mode.
>> However, the IsDeviceHighSpeed() function pointer is invalid and not
>> NULL.
>> The system crashes immediately after the driver call the function
>> pointer.
>> The USB EHCI driver is 3rd party driver. I'm not surprised.
>> I want to know how the kernel driver to identify whether the function
>> pointer
>> is valid before it calls the function pointer.
>> Or how the kernel driver handle this kind of case.
>>
>> Best Regards
>> Jack Huang
>>
>
>



Re: How to identify whether a function pointer is valid? by Alexander

Alexander
Tue Oct 16 19:17:45 PDT 2007

WinME doesn't provide USB_BUS_INTERFACE_USBDI_V1. You should check result of
your QUERY_INTERFACE, it most likely fails.

But there's no point in calling that function, because WinME doesn't support
high speed USB anyway. Non-MS hosts that could provide support are unlikely
to support this interface.

"Jack Huang" <huangjj@hotmail.com> wrote in message
news:e4DBwbAEIHA.5752@TK2MSFTNGP02.phx.gbl...
> The driver runs on WinME x86 platform.
> I didn't clear USB_BUS_INTERFACE_USBDI_V1 structure.
> The function pointer value is filled by the bus driver.
> I will zero the structure and check the return version number again.
> Thanks for all suggestions.
>
> Best Regards
> Jack Huang
>
> "Alexander Grigoriev" <alegr@earthlink.net> ...
>> Are you running x64?
>>
>> "Jack Huang" <huangjj@hotmail.com> wrote in message
>> news:e46h2d0DIHA.4584@TK2MSFTNGP03.phx.gbl...
>>> My USB driver sends Irp to query USB_BUS_INTERFACE_USBDI_V1
>>> from bus driver. It returns STATUS_SUCCESS and fills the structure.
>>> I use USB_BUS_INTERFACE_USBDI_V1.IsDeviceHighSpeed() to query
>>> the device running speed mode.
>>> However, the IsDeviceHighSpeed() function pointer is invalid and not
>>> NULL.
>>> The system crashes immediately after the driver call the function
>>> pointer.
>>> The USB EHCI driver is 3rd party driver. I'm not surprised.
>>> I want to know how the kernel driver to identify whether the function
>>> pointer
>>> is valid before it calls the function pointer.
>>> Or how the kernel driver handle this kind of case.
>>>
>>> Best Regards
>>> Jack Huang
>>>
>>
>>
>
>



Re: How to identify whether a function pointer is valid? by Jack

Jack
Wed Oct 17 07:56:16 PDT 2007

Yes, I know it.
I ever tested several vendor supplied host drivers on WinME.
Some host drivers did support this interface, and some host
drivers returned STATUS_NOT_SUPPORT.
The problem host driver I met returned STATUS_SUCCESS
,but the function pointer is invalid.

"Alexander Grigoriev" <alegr@earthlink.net> l...
> WinME doesn't provide USB_BUS_INTERFACE_USBDI_V1. You should check result
> of your QUERY_INTERFACE, it most likely fails.
>
> But there's no point in calling that function, because WinME doesn't
> support high speed USB anyway. Non-MS hosts that could provide support are
> unlikely to support this interface.
>
> "Jack Huang" <huangjj@hotmail.com> wrote in message
> news:e4DBwbAEIHA.5752@TK2MSFTNGP02.phx.gbl...
>> The driver runs on WinME x86 platform.
>> I didn't clear USB_BUS_INTERFACE_USBDI_V1 structure.
>> The function pointer value is filled by the bus driver.
>> I will zero the structure and check the return version number again.
>> Thanks for all suggestions.
>>
>> Best Regards
>> Jack Huang
>>
>> "Alexander Grigoriev" <alegr@earthlink.net> ...
>>> Are you running x64?
>>>
>>> "Jack Huang" <huangjj@hotmail.com> wrote in message
>>> news:e46h2d0DIHA.4584@TK2MSFTNGP03.phx.gbl...
>>>> My USB driver sends Irp to query USB_BUS_INTERFACE_USBDI_V1
>>>> from bus driver. It returns STATUS_SUCCESS and fills the structure.
>>>> I use USB_BUS_INTERFACE_USBDI_V1.IsDeviceHighSpeed() to query
>>>> the device running speed mode.
>>>> However, the IsDeviceHighSpeed() function pointer is invalid and not
>>>> NULL.
>>>> The system crashes immediately after the driver call the function
>>>> pointer.
>>>> The USB EHCI driver is 3rd party driver. I'm not surprised.
>>>> I want to know how the kernel driver to identify whether the function
>>>> pointer
>>>> is valid before it calls the function pointer.
>>>> Or how the kernel driver handle this kind of case.
>>>>
>>>> Best Regards
>>>> Jack Huang
>>>>
>>>
>>>
>>
>>
>
>