Post · 2 min read· pp. 1418–1419

DpcRequestSummary in the KPRCB

A Deferred Procedure Call (DPC) is a routine that is scheduled while the processor executes briefly at a high Interrupt Request Level (IRQL) so that larger work can get under way when this or another processor runs at some lower IRQL, even though this lower IRQL is typically the still demanding DISPATCH_LEVEL. The scheduling and execution is mostly managed through the KPRCB for the target processor.

Version 6.1 introduced a set of bit flags in two words, one word each for normal and thread DPCs. The whole 32 bits of flags are accessible as the one DpcRequestSummary. It is in union with the words, which are together as the DpcRequestSlot array and individually as NormalDpcState and ThreadDpcState. Version 6.1 labels one bit and squeezes it into the structure of words:

source
struct {
    SHORT NormalDpcState;
    union {
        USHORT volatile DpcThreadActive : 1;
        SHORT ThreadDpcState;
    };
};

The separation is cleaner in version 6.2 and higher. The words are their own structure in the union. The bits become another branch of the union

source
struct {
    SHORT NormalDpcState;
    SHORT ThreadDpcState;
};
struct {
    /*  bit fields, see below  */
};

This reorganisation preserves DpcThreadActive as the first bit of the second word.

MaskDefinitionVersionsRemarks
0x00000001ULONG DpcNormalProcessingActive : 1;6.2 and higher
0x00000002ULONG DpcNormalProcessingRequested : 1;6.2 and higher
0x00000004ULONG DpcNormalThreadSignal : 1;6.2 and higher
0x00000008ULONG DpcNormalTimerExpiration : 1;6.2 and higher
0x00000010ULONG DpcNormalDpcPresent : 1;6.2 and higher
0x00000020ULONG DpcNormalLocalInterrupt : 1;6.2 and higher
ULONG DpcNormalSpare : 10;6.2 and higher
0x00010000ULONG DpcThreadActive : 1;6.2 and higherUSHORT volatile bit at same location in 6.1; BOOLEAN volatile in KPRCB in 5.2 to 6.0
0x00020000ULONG DpcThreadRequested : 1;6.2 and higherBOOLEAN volatile in KPRCB in 5.2 to 6.0
ULONG DpcThreadSpare : 14;6.2 and higher