The DIB engine provides the DIB_BeginAccess and DIB_EndAccess functions to support exclusion and restoration of the software cursor implemented by the DIB engine. These functions are also used to support controlled access to the frame buffer of the display adapter.
The minidriver excludes cursor drawing by specifying the exclusion rectangle in a call to the DIB_BeginAccess function. In this case, the Flags parameter of the function must be set to CURSOREXCLUDE. The minidriver removes the exclusion rectangle by calling the DIB_BeginAccess function with the CURSOREXCLUDE value.
To support controlled access to the frame buffer, the minidriver must set the deBeginAccess and deEndAccess fields of its PDEVICE structure to the addresses of its BeginAccess and EndAccess callback functions. If these fields are non-zero, the DIB engine calls the callback functions before and after accessing the device's frame buffer with the FB_ACCESS value. The purpose of the BeginAccess and EndAccess callback functions is to allow an accelerator to become idle before letting the DIB engine touch the screen.
The return value and parameters for the BeginAccess and EndAccess callback functions are identical to those for the DIB_BeginAccess and DIB_EndAccess functions.
Drivers use the BUSY bit to disable the frame buffer when switched away to a non-Windows application running in the full screen. In addition, drivers should set this bit whenever exclusive access to the frame buffer is needed. For example, a driver might have to put the adapter into a special mode to handle a fast bit-block transfer. While in this mode, the driver should set the BUSY bit so that no asynchronous event (for example, a software cursor in the DIB engine) attempts to write to the screen. The driver does not need to set the BUSY bit when BeginAccess is called. The BUSY bit must only be set when the system VM is switched to the background or when it is necessary to protect the screen from asynchronous drawing.
Note Future versions of the DIB engine may draw directly on the display framebuffer. The busy bit in deFlags will be the only mechanism to determine if the frame buffer is accessible. If your driver does not set this bit correctly, it may not work with future versions of the DIB engine. New drawing code in the DIB engine is not necessarily limited to synchronous, new DDI-type functions. Asynchronous drawing code (for example, a second cursor) may be added, which means a driver may need to set or clear the busy bit even if it is running with a hardware cursor.