Tim,
Code snippet of what I am doing… In this part of faking code I am just
sending the same captured data for the first 4-packets and then all
ZERO’s…
if( urb->UrbHeader.Function ==
URB_FUNCTION_ISOCH_TRANSFER ) {
ULONG i,Address;
isoch++;
DebugPrint((0,“Received ISOCH Packet - 0x%x
\n”,isoch));
DebugPrint((0,“urb->UrbIsochronousTransfer.PipeHandle - 0x%x
\n”,urb->UrbIsochronousTransfer.PipeHandle));
DebugPrint((0,“urb->UrbIsochronousTransfer.TransferFlags - 0x%x
\n”,urb->UrbIsochronousTransfer.TransferFlags));
DebugPrint((0,“urb->UrbIsochronousTransfer.TransferBufferLength - 0x%x
\n”,urb->UrbIsochronousTransfer.TransferBufferLength));
DebugPrint((0,“urb->UrbIsochronousTransfer.TransferBuffer - 0x%x
\n”,urb->UrbIsochronousTransfer.TransferBuffer));
DebugPrint((0,“urb->UrbIsochronousTransfer.StartFrame - 0x%x
\n”,urb->UrbIsochronousTransfer.StartFrame));
DebugPrint((0,“urb->UrbIsochronousTransfer.NumberOfPackets - 0x%x
\n”,urb->UrbIsochronousTransfer.NumberOfPackets));
DebugPrint((0,“urb->UrbIsochronousTransfer.ErrorCount - 0x%x
\n”,urb->UrbIsochronousTransfer.ErrorCount));
urb->UrbHeader.Status = 0;
urb->UrbIsochronousTransfer.TransferFlags =
0x5;
urb->UrbIsochronousTransfer.PipeHandle =
(USBD_PIPE_HANDLE) 0x81;
urb->UrbHeader.Status = 0;
if (isoch == 1)
urb->UrbIsochronousTransfer.StartFrame = FrameNumber + 5*isoch;
else
urb->UrbIsochronousTransfer.StartFrame = FrameNumber + 20*isoch;
urb->UrbIsochronousTransfer.ErrorCount = 0;
Address =
(ULONG)urb->UrbIsochronousTransfer.TransferBuffer;
if
(urb->UrbIsochronousTransfer.TransferBuffer){
//RtlFillMemory(urb->UrbIsochronousTransfer.TransferBuffer,
urb->UrbIsochronousTransfer.TransferBufferLength, 0x00);
switch (isoch)
{
case 1:
RtlCopyMemory(urb->UrbIsochronousTransfer.TransferBuffer, isoch_data,
urb->UrbIsochronousTransfer.TransferBufferLength);
break;
case 2:
RtlCopyMemory(urb->UrbIsochronousTransfer.TransferBuffer, isoch1_data,
urb->UrbIsochronousTransfer.TransferBufferLength);
break;
case 3:
RtlCopyMemory(urb->UrbIsochronousTransfer.TransferBuffer, isoch2_data,
urb->UrbIsochronousTransfer.TransferBufferLength);
break;
case 4:
RtlCopyMemory(urb->UrbIsochronousTransfer.TransferBuffer, isoch3_data,
urb->UrbIsochronousTransfer.TransferBufferLength);
break;
default:
RtlFillMemory(urb->UrbIsochronousTransfer.TransferBuffer,
urb->UrbIsochronousTransfer.TransferBufferLength, 0x00);
break;
}
}else{
DebugPrint((0,“&&&&& Transfer Buffer
MDL &&&&&\n”));
}
for(i=0;i <
urb->UrbIsochronousTransfer.NumberOfPackets;i++){
urb->UrbIsochronousTransfer.IsoPacket[i].Offset = i*768;
urb->UrbIsochronousTransfer.IsoPacket[i].Length = 0x300;
urb->UrbIsochronousTransfer.IsoPacket[i].Status = 0;
Address =
(ULONG)urb->UrbIsochronousTransfer.TransferBuffer + i*768;
if (isoch > 5)
RtlFillMemory((PVOID)Address, 1, 0xFF);
}
Irp->IoStatus.Information =
urb->UrbIsochronousTransfer.TransferBufferLength;
Irp->IoStatus.Status =
STATUS_SUCCESS;
//
// Complete it.
//
IoCompleteRequest(Irp, IO_NO_INCREMENT);
DebugPrint((0,“****** Completed the ISOCH
IRP ******\n”));
return STATUS_SUCCESS
This is the debug trace for the crash…
kd> !analyze -v
****************************************************************************
***
*
*
* Bugcheck Analysis
*
*
*
****************************************************************************
***
DRIVER_IRQL_NOT_LESS_OR_EQUAL (d1)
An attempt was made to access a pageable (or completely invalid) address at
an
interrupt request level (IRQL) that is too high. This is usually
caused by drivers using improper addresses.
If kernel debugger is available get stack backtrace.
Arguments:
Arg1: 04400008, memory referenced
Arg2: 00000002, IRQL
Arg3: 00000001, value 0 = read operation, 1 = write operation
Arg4: 5acf2126, address which referenced memory
Debugging Details:
WRITE_ADDRESS: 04400008
CURRENT_IRQL: 2
FAULTING_IP:
vfwwdm32+2126
5acf2126 895e08 mov dword ptr [esi+8],ebx
PROCESS_NAME: PhotoStudio.exe
DEFAULT_BUCKET_ID: DRIVER_FAULT
BUGCHECK_STR: 0xD1
TRAP_FRAME: eefb33f4 – (.trap 0xffffffffeefb33f4)
ErrCode = 00000006
eax=04400000 ebx=00000000 ecx=7c809ab9 edx=7c90eb94 esi=04400000
edi=00000000
eip=5acf2126 esp=0012e7c0 ebp=0012e7e0 iopl=0 nv up ei pl nz na pe
nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000
efl=00010206
vfwwdm32+0x2126:
001b:5acf2126 895e08 mov dword ptr [esi+8],ebx
ds:0023:04400008=???
Resetting default scope
LAST_CONTROL_TRANSFER: from 80532487 to 804e3592
STACK_TEXT:
eefb2fa8 80532487 00000003 eefb3304 00000000
nt!RtlpBreakWithStatusInstruction
eefb2ff4 80532f5e 00000003 04400008 5acf2126 nt!KiBugCheckDebugBreak+0x19
eefb33d4 804e187f 0000000a 04400008 00000002 nt!KeBugCheck2+0x574
eefb33d4 5acf2126 0000000a 04400008 00000002 nt!KiTrap0E+0x233
WARNING: Stack unwind information not available. Following frames may be
wrong.
0012e7e0 5acf4aa0 0000037c 002f4017 0012e810 vfwwdm32+0x2126
0012e880 5acf72c6 043b0008 00000001 001e4150 vfwwdm32!DriverProc+0x2394
0012e8a4 5acf73ca 03b80000 001e4148 00000028 vfwwdm32!VfwWdm+0x26fb
0012e8bc 5acf2799 03b80000 000040c8 001e4148 vfwwdm32!VfwWdm+0x27ff
0012e8d4 76b431f1 03b80000 00000014 000040c8 vfwwdm32!DriverProc+0x8d
0012e900 76b43140 00000130 000040c8 001e4148 WINMM!SendDriverMessage+0xc9
0012e91c 73b8bc47 00000014 000040c8 001e4148 WINMM!SendDriverMessage+0x18
0012e934 73b84449 00000014 001e4148 001e3fe8
AVICAP32!capCreateCaptureWindowA+0x9e0c
0012e974 73b8741e 00000000 00000000 001e3fe8
AVICAP32!capCreateCaptureWindowA+0x260e
0012e990 73b87ffb 001e3fe8 0000040a 00000000
AVICAP32!capCreateCaptureWindowA+0x55e3
0012ea10 7e418734 00030200 0000040a 00000000
AVICAP32!capCreateCaptureWindowA+0x61c0
0012ea3c 7e418816 73b87fc5 00030200 0000040a USER32!GetDC+0x6d
0012eaa4 7e41b4c0 00000000 73b87fc5 00030200 USER32!GetDC+0x14f
0012eaf8 7e41b50c 00a73c90 0000040a 00000000 USER32!DefWindowProcW+0x184
0012eb20 7c90eae3 0012eb30 00000018 00a73c90 USER32!DefWindowProcW+0x1d0
0012eb80 7e42f3cc 00a73c90 0000040a 00000000
ntdll!KiUserCallbackDispatcher+0x13
0012eba0 0321b045 00030200 0000040a 00000000 USER32!SendMessageA+0x49
0012eba4 00030200 0000040a 00000000 00000000 TWD207!DS_Entry+0x6fc5
0012eba8 00000000 00000000 00000000 dc9c4608 0x30200
STACK_COMMAND: kb
FOLLOWUP_IP:
nt!KiTrap0E+233
804e187f f7457000000200 test dword ptr [ebp+70h],20000h
SYMBOL_STACK_INDEX: 3
SYMBOL_NAME: nt!KiTrap0E+233
FOLLOWUP_NAME: MachineOwner
MODULE_NAME: nt
IMAGE_NAME: ntoskrnl.exe
DEBUG_FLR_IMAGE_TIMESTAMP: 45e54711
FAILURE_BUCKET_ID: 0xD1_W_nt!KiTrap0E+233
BUCKET_ID: 0xD1_W_nt!KiTrap0E+233
Followup: MachineOwner
Thanks in advance…
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Tuesday, December 18, 2007 1:49 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Reg. ISOCHRONOUS Transfer.
Vishwanath Maram wrote:
As I was discussing with you earlier that the upper layer vendor drivers
are
crashing as soon as we reply with the initial ISOCH requests, still
debugging the same. We are now faking sending just ZEROS for all the
24k…
So any idea what exactly might be happening or what those upper layer
drivers expect in general…
My USB capture drivers usually look something like this:
for( i = 0; i < urb->NumberOfPackets; i++ )
{
if( urb->IsoPacket[i].Length )
ProcessPacket(
urb->TransferBuffer + urb->IsoPacket[i].Offset,
urb->IsoPacket[i].Length
);
else
KdPrint(( “Whoops, isoch error %08x in packet %d\n”,
urb->IsoPacket[i].Status, i
));
}
You may have to disassemble backwards from the crash a bit to find out
what they don’t like.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
This message, together with any attachment(s), contains confidential and proprietary information of
ServerEngines LLC and is intended only for the designated recipient(s) named above. Any unauthorized
review, printing, retention, copying, disclosure or distribution is strictly prohibited. If you are not the
intended recipient of this message, please immediately advise the sender by reply email message and
delete all copies of this message and any attachment(s). Thank you.