From: Harsh on
I am creating my own USB Driver for Sonix WebCam SN9C101.
Have just written USB Attach and USB Install as of now. In USB Attach method
only I am tring to fetch the current Alternate Setting.
When I am using

lpUsbDev->lpActiveConfig->lpInterfaces->Descriptor.bInterfaceNumber

to get the alternate Setting I get it as 0.
But when I use

lpUsbFuncs->lpGetInterface(hDevice, NULL, NULL, 0, 0, &uAltSetting);

I get some junk value.
Moreover after this when I try to set it to some alternate setting using

hTransfer = lpUsbFuncs->lpSetInterface(hDevice, NULL, NULL, 0, 0, 0x08);

I get hTransfer as successful.
But when I again try to retrieve the current alternate setting by

lpUsbFuncs->lpGetInterface(hDevice, NULL, NULL, 0, 0, &uAltSetting);

Again I get some value.

Can any1 plz help me out.

My Debugger shows the following as the output:

PB Debugger Loaded 'webcamdriver.dll', no matching symbolic information found.

279051 PID:400002 TID:22a0002 WebCam: USB Install Method

279051 PID:400002 TID:22a0002 WebCam: USB Install Method Exit

PB Debugger Unloaded symbols for 'webcamdriver.dll'

PB Debugger Loaded 'WEBCAMDRIVER.DLL', no matching symbolic information found.

279078 PID:400002 TID:22a0002 WebCam: USBDeviceAttach Start....

279078 PID:400002 TID:22a0002 WebCam: lpInterface == 0............

PB Debugger Unloaded symbols for 'WEBCAMDRIVER.DLL'

279079 PID:400002 TID:22a0002 WebCam: Can't activate stream device!
GetLastError = 1

279079 PID:400002 TID:22a0002 WebCam: USBDeviceAttach Ends here ......--

279079 PID:400002 TID:22a0002 WebCam: lpUsbDev is valid..........

279079 PID:400002 TID:22a0002 WebCam: Alternate No = 0

279079 PID:400002 TID:22a0002 WebCam: Alternate Setting = 0--

279080 PID:400002 TID:22a0002 WebCam: lpUsbFuncs->lpGetInterface. Alternate
Setting = 0--

279082 PID:400002 TID:22a0002 WebCam: lpUsbFuncs->lpSetInterface
successful.......--

279084 PID:400002 TID:22a0002 WebCam: lpUsbFuncs->lpGetInterface. Alternate
Setting = 0--

279084 PID:400002 TID:22a0002 WebCam: pUsbFuncs->lpIssueIsochTransfer
transfer unsuccessful.......--