I have a helper program that does inverted call and posts the requests to a third program.
The first thing my helper program does is start the my inverted call system.
After this the driver will have a number of IRP_MJ_DEVICE_CONTROL Irps queued in a cancel safe queue.
The helper program has a reader thread waiting for an inverted call request from each IRP.
The program also creates worker threads that are fed jobs from a queue.
I implemented this queue with a completion port
m_hCPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, NumberOfWorkerThreads);
I add to the queue
bResult = PostQueuedCompletionStatus(m_hCPort, 0, 0, (LPOVERLAPPED)pMyContext);
I remove from the queue
bResult = GetQueuedCompletionStatus(m_hCPort, &UnusedBytes, &UnusedKey, (LPOVERLAPPED)&pMyContext, INFINITE);
This works the early house keeping tasks go through then the problem
windbg on the next door machine shows that the waiting IRPs are cancelled.
Why is this happening? How do I prevent it?
My development box is Windows 7 64 bit. The helper program is 32 bit.
I tried creating a null file and associating the CreateIoCompletion Port with it but that made no difference.