26.08.2013 Views

366.7 KB - Evernote

366.7 KB - Evernote

366.7 KB - Evernote

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

APCTEST - New thread K APC list empty: 1<br />

APCTEST - New thread U APC pending: 0<br />

APCTEST - New thread U APC list empty: 1<br />

APCTEST - APC INT: 0 no APC int<br />

*** No APC delivery trace afterwards, b/c no APC int.<br />

APCTEST - SWAP CONTEXT trace<br />

APCTEST - Current IRQL: 0x1b<br />

APCTEST - Current thread: 0X84D689F0<br />

APCTEST - Current thread K APC pending: 0<br />

APCTEST - Current thread K APC list empty: 1<br />

APCTEST - Current thread U APC pending: 0<br />

APCTEST - Current thread U APC list empty: 1<br />

APCTEST - New thread: 0X84F62D78<br />

APCTEST - New thread K APC pending: 0<br />

APCTEST - New thread K APC list empty: 1<br />

APCTEST - New thread U APC pending: 0<br />

APCTEST - New thread U APC list empty: 1<br />

APCTEST - APC INT: 0<br />

[...]<br />

We know that:<br />

• nt!KiInsertQueueApc is called when the IRQL is already DISPATCH, so the APC interrupt<br />

cannot be serviced before we lower the IRQL to PASSIVE.<br />

• We lower the IRQL to passive after having set the hooks, so we cannot miss the APC<br />

interrupt<br />

• The call to nt!SwapContext cannot have occurred while nt!KiInsertQueueApc was in the<br />

process of queuing the APC, i. e. before it raised the APC interrupt, because we called<br />

nt!KiInsertQueueApc at DISPATCH, so no context switch can occur inside it. Besides, even if<br />

we did not set the IRQL at DISPATCH, nt!KeInsertQueueApc sets it to profile (0x1b) before<br />

calling nt!KiInsertQueueApc.<br />

The explanation may be that nt!KiInsertQueueApc found SpecialApcDisable set. When this happens,<br />

the function does not raise the APC interrupt, although it sets KernelApcPending, which is the<br />

situation in the trace above.<br />

But who then set SpecialApcDisable? Possibly, the code handling an hardware interrupt which<br />

occurred while the test was in progress. Such interrupts were not masked by the DISPATCH IRQL.<br />

38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!