The PAGED_CODE macro ensures that the calling thread is running at an IRQL that is low enough to permit paging.
VOID
PAGED_CODE(
);
None
None
Declared in wdm.h and ntddk.h. Include wdm.h or ntddk.h.
If the IRQL > APC_LEVEL, PAGED_CODE() causes the system to ASSERT.
A call to this macro should be made at the beginning of every driver routine that either contains pageable code or accesses pageable code.
The PAGED_CODE macro only checks IRQL at the point the code executes the macro. If the code subsequently raises IRQL, it will not be detected. Driver writers should use the driver verifier to detect when the IRQL is raised improperly.
PAGED_CODE only works in checked builds.