include vmm.inc
mov ebx, VM ; VM handle
VMMCall Get_Next_VM_Handle
mov [NextVM], ebx ; next VM handle
Returns the handle of the next virtual machine in the virtual machine list maintained by the system. Uses EBX, Flags.
Although each virtual machine appears only once in the list, the order of the handles is not guaranteed. The list is circular, so a virtual device scanning the list should stop scanning when the latest handle returned is equal to the first handle returned.
The following example modifies the state of every virtual machine by using the Get_Next_VM_Handle service to retrieve handles of all valid virtual machines:
VMMCall Get_Cur_VM_Handle
Scan_Loop:
; modify the VM state
VMMCall Get_Next_VM_Handle
VMMCall Test_Cur_VM_Handle
jne Scan_Loop
Get_Cur_VM_Handle, Test_Cur_VM_Handle