SetDriverInfo: Difference between revisions
Appearance
Created page with "SetDriverInfo associates a driver object handle with the object identified by an engine object handle. == Syntax == SetDriverInfo(hDrvObject, hEngObject, ulIndex, hdc); ..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
SetDriverInfo associates a driver object handle with the object identified by an engine object handle. | SetDriverInfo associates a driver object handle with the object identified by an engine object handle. | ||
== Syntax == | == Syntax == | ||
SetDriverInfo(hDrvObject, hEngObject, ulIndex, hdc) | SetDriverInfo(hDrvObject, hEngObject, ulIndex, hdc) | ||
== Parameters == | == Parameters == | ||
; hDrvObject (ULONG) - input : Driver's handle for the object. | ;hDrvObject (ULONG) - input : Driver's handle for the object. | ||
This value must not be -1. | :This value must not be -1. | ||
;hEngObject (ULONG) - input : Engine'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: | |||
; ulIndex (ULONG) - input : Indicates the type of object. | lIndex = 0 Reserved | ||
Has the following settings: | lIndex = 1 hObject is a bit-map handle | ||
lIndex = 0 Reserved | ;hdc (HDC) - input : Device context handle that identifies the calling DC. | ||
lIndex = 1 hObject is a bit-map handle | |||
; hdc (HDC) - input : Device context handle that identifies the calling DC. | |||
== Returns == | == Returns == | ||
; rc (LONG) - returns : Return codes. | ;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. | |||
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 == | == 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. | 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. | 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 == | == Example Code == | ||
Line 39: | Line 35: | ||
rc = SetDriverInfo(hDrvObject, hEngObject, ulIndex, hdc); | rc = SetDriverInfo(hDrvObject, hEngObject, ulIndex, hdc); | ||
</PRE> | </PRE> | ||
[[Category:PDD]] | [[Category:PDD]] |
Latest revision as of 09:41, 5 April 2025
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);