2009-11-10 19:25:36 UTC
After I demonstrated my own fallibility regarding the forum markdown syntax, I would have thought you might do better! Here, what you see in the preview pane is what you get (wysitppiwyg)! The markdown syntax interprets certain ASCII formatting in 'special' ways. It is supposed to be an improvement on the old unformatted text forum (and it is), but no one here seems to have understood it. That said the continuing lack of a post edit feature does not help.
First of all, user level applications in Windows cannot perform direct hardware I/O so outp() will not work. Equivalents do exist in the MSVCRT library (_outp, _outpw, _outpd, but they are compatible only with Windows 95, and will not work with later versions of Windows. The reason being that to allow such access would allow you to access devices managed by Windows' device drivers and shared by other applications; it could potentially affect the correct operation of the whole system.
However there are solutions; how well they will work with Vista and Windows 7 I do not know, I have not looked at such things recently. It requires the use of a device driver that opens up access to the I/O map. The potential to screw up your system is still there of course, but the printer port is primarily a 'legacy' port, so nothing is likely to be using it. Try this Google search for some potential solutions.
ioperm() is a Linux API for opening access to a range of I/O ports, you'll need to use the mechanism provided by whatever I/O driver you get to work; quite probably it will not have such a mechanism, and will open access to all of them, in which case you don't need the call.
What you are attempting to do is not trivial, and given Microsoft's penchant from locking down Windows ever tighter (mostly a good thing), and constantly changing driver model with each new version (not always a good thing), you effort may be doomed. Perhaps this code should remain on Linux where it came from!?
Clifford