The DrvSynchronize function informs the driver that GDI needs to access a device-managed surface. This function allows asychronous drawing operations performed by a device's coprocessor to be coordinated with GDI accesses.
VOID
DrvSynchronize(
IN DHPDEV dhpdev,
IN RECTL *prcl
);
Declared in winddi.h. Include winddi.h.
This function allows asynchronous drawing operations performed by a device's coprocessor to be coordinated with GDI accesses.
DrvSynchronize can be optionally implemented in display drivers. GDI calls this function only if it is hooked by EngAssociateSurface. GDI calls DrvSynchronize just before drawing directly onto the device surface. GDI will call DrvSynchronizeSurface instead of DrvSynchronize in drivers that implement both of these functions.
This function should return only when it is safe for GDI to access any device-managed surface. That is, DrvSynchronize should delay returning from the call until all asynchronous drawing operations have been completed by the device's co-processor, thus indicating that it is safe for GDI to access any device-managed surface.
DrvSynchronize is intended to support devices that use a coprocessor for drawing. Such a device can treat some drawing operations as asychronous, returning to GDI from the operation before the drawing is complete. If this is the case, it is possible that a subsequent drawing operation will be handled by GDI. In order for GDI to safely access device-managed surfaces, it must have a means of ensuring that any asynchronous rendering being done by the device's co-processor is complete. By calling this function, GDI synchronizes access to a device-managed surface with the driver.
GDI will never call DrvSynchronize for device-managed surfaces. DrvSynchronize is not itself an output function.