BUG: Printer Port Redirection Not Effective for Windows Apps

Last reviewed: June 28, 1996
Article ID: Q152788
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface included with: - Microsoft Windows 95

SYMPTOMS

Changing the redirection of an MS-DOS LPT device that is used by Windows fails. This problem occurs when using the WNetCancelConnection and WNetAddConnection functions to change a previously-redirected LPT port. Although the functions succeed and Windows reports the new device redirection, any Windows printer driver using the device continues to print to the original remote printer.

Similar behavior occurs if the Capture Printer Port feature is used in the printer properties dialog. Any attempt to change a printer port's connection to a different remote printer will appear to succeed but the print jobs arrive at the original remote printer.

This problem occurs only with Windows applications. MS-DOS applications executed within a console or "DOS" box are not affected by this problem and their output will be properly directed to the network print share for the LPTX device.

RESOLUTION

To work around this problem, do not use WNetAddConnection and MS-DOS devices to connect Windows printer drivers to network print shares. Instead, configure Windows printers to use print shares directly via network ports. This behavior is accomplished by using the Print Spooler functions: OpenPrinter, GetPrinter, SetPrinter, ClosePrinter, EnumPorts, and AddPort. Continue to use the WNet functions in Windows to redirect MS-DOS devices for MS-DOS applications.

The Print Spooler is a new feature of Windows 95 and Windows NT. For more information on using the Print Spooler APIs to configure network printers, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q152551
   TITLE     : How to Connect Local Printers to Network Print Shares

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional reference words: 4.00 network print queue spooler
KBCategory: kbprg kbprint kbbuglist
KBSubcategory: NtwkMisc



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: June 28, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.