Mouse Initialization and the Virtual Mouse Device

Windows initializes the mouse driver by calling the driver's initialization routine, and subsequently calling the driver's Enable function. The initialization routine calls the virtual mouse device (VMOUSE) to determine whether a mouse is present. If a mouse is present, the routine retrieves information about the mouse, including its type (serial, bus, InPort, and so on), and the number of the port it is using. The initialization routine writes this information to the [Mouse] section of the SYSTEM.INI file. Whenever the system restarts, VMOUSE uses the information in SYSTEM.INI to speed up the mouse initialization process.

If the initialization routine returns a nonzero value, Windows assumes the mouse is present and calls the Inquire function to retrieve additional information about the mouse hardware, including the number of buttons and the rate at which the mouse generates interrupts. Inquire returns the mouse information in the form of a MOUSEINFO structure.

Windows calls Enable when it is ready to receive mouse input. Enable passes the address of the Windows mouse-event callback function to VMOUSE. Whenever VMOUSE receives mouse input for Windows, it passes the input to the mouse-event callback function. Windows disables mouse input by calling the Disable function, which passes NULL to VMOUSE instead of the address of a valid mouse-event callback function.

The mouse driver includes the MouseGetIntVect function that Windows or utilities can call to retrieve the interrupt vector number used by the mouse interrupt handler.

See also Disable, Enable, Inquire, MouseGetIntVect, MOUSEINFO