Hooking Callback Events

A VDD can hook a callback event if it polls DOS events for which there is no explicit close operation, such as printing using int17h.The VDDInstallUserHook and VDDDeInstallUserHook functions allow a VDD to control events such as:

·PDB (DOS process) creation and termination

·VDM block

·VDM resume

A VDM in which a DOS application runs is attached to the console window in which the DOS application is running. When the first DOS binary runs in that console, the VDM is created, and the DOS binary is terminated. The VDM remains with the console window and waits for the next DOS binary to be launched. While the VDM waits, it should block all its components, including VDDs. A VDD can hook VDM Block and Resume events for this purpose. On block events, a VDD should block all worker threads and clean up any other operation it may have started. On Resume events, the VDD can restart a worker thread. VDDDeInstallUserHook de-installs all events hooked earlier.