Files
kolibrios/drivers/vboxguest/vmmdev/hypervisor.inc
2026-03-04 21:16:17 +03:00

51 lines
1.5 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
; =============================================================================
; Модуль : VMMDev Host/Hypervisor Info
; Назначение : Получение информации о хосте (REQ 4: GetHostVersion)
; Файл : vmmdev/hypervisor.inc
; =============================================================================
; Отправить REQ 4 GetHostVersion, eax = header.rc
proc vmmdev_get_host_version uses ebx edi
mov edi, [vbox_device.host_version_virt]
mov ebx, [vbox_device.host_version_phys]
test edi, edi
jz .bad
test ebx, ebx
jz .bad
stdcall vmmdev_send_request, ebx
mov eax, [edi + VMMDEV_HEADER.rc]
ret
.bad:
mov eax, VERR_INVALID_POINTER
ret
endp
proc vmmdev_check_version uses ebx
DEBUGF 2, "[VBoxGuest] [VMMDev] Checking host version (GetHostVersion)...\n"
stdcall vmmdev_get_host_version
DEBUGF 2, "[VBoxGuest] [VMMDev] GetHostVersion rc=0x%x\n", eax
test eax, eax
jnz .error
mov eax, [vbox_device.host_version_virt]
movzx ebx, [eax + VMMDEV_GET_HOST_VERSION.major]
movzx ecx, [eax + VMMDEV_GET_HOST_VERSION.minor]
DEBUGF 2, "[VBoxGuest] [VMMDev] Host version: %d.%d.%d r%d features=0x%x\n", \
ebx, ecx, \
[eax + VMMDEV_GET_HOST_VERSION.build], \
[eax + VMMDEV_GET_HOST_VERSION.revision], \
[eax + VMMDEV_GET_HOST_VERSION.features]
xor eax, eax
ret
.error:
DEBUGF 2, "[VBoxGuest] [VMMDev] ERROR: GetHostVersion failed, rc=0x%x\n", eax
mov eax, VERR_GENERAL_FAILURE
ret
endp