When the user switches a full-screen MS-DOS application back to running in a window, a VGA-compatible miniport’s HwVidStartIO function is sent a VRP with the I/O control code IOCTL_VIDEO_SAVE_HARDWARE_STATE. The miniport must store the state of the adapter in case the user switches the application to full-screen mode again.
Note that the miniport’s SvgaHwIoPortXxx might have buffered a sequence of application INs and/or OUTs, as described in Validating Instructions in SvgaHwIoPortXxx, when its HwVidStartIO routine is called to save the adapter state. In these circumstances, the miniport should save the current state, including the buffered instructions, so that the SvgaHwIoPortXxx can resume validation operations exactly where they left off if the user switches the application to full-screen mode again.
When the miniport completes a save operation, the port driver automatically disables the current IOPM for VDMs and the miniport’s SvgaHwIoPortXxx functions. The port driver restores the IOPM automatically if the application is switched to full-screen mode again. It also resumes calling the miniport’s SvgaHwIoPortXxx, after it calls the miniport’s HwVidStartIO routine with the IOCTL_VIDEO_RESTORE_HARDWARE_STATE request.