Jump-start your project by learning from devs who
write Windows drivers and file systems every day.
Take an OSR seminar!

OSR is Hiring! Click here to find out more.

Upcoming OSR Seminars:
Writing WDF Drivers for Windows Lab, Palo Alto, CA 28 April-2 May, 2014
Advanced WDF Driver Lab, Palo Alto, CA 5-8 May, 2014
Developing File Systems for Windows, Boston/Waltham, MA 13-16 May, 2014
Windows Internals & Software Drivers Lab, Dulles/Sterling, VA, CA 23-27 June, 2014


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: 8999
Re: 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
RE: 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: 8999
Re: 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 22:25.


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