SetDriverInfo
SetDriverInfo associates a driver object handle with the object identified by an engine object handle.
Syntax
SetDriverInfo(hDrvObject, hEngObject, ulIndex, hdc);
Parameters
- hDrvObject (ULONG) - input
- Driver's handle for the object.
This value must not be -1.
- hEngObject (ULONG) - input
- Engine's handle for the object. This value must not be -1.
- ulIndex (ULONG) - input
- Indicates the type of object.
Has the following settings:
lIndex = 0 Reserved lIndex = 1 hObject is a bit-map handle
- hdc (HDC) - input
- Device context handle that identifies the calling DC.
Returns
- rc (LONG) - returns
- Return codes.
If successful, the function returns the driver object handle that was associated with the object before any changes were made by SetDriverInfo. If an error is detected, the function returns GPI_ALTERROR.
Remarks
Object handles are stored in the bit maps when they are created. Calling SetDriverInfo provides a method the presentation driver can use to change the driver handle in the bit map. SetDriverInfo 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.
SetDriverInfo is exported by the graphics engine at ordinal 31. If a presentation driver calls this function, it must be imported by the driver's module definition file.
Example Code
#include <os2.h> ULONG hDrvObject; /* Driver's handle for the object. */ ULONG hEngObject; /* Engine's handle for the object. This value must not be -1. */ ULONG ulIndex; /* Indicates the type of object. */ HDC hdc; /* Device context handle that identifies the calling DC. */ LONG rc; /* Return codes. */ rc = SetDriverInfo(hDrvObject, hEngObject, ulIndex, hdc);