Files
nt-lite/code/public/ntlite/ddk/irql.h
T

42 lines
1.3 KiB
C

// Public nt-lite DDK IRQL declarations.
#pragma once
#include <stdint.h>
// Interrupt request level value used by DDK synchronization and IRP state.
typedef uint8_t KIRQL;
#define PASSIVE_LEVEL ((KIRQL)0)
#define APC_LEVEL ((KIRQL)1)
#define DISPATCH_LEVEL ((KIRQL)2)
#define DIRQL_BASE ((KIRQL)16)
#define HIGH_LEVEL ((KIRQL)31)
// Masks interrupts and returns an opaque state restored by KeRestoreInterrupts.
__declspec(dllexport) uintptr_t KeDisableInterrupts(void);
// Restores the interrupt state returned by KeDisableInterrupts.
__declspec(dllexport) void KeRestoreInterrupts(uintptr_t flags);
// Returns the current processor's software IRQL.
__declspec(dllexport) KIRQL KeGetCurrentIrql(void);
// Raises to newIrql and returns the previous level.
__declspec(dllexport) KIRQL KeRaiseIrql(KIRQL newIrql);
// Restores a previously returned level.
__declspec(dllexport) void KeLowerIrql(KIRQL oldIrql);
// Asserts that the current IRQL exactly matches expected.
__declspec(dllexport) void KeAssertIrql(KIRQL expected);
// Asserts that the current IRQL is at or below maxIrql.
__declspec(dllexport) void KeAssertIrqlAtOrBelow(KIRQL maxIrql);
// Returns nonzero when the current context may block.
__declspec(dllexport) int KeCanWait(void);
// Returns a diagnostic name for an IRQL.
__declspec(dllexport) const char* KeIrqlName(KIRQL irql);