see you're creating the event from kernel mode. Following the advice of Mr
Oney et al, I tend to get the AP to create the event, and then pass that to
the driver through an ioctl. This gets around various nastys with process
HANDLE hEvent = CreateEvent(...);
int result = DeviceIoControl( hDevice, custom_IOCTL_code, &hEvent,
AfxBeginThread( EventWaitingThread, hEvent, THREAD_PRIORITY_NORMAL);
hEvent = *(HANDLE*)pIrp->AssociatedIrp->SystemBuffer;
pDevExt->hEvent = NULL;
status = ObReferenceObjectByHandle( hEvent, 0, NULL, KernelMode,
and then Driver:AckAP stays the same. Because you maintain a reference on
the object, it won't get destroyed when the AP exits, so technically it
doesn't matter if you don't cleanup when the AP exits. However, for
completeness and tidy code, you should still do that.
"wschung" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...