WritePrinter() API Call Does Not Work When You Print to an LPR Printer (252663)



The information in this article applies to:

  • Microsoft Windows NT Server 4.0
  • Microsoft Windows NT Server 4.0 SP6
  • Microsoft Windows NT Server 4.0 SP6a
  • Microsoft Windows NT Workstation 4.0
  • Microsoft Windows NT Workstation 4.0 SP6
  • Microsoft Windows NT Workstation 4.0 SP6a
  • Microsoft Windows NT Server, Enterprise Edition 4.0
  • Microsoft Windows NT Server, Enterprise Edition 4.0 SP6
  • Microsoft Windows NT Server, Enterprise Edition 4.0 SP6a

This article was previously published under Q252663

SYMPTOMS

When you try to print to an LPR printer, the WritePrinter() application programming interface (API) may not work when the program you are using calls the API. The GetLastError() API may return the following error message:
ERROR_INSUFFICIENT_BUFFER

CAUSE

This issue can occur if the status of the print job changes between the time the WritePrinter() API requests the size needed for the status and the time the WritePrinter() API requests the status from the spooler.

RESOLUTION

To resolve this issue, change the printer settings from the Start print immediately option to the Start printing after the last page is spooled option.

Modification Type:MajorLast Reviewed:5/14/2003
Keywords:kbprb KB252663