GDI Support for Surfaces

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 DrvDisableSurface 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 Name

Purpose

EngAssociateSurface

Associates a surface with a PDEV and defines the drawing operations the driver wants to hook out for that surface. It assumes the PDEV’s default palette and style steps. The driver must make this call for the primary surface, during DrvEnableSurface and when enabling a secondary surface before locking the surface to write on it.

EngCheckAbort

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

EngCreateBitmap

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

EngCreateDeviceBitmap

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).

EngCreateDeviceSurface

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.

EngDeleteSurface

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

EngEraseSurface

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

EngLockSurface

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

EngMarkBandingSurface

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

EngUnlockSurface

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

For more information on these functions, refer to the Graphics Driver Reference.