How To Call GDI Functions from a Print Driver

ID: Q151891


The information in this article applies to:
  • Microsoft Windows 95 Driver Development Kit (DDK)


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.


Additional query words: debugging print driver

Keywords : kbDDK kbPrinting
Version : Win95:
Platform : Win95
Issue type :


Last Reviewed: October 12, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.