

                         ** PortMgr - User's Manual  **


Copyright 2001 Manfred Keul (MKeul@stones.com)

PortMgr is part of the TinyPort package and may not be distributed alone.

-------------------------------------------------------------------------

Contents:

1) Usage
2) ACPI Machines

-------------------------------------------------------------------------

1) Usage
========

Quite a few developers use TinyPort to control hardware that is
connected to a parallel (printer) port of the PC. Before Windows 2000,
you had to totally stop the parallel port driver to do this; otherwise,
NT wouldn't grant TinyPort access to the port. (As opposed to some
other port drivers, TinyPort is well behaved and will not access ports
that NT reports as being in use.) Of course, in doing so, you shut down
*every* printer port: No more printing...

The good news is that this has changed with Windows 2000: You can now
have one parallel port be controlled by TinyPort while the other is left
for printing. The bad news is that you have to point and click a lot to
tell the Windows 2000 Device Manager what you want (see the FAQ's in
TINYPORT.WRI for details).

Our PortMgr utility offers an easier solution: With a single command
you can disable and enable parallel ports at will.

PortMgr is a command line tool and can be run like this:

    PORTMGR LPTx [ON | OFF],

For example, PORTMGR LPT1 OFF will tell Windows to free LPT1;
thereafter, you can have TinyPort access the ports associated with LPT1.
If you later want to give control back to Windows, just run PORTMGR LPT1
ON.

In some rare cases, Windows may want to restart after disabling or
enabling a port. This can happen no matter whether you use PortMgr or
Device Manager.


2) ACPI Machines
================

Since about summer 2001 many PC's have motherboards and BIOS's
implementing the ACPI standard (Advanced Configuration and Power
Interface). Windows 2000 and XP are the first Windows versions to take
full advantage of this feature to save as much power as possible.
Amongst others, Windows 2000 and XP aggressively try to switch off
hardware devices that they believe to be idle.

If you disable a parallel printer port on a full-featured ACPI system,
be it via Device Manager, PortMgr, or by stopping the corresponding NT
driver, Windows will power it down that very moment. (Naturally, the
same holds for a serial port.) Thereafter, no IN or OUT command to this
port will have any result whatsoever. And of course, TinyPort can't do
any magic here either. On e.g. a WriteByte call, TinyPort will
faithfully write the byte to the port - which will totally ignore it.
One can't even detect any kind of software error, only the hardware
won't react. TinyPort is a universal driver, so it doesn't know
anything about the special features of an ACPI managed port; only a
driver written specifically to handle these ports could help here.
Please contact us (MKeul@stones.com) if you want to know details.

In some cases, it might be possible to disable ACPI support altogether.
The preferred way: If the BIOS offers a setting for ACPI, switch it off
*before* installing Windows. If the BIOS won't allow this, or if
Windows has already been installed, one might try to "upgrade" it to a
non-ACPI configuration; the procedure is described in Microsoft
Knowledge Base article Q237556
(http://support.microsoft.com/support/kb/articles/Q237/5/56.ASP).
However, this might cause havoc in some cases, so please try it at your
own risk only, and remember to back up everything and to create an
Emergency Repair disk before.

PortMgr will try to detect whether it's running on an ACPI machine and
by default will not disable a printer port on these machines, displaying
a warning message instead. You can override this behavior by adding the
/A switch to the command line; for example PORTMGR LPT1 OFF /A will
disable LPT1 even on an ACPI computer.


(Doc.Rev. 1.1)
