zoukankan      html  css  js  c++  java
  • CreateTimerQueueTimer在DllMain中调用导致的loader lock

    开发一个COM组件在Windows 7上注册成功,但是Windows XP SP3版本却导致regsvr32.exe进程挂起。用WinDbg查看发现提示:

    Break-in sent, waiting 30 seconds...
    WARNING: Break-in timed out, suspending.
             This is usually caused by another thread holding the loader lock

    竟然出现了加载锁,kb查看call stack:

    0:000> kb
    ChildEBP RetAddr  Args to Child              
    0007dc00 7c92df3c 7c9546b0 000006e0 00000000 ntdll!KiFastSystemCallRet
    0007dc04 7c9546b0 000006e0 00000000 00000000 ntdll!NtWaitForSingleObject+0xc
    0007dc30 7c94dbde 7c885854 00000000 0007dc60 ntdll!RtlpInitializeTimerThreadPool+0xe1
    0007dc40 7c82cbd2 7c885770 0007dd68 000c9184 ntdll!RtlCreateTimerQueue+0x3b
    0007dc60 7c82cbed 0007dc90 0007dd68 00cd7ebd kernel32!BasepCreateDefaultTimerQueue+0x66
    0007dc6c 00cd7ebd 000c9184 00000000 00c8b1c1 kernel32!CreateTimerQueueTimer+0x20

    组件加载以后会调用Windows API CreateTimerQueueTimer创建一个Timer,regsvr32就是被这段代码给挂住了。

    if (m_hTimer != nullptr)
        return;
    
    SetCount(0);
    ::CreateTimerQueueTimer(&m_hTimer, NULL, OnTimer, this, 0, m_interval, WT_EXECUTEINTIMERTHREAD);
  • 相关阅读:
    ubuntu下手动安装autoconf
    解决VMware下的ubuntu桌面鼠标键盘失效的问题
    DP搬运工1
    把数字转换成货币格式
    指定字符隐藏
    JS 时间获取 (常用)
    electron 安装
    el-form表单校验包含循环
    算法-07| 动态规划
    纯手撸——归并排序
  • 原文地址:https://www.cnblogs.com/junchu25/p/3614619.html
Copyright © 2011-2022 走看看