The DrvEnablePDEV function returns a description of the physical device's characteristics to GDI.
DHPDEV
DrvEnablePDEV(
IN DEVMODEW *pdm,
IN LPWSTR pwszLogAddress,
IN ULONG cPat,
OUT HSURF *phsurfPatterns,
IN ULONG cjCaps,
OUT ULONG *pdevcaps,
IN ULONG cjDevInfo,
OUT DEVINFO *pdi,
IN HDEV hdev,
IN LPWSTR pwszDeviceName,
IN HANDLE hDriver
);
For a driver that supports Windows NT 4.0, DrvEnablePDEV should return the default mode of the hardware when GDI calls it with the following DEVMODEW members set to zero: dmBitsPerPel, dmPelsWidth, dmPelsHeight, and dmDisplayFrequency.
Display drivers should ignore this parameter.
Display drivers should ignore this parameter.
For printer drivers, points to a buffer that the driver will fill with surface handles representing the standard fill patterns. The following patterns must be defined in order:
| Pattern | Description |
|---|---|
| HS_HORIZONTAL | Horizontal hatch. |
| HS_VERTICAL | Vertical hatch. |
| HS_FDIAGONAL | 45-degree upward hatch (left to right). |
| HS_BDIAGONAL | 45-degree downward hatch (left to right). |
| HS_CROSS | Horizontal and vertical cross hatch. |
| HS_DIAGCROSS | 45-degree crosshatch. |
Note The number of default hatch patterns that require driver support was reduced in a previous version of the DDK. Consequently, HS_DDI_MAX, typically used by drivers to declare the size of the pattern array, was reduced.
GDI calls DrvRealizeBrush with one of these surfaces to realize a brush with a standard pattern.
Each of these surfaces must be a monochrome (1 bit per pixel) GDI bitmap for raster devices. The device driver should choose patterns that will look most like standard patterns when written on the device surface.
GDI is never required to use these brushes in support routines for a vector device. Therefore, surfaces can be device-supported surfaces that DrvRealizeBrush recognizes as standard patterns.
The return value is a handle to the PDEV that identifies the enabled device if the function is successful. That is, DrvEnablePDEV returns a handle to the private, driver-defined device instance information upon success. Otherwise, it returns NULL.
Declared in winddi.h. Include winddi.h.
A graphics device driver might support several physical devices attached to different logical addresses. Drivers must also support simultenous use of different drawing surfaces.
The purposes of DrvEnablePDEV are the following:
When GDI subsequently calls other graphics DDI functions, it supplies the handle returned by DrvEnablePDEV as input (usually within a SURFOBJ structure) so the driver can identify the device instance.
A single logical device can manage several PDEVs that can be differentiated by the following:
When receiving a call to this function, the driver must allocate the memory to support the PDEV. However, the actual surface need not be supported until GDI calls DrvEnableSurface.
If a device surface requires a bitmap to be allocated, these allocations need not be made until needed. Although applications often request device information long before actually writing to the device, waiting to allocate resources, such as large bitmaps, can conserve memory.
GDI zero-initializes the buffer pointed to by phsurfPatterns before calling this function.
DrvEnablePDEV is required for graphics drivers.
DEVINFO, DEVMODEW, DrvEnableSurface, DrvRealizeBrush, EngCreatePalette, GDIINFO