How To Call GDI Functions from a Print Driver (151891)



The information in this article applies to:

  • Microsoft Windows 95 Driver Development Kit (DDK)
  • Microsoft Windows 98 Driver Development Kit (DDK)
  • Microsoft Windows ME Driver Development Kit (DDK)

This article was previously published under Q151891

SUMMARY

A print driver can call GDI functions having the same name as printer- driver entry-point functions by explicitly or implicitly reloading GDI.

MORE INFORMATION

Windows 95 printer drivers export functions that have the same name as the GDI functions. In order to call the GDI functions from a printer driver, such as BitBlt, ExtTextOut, etc., do the following:

  1. Import the GDI functions in the .DEF file under the IMPORTS section of the driver's .DEF file and use the imported function names.
  2. Do a LoadLibrary on GDI.EXE and obtain the address of the desired function to be called using the GetProcAddress function. Once the address is obtained, the function can be called using the function pointer.
  3. Define a DLL with functions that will call the GDI functions and IMPORT the DLL functions in the printer driver. For example, to call a GDI function, you would call the corresponding function in the DLL that, in turn, would make the GDI function call.

Modification Type:MinorLast Reviewed:5/24/2004
Keywords:kbprint KB151891