Importing Services

A virtual device can import services from another virtual device by including the virtual device's service table declaration. In such cases, the service table declaration must not be preceded with the device-specific symbol (as described in the previous section). For example, a virtual device that includes the file VSAMPLED.INC, which contains the service table declaration for VSAMPLED services, can call those services. A virtual device calls VMM services using the VMMCall macro, and calls virtual device services using the VxDCall macro.

Depending on a computer's configuration, a virtual device may fail to load when Windows starts. This means a virtual device that uses services provided by another virtual device must verify that the other virtual device services are available before calling them. To verify the services, the calling virtual device must attempt to call the Get_Version service of the virtual device providing the services. If the virtual device has not been loaded, the VMM sets the carry flag and returns zero in the AX register.