阅读:1739回复:2
请大侠分析下面代码蓝屏问题,谢谢了,给分
ULONG urbSize = GET_SELECT_INTERFACE_REQUEST_SIZE(pid->bNumEndpoints);
PURB urb = (PURB)ExAllocatePool(NonPagedPool,urbSize); if (!urb) { status = STATUS_NO_MEMORY; KdPrint((" - ErrorSTATUS_NO_MEMORYn\n")); } RtlZeroMemory(urb,urbSize); UsbBuildSelectInterfaceRequest(urb,urbSize,pdx->hconfig,2,(UCHAR)0); KdPrint(("...Start select interface \n")); status = SendAwaitUrb(fdo, urb);//此句就蓝屏了 if (!NT_SUCCESS(status)) { KdPrint(( " - Error %X trying to select interface\n", status)); return status; } else { KdPrint((" select interface OK\n")); } |
|
沙发#
发布于:2010-01-27 14:34
蓝屏到SendAwaitUrb里面去找,另外蓝屏代码是什么
|
|
板凳#
发布于:2010-02-19 02:54
好像你urb没有设置完,参考以下代码(来自Programming the Microsoft Windows Driver Model(2nd) )
UsbBuildSelectInterfaceRequest(urb, size, pdx->hconfig, 0, 1); urb->UrbSelectInterface.Interface.Length = GET_USBD_INTERFACE_SIZE(npipes); urb->UrbSelectInterface.Interface.Pipes[0].MaximumTransferSize = PAGE_SIZE; NTSTATUS status = SendAwaitUrb(fdo, &urb); 另外,那个2和0 是不是放反了? |
|