阅读:1076回复:2
event notification
Hello everybody.
I did a test, seems my event notification in the driver didn\'t wake up the application each time. In the driver I used: //////////////////////////////////////////////////////////////// if (gUserEvent!=NULL) { DbgPrint(\"Set Event: \\n\"); ASSERT(KeGetCurrentIrql()<=DISPATCH_LEVEL); KeClearEvent(gUserEvent); KeSetEvent(gUserEvent, 0, FALSE); } /////////////////////////////////////////////////////////// In the application I used: /////////////////////////////////////////////////////////// while(1) { status = WaitForSingleObject(api.m_hEvent, INFINITE); if (status == WAIT_ABANDONED || status == WAIT_OBJECT_0 || status == WAIT_TIMEOUT) /* I used if (status == WAIT_OBJECT_0 ) the first time, the counts in the application is less than the counts in the kernel, so I * changed to this code */ { printf(\"got event %d\\n\", api.k); // api.GetPacket(); // api.GetPacket(); api.k++; } } /////////////////////////////////////////////////////////// still, the counts in the application is much less than the counts in kernel. Any ideas? Thanks! |
|
沙发#
发布于:2007-08-09 11:14
我也遇到同样的问题了,驱动里面setevent太快,外面处理比较慢,怎么解决阿
|
|
板凳#
发布于:2002-08-24 05:13
case closed. because kernel is too fast to set and clear the event, so the application lost some notifications.
|
|