阅读:1055回复:0
高分求助事件问题
本以为event很简单,看了一下武安河的例子也比较好理解,可自己就是写不对,高手帮看一下
驱动程序相应Ioctl: HANDLE hMSecondEvent = *(HANDLE *)I.IoctlBuffer(); if(hMSecondEvent == NULL) { t << \"Handle is nulln\"; I.Information() = 0; status =STATUS_INSUFFICIENT_RESOURCES; } m_pEvent = new (NonPagedPool) KEvent (hMSecondEvent, OBJECT_TYPE_ALL_ACCESS); if(m_pEvent != NULL) { I.Information() = sizeof(UCHAR); *(UCHAR *)I.IoctlBuffer() = 1; status = STATUS_SUCCESS; t << \"Succed in connect OneSecond eventn\"; } else { I.Information() = sizeof(UCHAR); *(UCHAR *)I.IoctlBuffer() = 0; status = STATUS_SUCCESS; } 应用程序: if (!DeviceIoControl(m_hDevice, IOCTL_PCITest_EVENT_SET, &hEventSend, sizeof(hEventSend), &lReturnedBytes, 2, &lReturnedBytes, NULL)) 我用softICE跟踪过,发现两个assert failed,都是kegetcurrentirql ()<Dispatch level.不明白的是事件本来传递就要在低于dispatch下,为什么反而不对了。如果是因为irql高,该怎么改呢。 先谢了,一定高分 |
|