KfReleaseSpinLock

This function gives up the current thread’s exclusive access to whatever resource is protected by the given lock.

Declaration

VOID __fastcall KfReleaseSpinLock (KSPIN_LOCK *SpinLock, KIRQL NewIrql);

Parameters

The SpinLock argument is the address of the lock that is to be released.

The NewIrql argument is the Interrupt Request Level (IRQL) to execute at once the lock is released. This is typically the IRQL to restore from before the lock’s acquisition.

Availability

The KfReleaseSpinLock function is exported by name from x86 builds of the HAL in version 3.50 and higher and of the kernel in version 6.2 and higher. The HAL’s export in version 6.2 and higher is merely a forward to the kernel.

Documentation Status

The KfReleaseSpinLock function is not documented. It has a C-language declaration in all known editions of the DDK or Windows Driver Kit (WDK) since at least the DDK for Windows NT 3.51.

Behaviour

The KfReleaseSpinLock function is a __fastcall improvement of the documented KeReleaseSpinLock. Starting at least from the Device Driver Kit (DDK) for Windows NT 3.51, a macro definition reinterprets the old function in terms of the new. Programmers continue to use the old and be none the wiser unless they look into the headers for the details. The old function continues to be exported but its implementation is only a thunk that reinterprets in terms of KfReleaseSpinLock just like the macro.

That KfReleaseSpinLock has all the substance is here treated just as a detail of internal organisation. As far as should concern any code outside the kernel or HAL, the behavour is all in KeReleaseSpinLock.