DrvResetPDEV function (winddi.h)

The DrvResetPDEV function allows a graphics driver to transfer the state of the driver from an old PDEV structure to a new PDEV structure when a Win32 application calls ResetDC.

Syntax

BOOL DrvResetPDEV(
  DHPDEV dhpdevOld,
  DHPDEV dhpdevNew
);

Parameters

dhpdevOld

Caller-supplied handle to the original device PDEV structure. This handle was previously provided by the driver as a return value for DrvEnablePDEV.

dhpdevNew

Caller-supplied handle to the new PDEV structure.

Return value

This return value is TRUE if the function is successful. Otherwise it is FALSE, and an error code is logged.

Remarks

A graphics driver's DrvResetPDEV function should be used for modifying the contents of a new PDEV structure, based on the contents of the old (currently in use) PDEV structure.

OpenGL display drivers that need to know about mode changes should implement DrvResetPDEV. Otherwise, all other display drivers typically do not need to implement this function.

Note  The following information pertains to printer graphics DLLs.

The function is called as a result of an application's call to the Win32 ResetDC function, which in turn causes GDI to call the driver's DrvEnablePDEV to obtain a new PDEV structure. Because the driver can modify a PDEV structure's contents during the rendering of a print job, the DrvResetPDEV function allows the driver to transfer these modifications from the old PDEV structure to the new one.

Examples of the types of information that a printer graphics DLL might want to add to the new PDEV structure are pointers to cached font files, or flags indicating whether page initialization should (or should not) take place the next time DrvStartDoc or DrvStartPage is called.

If ResetDC is called during the rendering of a print document, the printer graphics DLL receives the following sequence of calls:

    dhpdevNew = DrvEnablePDEV();
    DrvResetPDEV(dhpdevOld, dhpdevNew);
    DrvDisableSurface(dhpdevOld);
    DrvDisablePDEV(dhpdevOld);
    DrvEnableSurface(dhpdevNew);
    DrvStartDoc(dhpdevNew);

If ResetDC is called between documents there is no surface associated with the PDEV, so only the following sequence of calls is made:

    dhpdevNew = DrvEnablePDEV();
    DrvResetPDEV(dhpdevOld,dhpdevNew);
    DrvDisablePDEV(dhpdevOld);

Requirements

Requirement Value
Target Platform Desktop
Header winddi.h (include Winddi.h)

See also

DrvDisablePDEV

DrvDisableSurface

DrvEnablePDEV

DrvEnableSurface

DrvStartDoc

DrvStartPage