Table of contents
Collapse the table of content
Expand the table of content

GDI Support for Surfaces

Last Updated: 2/14/2017

For each PDEV, a driver must support the DrvEnableSurface function. DrvEnableSurface sets up the surface to be drawn on and associates it with the PDEV. The driver must also support the DrvDisableSurface function to disable created surfaces. Because GDI creates and maintains the surface, the driver relies on several GDI service functions, listed in the following table, to implement the enabling and disabling of surfaces.

Function NamePurpose


Associates a surface with a PDEV and defines the drawing operations the driver writer wants to hook out for that surface. It uses the PDEV's default palette and style steps. The driver must make this call for the primary surface during the execution of DrvEnableSurface. The driver must also make this call when it enables a secondary surface before locking the surface to write on it.


(Printers only) Enables a printer driver to determine whether its printer job has been terminated.


Creates a standard format DIB bitmap. GDI can perform all drawing operations on this type of surface.


Creates a device-dependent bitmap which the driver is responsible for drawing on (although it can be created as a DIB, in which case the driver can call back to have GDI draw on it).


Creates a device-managed surface. The driver is responsible for managing certain drawing operations for this surface. The function returns a handle that the driver manages.


Create a WNDOBJ structure on a specified surface.


Deletes a surface (DIB, device-dependent bitmap, or device-managed surface).


Deletes a WNDOBJ structure.


Fills a specified rectangle on a surface with a given color, effectively erasing it. This function should be called only to erase the surface of a GDI bitmap.


Locks the kernel-mode handle of a DirectDraw surface.


Gives the driver access to a created surface by creating a user object (SURFOBJ) for that surface. (The primary surface is not locked.)


(Printers only) Marks a surface as a banding surface.


Notifies GDI about the attributes of a surface that was created by the driver.


Releases the lock on a given DirectDraw specified surface.


Unlocks a surface when the driver has finished a drawing operation (to be called when disabling a secondary surface).

Send comments about this topic to Microsoft

© 2017 Microsoft