How GDI Sends Data to the Printer

Last reviewed: July 23, 1997
Article ID: Q112387
3.10 WINDOWS kbprg

The information in this article applies to:

  • Microsoft Windows Software Develpment Kit (SDK) for Windows version 3.1

SUMMARY

If the "Fast Printing Direct to Port" option is enabled from the Microsoft Windows Control Panel, print-job data will be sent directly to the printer port, using COMM.DRV. Otherwise, MS-DOS _lwrite() calls will be used to write data to the port. The Fast Printing Direct to Port setting corresponds to the DosPrint entry in the [Windows] section of WIN.INI.

MORE INFORMATION

When a print job is started by a printer driver, the printer driver will call into GDI, using the OpenJob() function. Within OpenJob(), GDI uses the following sequence of steps to determine whether to print directly to the port, or to use MS-DOS _lwrite:

  1. Attempts to call the network driver's WNetOpenJob() function, if that function exists. If WNetOpenJob succeeds, indicating that the port is a redirected network port, GDI will use _lwrite() to write to the port, regardless of the "Fast Printing Direct to Port" setting. Otherwise:

  2. Checks to see if "Fast Printing Direct to Port" is selected. If it is not selected, GDI will use _lwrite() to write to the port. Otherwise:

  3. Calls OpenComm() for the selected port. If OpenComm() succeeds, the communications API, which call into COMM.DRV, will be used to write to the port [WriteComm()]. Otherwise:

  4. Uses _lwrite().


Additional reference words: 3.10
KBCategory: kbprg
KBSubcategory: GdiPrn
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 23, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.