DRIVEROBJ

typedef struct _DRIVEROBJ {
    PVOID pvObj;
    FREEOBJPROC pFreeProc;
    HDEV hdev;
} DRIVEROBJ;

The DRIVEROBJ structure is used to track a resource allocated by a driver that wants to use GDI services. A DRIVEROBJ allows a display driver to request the GDI service in managing per-process resources. By creating a DRIVEROBJ, a display driver can insure that resources will be released when an application terminates.

Members

pvObj
Points to the driver resource that will be tracked by the DRIVEROBJ. The resource is associated with the current client process.
pFreeProc
Points to a driver-supplied callback function that frees the resource pointed to by pvObj.
hdev
The GDI handle of the physical device associated with the object.

Comments

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

See Also

EngCreateDriverObj, EngDeleteDriverObj, EngLockDriverObj, EngUnlockDriverObj