Call With
EBX: Contains the System (Windows) VM Handle
Return Values
You should preserve EBX; all other registers can be destroyed. Return with the carry flag clear to indicate that Dynamic_Init succeeded and that the mini-VDD did not detect any problems with the video hardware. Return with the carry flag set to indicate an error.
Remarks
Early in the Windows® 95 boot sequence, the Main VDD reads the Registry to get the correct mini-VDD to load and then proceeds to load the mini-VDD. As soon as the VxD loader loads the mini-VDD, MiniVDD_Dynamic_Init is called. The mini-VDD performs several checks of the video hardware at this time. If the mini-VDD does not detect any problems with the video hardware, the mini-VDD is successfully loaded. If the mini-VDD finds a problem such as running on the wrong hardware, MiniVDD_Dynamic_Init returns with the carry flag set indicating that there is a problem, and the Main VDD returns an error to the Plug & Play subsystem. The Plug & Play subsystem then displays an error message dialog box to the user concerning the problem with the display settings, and allows the user to run a hardware detection program to correct the problem.
The mini-VDD must do several things during MiniVDD_Dynamic_Init:
1. It must check to make sure that it is running on the proper hardware by doing a non-destructive detection. If it is not running on a supported chipset, the mini-VDD should return immediately with the carry flag set to report the error.
2. If the same mini-VDD is used on different chipsets, it should identify what chipset it is running on and save this chipset ID. For more information, see the description of the mini-VDD hook function GET_CHIP_ID as well as the ATI example mini-VDD.
3. It should allocate space in the CB data area to save register and mode states on a per-VM basis. The data that your mini-VDD saves in the allocated space in the CB data area varies for every mini-VDD. For example, the Windows VM may set CRTC register 42h to one value and a MS-DOS VM might set register 42h to another value. Your register virtualization routines must virtualize CRTC register 42h and save each of its values in the CB data area. When called upon to restore the register 42h for a certain VM, it can restore the correct value for each VM's required state. If the CB data area allocation fails, then the system is in an unstable state and MiniVDD_Dynamic_Init should return with the carry flag set to indicate an error.
4. It should obtain the address of the mini-VDD hook dispatch table using the service VDD_Get_Mini_Dispatch_Table. Then, the mini-VDD can install the address of the routines that it needs to hook in this table by using the MiniVDDDispatch macro found in MINIVDD.INC. See the example mini-VDDs included in the DDK for proper use of the MiniVDDDispatch macro. +The mini-VDD should also perform a version check at this point by comparing the total number of mini-VDD hook functions using the equate NBR_MINI_VDD_FUNCTIONS (included in MINIVDD.INC) to the number returned in ECX by the service VDD_Get_Mini_Dispatch_Table. If the NBR_MINI_VDD_FUNCTIONS is greater than the value returned in ECX, then it means that the mini-VDD has hook functions that the Main VDD does not know about. This would indicate that the mini-VDD is newer than the Main VDD. In this case, the mini-VDD should fail.
5. The mini-VDD should get and save the special VM handles, Blue Screen Message Mode and Forced Planar Mode, that the Main VDD has setup. The mini-VDD function RESTORE_REGISTERS uses these handles to properly restore the blue-screen-message mode state or the forced planar state. See RESTORE_REGISTERS for details.