Bagikan melalui


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

EngAssociateSurface

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.

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

EngCreateWnd

Create a WNDOBJ structure on a specified surface.

EngDeleteSurface

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

EngDeleteWnd

Deletes a WNDOBJ structure.

EngEraseSurface

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.

EngLockDirectDrawSurface

Locks the kernel-mode handle of a DirectDraw surface.

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.

EngModifySurface

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

EngUnlockDirectDrawSurface

Releases the lock on a given DirectDraw specified surface.

EngUnlockSurface

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