Call With
Undefined.
Return Values
Save anything that you use.
Remarks
ENABLE_TRAPS and DISABLE_TRAPS gives the mini-VDD the opportunity to enable or disable traps that it has previously setup I/O handler trapping for (see the S3 mini-VDD's Dynamic_Init routine for an example of how to setup I/O handlers for BLTer registers using Install_IO_Handler and VDD_Register_Virtual_Port). It is an empirical process to decide which ports to trap and which not to.
Notes on BLTer port trapping:
If you plan to support virtualization of 4 plane VGA modes in the background or in a window, you will need to support trapping of all the BLTer and extended register ports that your display driver might use during the course of running Windows. Note that the Main VDD does most of the work in handling the virtualization and all that the mini-VDD needs to do is to use the VDD service VDD_Register_Virtual_Port for each of the BLTer and extended ports that the display driver might use and then respond to ENABLE_TRAPS and DISABLE_TRAPS calls from the Main VDD. Within your ENABLE_TRAPS and DISABLE_TRAPS routines, you must call Enable_Global_Trapping or Disable_Global_Trapping once for each port.
The reason that 4 plane VGA virtualization requires the port trapping is because the Main VDD monitors accesses to the ports to know when to switch the hardware state from 4 plane virtualization mode to Windows hi-res mode. For more information, see GET_VDD_BANK. The Main VDD only traps these ports when a 4 plane VGA application is running (or during a mode change) and then only when the execution focus is set to the 4 plane VGA application.
Again, the Main VDD uses ports registered using the function VDD_Register_Virtual_Port only to be notified when the Windows display driver is accessing the hardware and to tell the mini-VDD to instigate a hardware state change back to the Windows hi-res MemC state.
The main reason for trapping extended ports is to prevent them from being written while a mode change is being virtualized in a window. In this case, your mini-VDD must provide its own I/O handler for these ports. See the S3.VXD's virtualization of port 4AE8h for an example of why and how to trap certain ports.