Jump to content

GetDriverInfo: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
This function returns a driver object handle for the engine object identified by hEngObject.  
This function returns a driver object handle for the engine object identified by hEngObject.
 
==Syntax==
==Syntax==
  GetDriverInfo(hEngObject, ulIndex, hdc);
  GetDriverInfo(hEngObject, ulIndex, hdc)
 
==Parameters==
==Parameters==
;hEngObject (ULONG) - input  
;hEngObject (ULONG) - input:Handle of a DC or bit map.
: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.


;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==
==Return Code==
; rc (LONG) - returns : Return codes.  
;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.
: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==
==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).  
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==
<PRE>
#include <os2.h>
 
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);
</PRE>


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.


[[Category:Gre]]
[[Category:Gre]]

Revision as of 08:25, 5 March 2020

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.