include vmm.inc mov ebx, VM ; VM handle VMMcall Get_Next_VM_Handle mov [NextVM], ebx ; next VM handle |
The Get_Next_VM_Handle service returns the handle of the next virtual machine in the virtual machine list maintained by the system. 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.
VM
Specifies a handle identifying a virtual machine.
The EBX register contains the handle of the next virtual machine in the list.
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:
Scan_Loop:
; modify the VM state
VMMcall Get_Next_VM_Handle
jne Scan_Loop
EBX, Flags