include vmm.inc
GetVxDServiceOrdinal reg, ServiceName
#include <vmm.h>
DWORD dwServiceOrdinal = GetVxDServiceOrdinal(ServiceName);
Obtains the virtual device service ordinal, for use by Hook_Device_Service.
This macro must be used whenever you need to obtain a virtual device service ordinal. The method employed by Windows 3.1 no longer works.
Example:
GetVxDServiceOrdinal eax, DOSMGR_Begin_V86_App
mov esi, offset32 BeginPmAppHook
VMMCall Hook_Device_Service
VxD_REAL_INIT_SEG