求教wdm中的一句话
在wdm中,有一个例子
PIRP Irp = IoBuildSynchronousFsdRequest(...);
ExAcquireFastMutex(...);
NTSTATUS status = IoCallDriver(...);
if (status == STATUS_PENDING)
KeWaitForSingleObject(...); // <== don't do this
ExReleaseFastMutex(...);
对为什么不能这么干有如下说明
The problem with this code is that the KeWaitForSingleObject call will deadlock: when the IRP completes, IoCompleteRequest will schedule an APC in this thread. The APC routine, if it could run, would set the event. But because you’re already at APC_LEVEL, the APC cannot run in order to set the event.
为什么apc不能调度运行从而signal等待的event呢?当前的线程处于apc_level怎么会影响到对应的事件的signal呢?