Skip to content

Latest commit

 

History

History
36 lines (19 loc) · 1.78 KB

critical-regions-and-guarded-regions.md

File metadata and controls

36 lines (19 loc) · 1.78 KB
title description keywords ms.date
Critical Regions and Guarded Regions
Critical Regions and Guarded Regions
asynchronous procedure calls WDK kernel
APCs WDK kernel
critical regions WDK kernel
guarded regions WDK kernel
06/16/2017

Critical Regions and Guarded Regions

A thread that is inside a critical region executes with user APCs and normal kernel APCs disabled. A thread inside a guarded region runs with all APCs disabled.

Critical Regions

A driver can enter and exit a critical region as follows:

Each call to KeEnterCriticalRegion must have a matching call to KeLeaveCriticalRegion.

Guarded Regions

A driver can enter and exit a guarded region as follows:

Each call to KeEnterGuardedRegion must have a matching call to KeLeaveGuardedRegion.

Drivers that were developed for Windows Server 2003 and later versions of Windows can use guarded regions to disable special kernel APCs. Drivers that were developed for earlier operating systems can disable special kernel APCs by raising the current IRQL to APC_LEVEL by calling KeRaiseIrql. Use KeLowerIrql to lower the current IRQL to the previous value.