Get_Crit_Section_Status

include vmm.inc

VMMCall Get_Crit_Section_Status

mov     [VMHandle], ebx
mov     [Claims], ecx
jc      high_priority
 

If the critical-section claim count is non-zero, this function returns the critical-section claim count in ECX and a handle identifying the virtual machine that owns the critical section in EBX.

If the critical-section claim count is zero, and the current VM is the system VM, this function inspects the V86 mutex count. If the V86 mutex count is non-zero, this function returns the V86 mutex count in the high word of ECX, and a handle identifying the virtual machine that owns the V86 mutex in EBX.

If none of the above applies (in the case where the returned ECX contains 0) this routine returns the current virtual machine handle in EBX.

Uses flags.

Windows 3.1 sometimes delays releasing the critical section until events are processed. This service causes the system to complete any delayed releases before the service returns the status. This may cause a task switch if another virtual machine has a delayed release.

If a virtual device must ensure that it owns the critical section to successfully complete an operation, it should call this service to make sure that the critical section status is up to date.

This is not an asynchronous service; it must not be called at interrupt time.

See Also

Get_Crit_Status_No_Block