GetDriverInfo

This function returns a driver object handle for the engine object identified by hEngObject.

Syntax
GetDriverInfo(hEngObject, ulIndex, hdc);

Parameters

 * hEngObject (ULONG) - input
 * Handle of a DC or bit map.


 * ulIndex (ULONG) - input
 * Has the following settings:


 * Index=0 hEngObject is a DC handle
 * Index=1 hEngObject is a bit-map handle


 * hdc (HDC) - input
 * Device context handle, which identifies the calling DC.

Return Code

 * rc (LONG) - returns : Return codes.


 * If successful, the function returns the instance pointer associated with the object DC or the presentation driver's handle to the object bit map. If an error is detected, the function returns GPI_ALTERROR.

Remarks
The parameter hEngObject can be a DC handle or an engine bit-map handle (for example, the source handle, which would be passed to the presentation driver's GreBitblt routine). If hEngObject is a DC, the return code is a pointer (pInstance) to the instance data of that DC. If hEngObject is a bit map, the return code is the driver's handle for the bit map (that is the handle returned to the presentation driver when the bit map was created).

GetDriverInfo includes a check to ensure that the object is, or was created by, an instance of a DC for the same device as the DC identified by hdc. If the check is not successful, the function returns GPI_ALTERROR. GetDriverInfo is exported by the graphics engine at ordinal 30 and, if the presentation driver wants to call this function, it must be imported by the driver's module definition file.

Example Code

 * 1) include 

ULONG   hEngObject;  /*  Handle of a DC or bit map. */ ULONG   ulIndex; HDC     hdc;         /*  Device context handle, which identifies the calling DC. */ LONG    rc;          /*  Return codes. */

rc = GetDriverInfo(hEngObject, ulIndex, hdc); 