yushui213
驱动小牛
驱动小牛
  • 注册日期2006-04-17
  • 最后登录2016-01-09
  • 粉丝1
  • 关注0
  • 积分1015分
  • 威望115点
  • 贡献值0点
  • 好评度102点
  • 原创分0分
  • 专家分0分
阅读:1105回复:9

SubmitUrb重启求救!!!!!

楼主#
更多 发布于:2007-03-14 12:18
  各位大侠,帮帮忙啊!!谢谢,谢谢……
俺是新手,用DS生成了USB的驱动程序,对照USBBULK的例子,修改了Write例程,发现在如下代码中的红色部分导致机器重启,搜了好久,依旧得不到答案,望大侠指教。
(应用程序执行Write操作时,如果注释红色那句代码,则不会重启;否则就一运行Write就重启)
NTSTATUS D12Device::Write(KIrp I)
{
        NTSTATUS status= STATUS_SUCCESS;
        t << "UsbBulkDevice::Write() Entry\n";

        // Declare a memory object
        KMemory Mem(I.Mdl());
        ULONG dwTotalSize = I.WriteSize(CURRENT);
        ULONG dwMaxSize = m_Endpoint1OUT.MaximumTransferSize();

        if ( dwTotalSize > dwMaxSize )
        {
                ASSERT(dwMaxSize);
                dwTotalSize = dwMaxSize;
        }

        ULONG dwBytesSent = 0;

        PURB pUrb = m_Endpoint1OUT.BuildInterruptTransfer(
                Mem,                        // Where is data coming from?
                dwTotalSize,            // How much data to read?
                TRUE,        // Transmit less than Size is OK    
                NULL,                    // Link to next URB
                NULL,          // Allocate a new URB
                FALSE        // direction (FALSE = OUT)
        );

        // Submit the URB to our USB device, synchronously
        if (pUrb != NULL)
        {
               status = m_Endpoint1OUT.SubmitUrb(pUrb, NULL, NULL);
                if ( NT_SUCCESS(status) )
                {
                        dwBytesSent = pUrb->UrbBulkOrInterruptTransfer.TransferBufferLength;

                         t << "Write() posted "  << dwTotalSize << " bytes to USB\n";
                }

                delete pUrb;
        }

        I.Information() = dwBytesSent;
        return I.PnpComplete(this, status);
}
yushui213
驱动小牛
驱动小牛
  • 注册日期2006-04-17
  • 最后登录2016-01-09
  • 粉丝1
  • 关注0
  • 积分1015分
  • 威望115点
  • 贡献值0点
  • 好评度102点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2007-03-14 12:19
望帮主,大侠,女侠们救救俺啊~~~~~~~~~~~~~~
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2007-03-14 12:47
用的哪个版本的DS?WinDbg的分析原因是什么?
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
yushui213
驱动小牛
驱动小牛
  • 注册日期2006-04-17
  • 最后登录2016-01-09
  • 粉丝1
  • 关注0
  • 积分1015分
  • 威望115点
  • 贡献值0点
  • 好评度102点
  • 原创分0分
  • 专家分0分
地板#
发布于:2007-03-14 13:03
用的是3.1的DS

还不会用WinDbg。。。
yushui213
驱动小牛
驱动小牛
  • 注册日期2006-04-17
  • 最后登录2016-01-09
  • 粉丝1
  • 关注0
  • 积分1015分
  • 威望115点
  • 贡献值0点
  • 好评度102点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2007-03-14 16:39
rayyang2000大大,能不能帮我再看看。
以下是用WinDbg在Host端查看的结果,在执行Write例程出错后,用!analyze -v命令查看的
红色部分应该就是出错的代码,不过这些代码应该是DS封装的吧,在我的驱动程序中看不到这些的。


*******************************************************************************
*                                                                             *
*                        Bugcheck Analysis                                    *
*                                                                             *
*******************************************************************************

UNEXPECTED_KERNEL_MODE_TRAP (7f)
This means a trap occurred in kernel mode, and it's a trap of a kind
that the kernel isn't allowed to have/catch (bound trap) or that
is always instant death (double fault).  The first number in the
bugcheck params is the number of the trap (8 = double fault, etc)
Consult an Intel x86 family manual to learn more about what these
traps are. Here is a *portion* of those codes:
If kv shows a taskGate
        use .tss on the part before the colon, then kv.
Else if kv shows a trapframe
        use .trap on that value
Else
        .trap on the appropriate frame will show where the trap was taken
        (on x86, this will be the ebp that goes with the procedure KiTrap)
Endif
kb will then show the corrected stack.
Arguments:
Arg1: 00000000, EXCEPTION_DIVIDED_BY_ZERO
Arg2: 00000000
Arg3: 00000000
Arg4: 00000000

Debugging Details:
------------------

***** Kernel symbols are WRONG. Please fix symbols to do analysis.


MODULE_NAME:  D12

FAULTING_MODULE: 804d7000 nt

DEBUG_FLR_IMAGE_TIMESTAMP:  45f7ac0b

BUGCHECK_STR:  0x7f_0

DEFAULT_BUCKET_ID:  DRIVER_FAULT

LAST_CONTROL_TRANSFER:  from 80532d2e to 804e3592

STACK_TEXT:  
WARNING: Stack unwind information not available. Following frames may be wrong.
ef774324 80532d2e 00000003 f833dcad 00000000 nt!DbgBreakPointWithStatus+0x4
ef774704 805332f3 0000007f 00000000 00000000 nt!KeDeregisterBugCheckReasonCallback+0x6c7
ef774724 8062150f 0000007f f833dcad 00000000 nt!KeBugCheck+0x14
ef77477c 804df3d0 ef774788 ef774828 f833dcad nt!KeSetTimeUpdateNotifyRoutine+0xa8c
ef7747a8 804edb53 00000000 00000000 f92a0000 nt!Kei386EoiHelper+0x374
ef774828 f833df5f 822d2028 f8d86008 8184c008 nt!IoBuildPartialMdl+0x1f5
ef774848 f83451ce 822d2028 f8d86008 8184c008 USBPORT+0x3f5f
ef7748c4 806f13cc 822d2028 00000000 00000000 USBPORT+0xb1ce
ef7748f0 8052d065 8234f150 822d205c 00000001 hal!HalAllocateAdapterChannel+0x126
ef774908 f83454ef 8234f150 822d2028 00000001 nt!IoAllocateAdapterChannel+0x2a
ef77494c f834630e 822d2028 f8da0d08 f8d86008 USBPORT+0xb4ef
ef7749a4 f83471f6 00d86008 ffffffff 804e2eb4 USBPORT+0xc30e
ef7749d4 f834e198 f8ca7710 ef774a0c f834dd5c USBPORT+0xd1f6
ef7749e0 f834dd5c 822d2028 f8da0d08 fb8162a8 USBPORT+0x14198
ef774a0c f8352dfe 821af030 822d2028 00000090 USBPORT+0x13d5c
ef774a2c f833c1e2 821af030 f8da0d08 f8da0d08 USBPORT!USBPORT_RegisterUSBPortDriver+0x2fc
ef774a50 804e37f7 f8da0dc0 821af188 fb8162a8 USBPORT+0x21e2
ef774a68 f86852d9 f8da0d08 821af030 f8da0d08 nt!IofCallDriver+0x32
ef774a88 f8685afa 821afd50 f8da0d08 f8d2e590 usbhub+0x42d9
ef774aa4 f86831d8 fb8162a8 f8da0d08 ef774ad0 usbhub+0x4afa
ef774ab4 804e37f7 fbbb3848 f8da0d08 f8d29f38 usbhub+0x21d8
ef774ad0 eeafe902 f8da0d08 f8d2e590 00000001 nt!IofCallDriver+0x32
ef774bac eeaf5f21 fb8162a8 00000000 00000000 D12!KUsbLowerDevice::SubmitUrb+0x28a [c:\program files\compuware\driverstudio\driverworks\source\kusb.cpp @ 132]
ef774bd0 eeaf501f fb8162a8 00000000 00000000 D12!KUsbPipe::SubmitUrb+0x91 [c:\progra~1\compuware\driverstudio\driverworks\include\kusb.h @ 1384]
ef774c14 eeaf8ee6 f8d946d0 009001b0 80010031 D12!D12Device::Write+0xd3 [d:\driver\d12\sys\d12device.cpp @ 823]
ef774c4c eeaf4005 f8d946d0 00900000 8126efb0 D12!KPnpDevice::DeviceIrpDispatch+0x446 [c:\program files\compuware\driverstudio\driverworks\source\kpnpdev.cpp @ 497]
ef774c60 804e37f7 f8d85020 f8d946d0 806ee2d0 D12!KDriver::DriverIrpDispatch+0x55 [c:\progra~1\compuware\driverstudio\driverworks\include\kdriver.h @ 960]
ef774c84 805784c0 f8d85020 f8d946d0 fb868ec0 nt!IofCallDriver+0x32
ef774d38 804de7ec 000007b0 00000000 00000000 nt!NtWriteFile+0x3eb
ef774ddc 804fa4da f83f1b85 f953ea58 00000000 nt!ZwYieldExecution+0xb78
ef774e1c 7c910732 7c90e027 7c80b371 ffffffff nt!KeInitializeTimer+0x107
ef774e20 7c90e027 7c80b371 ffffffff 00000017 ntdll+0x10732
ef774e84 7c913288 7c916433 00000001 0f740017 ntdll+0xe027
ef774e88 7c916433 00000001 0f740017 7c916315 ntdll+0x13288
ef774e94 7c916315 0013f5ac 00000000 7c9105c8 ntdll+0x16433
ef774ea0 7c9105c8 0015b808 0013f678 7c910551 ntdll+0x16315
00000000 00000000 00000000 00000000 00000000 ntdll+0x105c8


STACK_COMMAND:  kb

FOLLOWUP_IP:
D12!KUsbLowerDevice::SubmitUrb+28a [c:\program files\compuware\driverstudio\driverworks\source\kusb.cpp @ 132]
eeafe902 8945fc           mov     [ebp-0x4],eax

FAULTING_SOURCE_CODE:  
   128:
   129:
   130:         // Pass the IRP/URB to USBD
   131:         BOUNDS_CHECKER(SUBMIT_URB, (this, pUrb, PIRP(I)));
>  132:         status = Call(I);
   133:
   134:         if ( status == STATUS_PENDING )
   135:         {
   136:             // calculate the time out interval
   137:             ULONGLONG TimeOut100nSec;


SYMBOL_STACK_INDEX:  16

FOLLOWUP_NAME:  MachineOwner

SYMBOL_NAME:  D12!KUsbLowerDevice::SubmitUrb+28a

IMAGE_NAME:  D12.sys

BUCKET_ID:  WRONG_SYMBOLS

Followup: MachineOwner
---------
yushui213
驱动小牛
驱动小牛
  • 注册日期2006-04-17
  • 最后登录2016-01-09
  • 粉丝1
  • 关注0
  • 积分1015分
  • 威望115点
  • 贡献值0点
  • 好评度102点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2007-03-14 16:58
还有其他大侠,女侠在么?

救救我。。。
yushui213
驱动小牛
驱动小牛
  • 注册日期2006-04-17
  • 最后登录2016-01-09
  • 粉丝1
  • 关注0
  • 积分1015分
  • 威望115点
  • 贡献值0点
  • 好评度102点
  • 原创分0分
  • 专家分0分
6楼#
发布于:2007-03-16 09:10
大侠们,走过的路过的,请帮帮忙,谢谢啊
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2007-03-19 06:37
你这个pipe是int out吗?感觉像是pipe的配置有问题。

另外,记得好像一般int都是读 ~~~ 很久不做usb了,可能记忆有误
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
summerfruit
驱动牛犊
驱动牛犊
  • 注册日期2004-06-12
  • 最后登录2013-12-07
  • 粉丝0
  • 关注0
  • 积分395分
  • 威望67点
  • 贡献值0点
  • 好评度36点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2007-03-19 16:59
感觉是那个变量没有初始化,看这个提示。
EXCEPTION_DIVIDED_BY_ZERO
yushui213
驱动小牛
驱动小牛
  • 注册日期2006-04-17
  • 最后登录2016-01-09
  • 粉丝1
  • 关注0
  • 积分1015分
  • 威望115点
  • 贡献值0点
  • 好评度102点
  • 原创分0分
  • 专家分0分
9楼#
发布于:2007-03-19 17:02
谢谢大家的帮忙,问题已经解决了


主要还是固件程序的配置出现了问题,跟上层驱动没有关系,搞了一个礼拜,竟然方向不对,哎~~~~~~~~



不过,还是感谢大家的帮忙
游客

返回顶部