The SynchCritSection routine is used to access hardware resources or driver data that are shared with a driver's InterruptService routine.
BOOLEAN
SynchCritSection(
IN PVOID SynchronizeContext
);
If the routine's operation succeeds, the routine should return TRUE; otherwise, it should return FALSE. (Success and failure of this routine are driver-defined.) The specified return value becomes the return value for KeSynchronizeExecution.
Drivers must use SynchCritSection routines to access hardware resources or driver data that can also be accessed by an InterruptService routine (ISR).
The system calls a driver's SynchCritSection routine when the driver calls KeSynchronizeExecution. When a driver calls KeSynchronizeExecution, it specifies the address of a SynchCritSection routine, context information for the routine, and an interrupt object pointer. The KeSynchronizeExecution routine acquires the interrupt object's spin lock, then calls the SynchCritSection routine.
A driver's SynchCritSection routine executes at the same IRQL as the ISR with which it is associated. Specifically, it executes at some system-assigned DIRQL, as specified by the SynchronizeIrql parameter to IoConnectInterrupt. (Other devices, with higher DIRQL values, can interrupt a SynchCritSection routine.)