免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1044 | 回复: 0

中断EVENT,使用WaitForMultipleObjects fail出错 [复制链接]

论坛徽章:
0
发表于 2011-12-21 08:41 |显示全部楼层
 wince driver中,与中断关联过的EVENT,在IST线程中使用WaitForMultipleObjects fail出错 
        最近在做wince的驱动中,想在一个IST线程中处理两个硬件中断,自己想偷懒,不想用两个线程来做,故就用WaitForMultipleObjects函数去等待那两个中断线程,一直不能成功。用GetLastError(),获取msg全是87,说是传参数有问题,但是我两个事件的创建都是成功的啊,没有相应的error的log信息。郁闷了一个下午,后来在查了帮助ms的帮助文档,终于找到原因了,我不能那样干。
自己记性不好,故记录在这里,以防自己忘记。同时希望,能对和我犯同样错误的看客有所帮助。呵呵
 
 
与中断关联过的EVENT,在IST线程中,只能使用
DWORD WaitForSingleObject(
  HANDLE hHandle,
  DWORD dwMilliseconds
);不能使用DWORD WaitForMultipleObjects(
  DWORD nCount,
  CONST HANDLE* lpHandles,
  BOOL fWaitAll,
  DWORD dwMilliseconds
);
详细wince的InterruptInitialize函数的帮助文档,
ms-help://MS.VSCC.v80/MS.VSIPCC.v80/MS.WindowsCE.v60.en/CE_OS_IntExplorer/html/4ae3a36b-759a-4103-8251-ecac4c440103.htm
This function must be called before using the hEvent parameter, which provides a link between the idInt parameter and the SYSINTR value returned by an ISR.The hEvent parameter can be used only in a WaitForSingleObject call to wait for the event to be triggered by the kernel.A WaitForMultipleObjects call with hEvent fails.If you use hEvent in a call to WaitForSingleObject before you call InterruptInitialize, InterruptInitialize fails.InterruptInitialize is a kernel-mode-only function. For more information about kernel-mode-only functions, see Kernel Mode APIs.InterruptInitialize is used with device drivers and user-mode drivers. For more information about user-mode drivers, see User
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/bbw2008/archive/2011/05/04/6393329.aspx
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP