Virtual Devices (3.1) (vdag31qh.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Get_Crit_Section_Status
                                                     Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
include vmm.inc
 
VMMcall Get_Crit_Section_Status
 
mov     [VM], ebx           ; VM handle of owner
mov     [Claims], ecx       ; # of times critical section claimed
jc      high_priority       ; priority is Critical_Section_Boost or higher
 
The Get_Crit_Section_Status service returns the claim count and owner of the
critical section.
 
This service has no parameters.
 
Return Value
 
The ECX register contains the critical section claim count, and the EBX
register contains the handle identifying the virtual machine owning the
critical section. If the ECX register is 0, the EBX register contains the
handle of the current virtual machine.
 
The carry flag is set if the current virtual machine has an execution
priority greater than or equal to Critical_Section_Boost, such as during a
hardware interrupt simulation.
 
Comments
 
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.
 
Uses
 
Flags
 
See Also
 
Get_Crit_Status_No_Block