The DRIVEROBJ structure is used to track a resource, allocated by a driver, that requires use GDI services. A DRIVEROBJ structure allows a display driver to request the GDI service in managing per-process resources. By creating a DRIVEROBJ structure, a display driver can insure that resources will be released when an application terminates.
typedef struct _DRIVEROBJ {
PVOID pvObj;
FREEOBJPROC pFreeProc;
HDEV hdev;
DHPDEV dhpdev;
} DRIVEROBJ;
BOOL (CALLBACK * FREEOBJPROC) (DRIVEROBJ * pDriverObj);
The callback function returns TRUE if it is able to free the resource, and FALSE otherwise.
Declared in winddi.h. Include winddi.h.
A DRIVEROBJ structure allows a display driver to request the GDI service in managing per-process resources. By creating a DRIVEROBJ structure, a display driver can insure that resources will be released when an application terminates.
Some drivers, in their Escape support, allocate resources on behalf of applications. In such cases, the DRIVEROBJ structure provides a means for the application to notify the driver when it terminates. GDI will call the driver's cleanup function for each DRIVEROBJ structure allocated in an application's context that is not deleted before the application terminates.
This structure provides a locking mechanism for exclusive access to the associated resource.
EngCreateDriverObj, EngDeleteDriverObj, EngLockDriverObj, EngUnlockDriverObj