Call_When_Not_Critical


include vmm.inc

mov     esi, CritSecCallback
mov     edx, RefData
VMMcall Call_When_Not_Critical

Installs a critical-section callback function. The system calls this function when a virtual device releases the critical section. Uses Flags.

CritSecCallback

Address of the callback function to install. For more information, see CritSecCallback.

RefData

Address of reference data to pass to the callback function.

The system does not execute the callback until the current virtual machine's execution priority is less than the Critical_Section_Boost value even if the current virtual machine is not in a critical section. This allows a virtual device to release the critical section and process any simulated interrupts before the system calls the callback function.

Virtual devices can install any number of callback functions, but the system calls only the most recent function on the list when the critical section is released. The system removes the callback function from the list as it calls the function. This is a common point of confusion. Unlike services like Call_When_Task_Switched, which install a hook permanently, the Call_When_Not_Critical service removes the callback once it is dispatched.

It is more convenient to use the Call_Priority_VM_Event service than to call this service directly.

See also Call_When_Idle, Call_When_Task_Switched, CritSecCallback