Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Upcoming OSR Seminars:
Windows Internals & Software Drivers Lab, Amherst, NH, 21-25 September, 2015
Writing WDF Drivers: Core Concepts Lab, Amherst, NH 5-9 December, 2015
Kernel Debugging & Crash Analysis Lab, Amherst, NH 12-16 October, 2015
Developing File Systems for Windows, Seattle, WA 20-23 October, 2015
Writing WDF Drivers: Core Concepts Lab, Palo Alto, CA 2-6 November, 2015
Writing WDF Drivers: Core Concepts Lab, Amherst, NH 2-6 November, 2015
Kernel Debugging & Crash Analysis Lab, Amherst, NH 9-13 November, 2015
Writing WDF Drivers: Advanced Lab, Amherst, NH 8-11 December, 2015


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 4  
04 Feb 10 11:27
ntdev member 45800
xxxxxx@lntinfotech.com
Join Date:
Posts To This List: 24
Inconsistency in Set Interface call in Usb audio Client driver.

hi i am implementing a USB audio client driver in XP. there is a inconsistency problem for my set interface function. if i check it for continue three or four time it works but after that its not work. in my set interface function i am doing this MySetInterface(IN PKSDEVICE m_Device,UINT8 interface_no,UINT8 alt_setting) { PURB urb; NTSTATUS status=STATUS_SUCCESS; RtlZeroMemory(&urb,sizeof(struct _URB)); UsbBuildSelectInterfaceRequest(&urb, (USHORT)GET_SELECT_INTERFACE_REQUEST_SIZE(1), config_handle, interface_no, alt_setting); urb.UrbSelectInterface.Interface.Length = GET_USBD_INTERFACE_SIZE(1); urb.UrbSelectInterface.Interface.Pipes[0].MaximumTransferSize = USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE; status = SendUrb(m_Device, &urb) if (!NT_SUCCESS(status)) { KdPrint(("SetInterface:Failed to fetch config \n")); } pipe_handle2=urb.UrbSelectInterface.Interface.Pipes[0].PipeHandle; ULONG pt = urb.UrbSelectInterface.Interface.Pipes[0].PipeType; return status; } and in my sendUrb function SendUrb ( IN PKSDEVICE mdevice, IN PURB urb, ) { PAGED_CODE(); PURB urb; ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL); KEVENT event; KeInitializeEvent(&event, NotificationEvent, FALSE); IO_STATUS_BLOCK iostatus; PIRP Irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_SUBMIT_URB, mdevice->NextDeviceObject , NULL, 0, NULL, 0, TRUE, &event, &iostatus); if (!Irp) { KdPrint(( " - Unable to allocate IRP for sending URB\n")); return STATUS_INSUFFICIENT_RESOURCES; } PIO_STACK_LOCATION stack = IoGetNextIrpStackLocation(Irp); stack->Parameters.Others.Argument1 = (PVOID) urb; NTSTATUS status = IoCallDriver(mdevice->NextDeviceObject, Irp); if (status == STATUS_PENDING) { KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, NULL); status = iostatus.Status; } return status; } the problem is that when its call sendurb. in sendurb i call IoCallDriver(mdevice->NextDeviceObject, Irp); some times its not goes further. can anyone knows why its like that??
  Message 2 of 4  
04 Feb 10 13:14
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 10184
Inconsistency in Set Interface call in Usb audio Client driver.

xxxxx@lntinfotech.com wrote: > i am implementing a USB audio client driver in XP. > > there is a inconsistency problem for my set interface function. > > if i check it for continue three or four time it works but after that its not work. > What happens? What exactly do you see? An error code? > > > in my set interface function i am doing this > > MySetInterface(IN PKSDEVICE m_Device,UINT8 interface_no,UINT8 alt_setting) > { > PURB urb; > NTSTATUS status=STATUS_SUCCESS; > RtlZeroMemory(&urb,sizeof(struct _URB)); > Is this an exact cut-and-paste from your code? If so, I see the problem right now. You need: URB urb; not PURB urb; You're only allocating 4 bytes of space, then trying to write something like 48 bytes of data into it. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 3 of 4  
05 Feb 10 09:18
ntdev member 45800
xxxxxx@lntinfotech.com
Join Date:
Posts To This List: 24
Inconsistency in Set Interface call in Usb audio Client driver.

Sorry Tim its not PURB urb in my code i posted this line wrong. actually its URB urb in my code. some time i got this *** Fatal System Error: 0x00000019 (0x00000020,0x839EFFF9,0x839F07B9,0x0AF86E07) some time access violation error some time nothing its wait after the IoCallDriver driver. still i am not able to figure out the problem.
  Message 4 of 4  
05 Feb 10 12:56
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 10184
Inconsistency in Set Interface call in Usb audio Client driver.

xxxxx@lntinfotech.com wrote: > its not PURB urb in my code i posted this line wrong. > > actually its URB urb in my code. > So, you're asking us to debug your code, but you don't show us the real code? > some time i got this > > *** Fatal System Error: 0x00000019 (0x00000020,0x839EFFF9,0x839F07B9,0x0AF86E07) > > some time access violation error > > some time nothing its wait after the IoCallDriver driver. > > still i am not able to figure out the problem. > You are overwriting memory somewhere -- running off the end of a buffer, writing on freed memory, using a stack buffer after the routine had returned -- that kind of thing. That is a tricky kind of problem to chase down. Show us the real code, and I'll take another look. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 09:48.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license