Display drivers must export an entry point for the MoveCursorBlock table. This table contains information about the display driver's MoveCursor routine (code) and data areas. The table values are checked after the display driver is initialized. This allows the driver to determine the correct values.
typedef struct _MCDESCRIPTION { PVOID pMoveCursor; ULONG ulCodeLength; PVOID pCursorData; ULONG ulDataLength; } MCDESCRIPTION; typedef MCDESCRIPTION * PMCDESCRIPTION;
The fields in the MCDESCRIPTION data structure are described below:
pMoveCursor
This routine supports calls from the system timer (at interrupt time). The strategy for the MoveCursor routine is that the pointer is checked and, if necessary, redrawn or excluded at timed intervals.
The PMDD.SYS physical device driver creates a privilege level 0 alias for the data address and passes the alias to the routine in the EAX register when MoveCursor is called at interrupt time. Therefore, all data addressing within the routine must be performed relative to this address.
At entry to the MoveCursor routine, the stack contains the following:
VOID MoveCursor(LONG abs_x, LONG abs_y, PVOID pCursorData)
Using the C calling convention, the stack contains two LONGs, which hold the X- and Y-coordinates of the cursor hot spot, and a PVOID that is a pointer to the cursor data area that is valid in the current context. All references to this data area must be done relative to the address passed in. If the X- and Y-coordinates are set to 0x80000000, this signifies a CheckCursor call.
Regular timer interrupts give the presentation driver an opportunity to check whether the pointer is valid. For example, the driver can check the following:
At the end of the MoveCursor routine, a check is performed to see if a new location was given for the pointer while it was being drawn. If the pointer has moved again, it must be drawn at the new location or be excluded because it has moved into the protection rectangle. This implies that the routine needs to track both real (X,Y) and pointer (X,Y) coordinates.