首页 > 其他 > 详细

CreateTimerQueueTimer在DllMain中调用导致的loader lock

时间:2014-03-21 03:20:01      阅读:1120      评论:0      收藏:0      [点我收藏+]

开发一个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:

bubuko.com,布布扣
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
bubuko.com,布布扣

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

if (m_hTimer != nullptr)
    return;

SetCount(0);
::CreateTimerQueueTimer(&m_hTimer, NULL, OnTimer, this, 0, m_interval, WT_EXECUTEINTIMERTHREAD);

CreateTimerQueueTimer在DllMain中调用导致的loader lock,布布扣,bubuko.com

CreateTimerQueueTimer在DllMain中调用导致的loader lock

原文:http://www.cnblogs.com/junchu25/p/3614619.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!