Novatex Research
Port Poker Version 000 - Shareware
Copyright (c) 1999 Novatex Research
E-mail:
software@novatex.com.auhttp://www.novatex.com.au
This utility is designed to give windows programmers easy access to the parallel port hardware. Writing to ports and hooking interrupts is a difficult given the protection that Windows places on top of the hardware.
Porting a DOS utility for some custom hardware to 32bit windows will be easier with the help of our Port Poker.
Port Poker enables direct writing to the hardware ports and notification via the windows message queue of an interrupt being triggered.
The fully registered version of this software costs $75 US. This is for an UNLIMITED development site licence. This includes the Windows 95/98 and NT4 (when available) versions. (A site is defined as a circle radius 10km – i.e. The whole of IBM could not use one copy!) Distribution of software developed using this software is unrestricted, except that the main purpose of the software must be different.
Port Poker must be distributed with these files:
NOVPP000.VXD The Windows 95/98 device driver.
NOVPP000.SYS The Windows NT 4 device driver - Will be released soon.
NODPP000.DLL The DLL that interfaces to the device driver.
NODPP000.H A c++ include file for the functions in the DLL.
NODPP000.PAS A Delphi (Pascal) include file for the functions in the DLL.
NODPP000.LIB An import library for the DLL.
DEMO.EXE An demo program showing a possible use of port poker.
README.DOC This document.
README.HTML This document.
LICENCE.TXT A plain text version of the Licence Agreement.
Port Poker may also contain more files. The most common are:
BCCDEMO.ZIP The source code for the above program.
DELPHIDEMO.ZIP The source code for the program in Delphi.
Licence Agreement.
You should carefully read the following terms and conditions before using and/or distributing and/or archiving this software. Your use of and/or distribution of and/or archiving of this software indicates your acceptance of this license agreement and warranty.
Shareware
The Software is the collection of ALL files contained in this distribution, and the distribution itself. The list of files above is NOT definitive.
You may use this Shareware Copy of this Software for an evaluation period of up to 60 days, in order to determine wether the Software meets your needs before purchasing it. Once the evaluation period ends you agree to either purchase a Registered Copy of the Software, or to stop using it and remove it from your computer system. Multiple copies may be retained for Novatex Research's contact details and/or for distribution. You cannot continue to use the Software.
You must not:
(a) Try to defeat messages in the Software which alert the user to the unregistered status of the Software.
(b) Modify the software.
(c) Produce a derivative of the software.
(d) Reverse engineer, decompile or disassemble the Software.
Distribution
You are hereby granted the right
- To make as many copies of this software and its documentation as you wish;
- Give exact copies (including all files) of the original version to anyone;
- Distribute the software and documentation in its unmodified form via electronic means.
There is no fee for any of the above.
You are specifically prohibited from charging, or requesting donations, for any such copies (a small handling fee is acceptable). You are further prohibited from distributing the software and/or documentation with other products (commercial or otherwise) without prior written permission.
Legal Disclaimer
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
IN NO EVENT WILL THE AUTHOR OR ANY OTHER PARTY WHO MAY HAVE DISTRIBUTED THE SOFTWARE AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
The Parallel Port.
The use of the hardware ports inside a parallel port and the meaning of bits in those ports is beyond the scope of this document. This document assumes that you already know what you want to do with your hardware but Windows was preventing you.
For information on the parallel port and other hardware we recommend:
Ralph Brown's Interrupt List -
http://www.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/pub/WWW/ralf-home.htmlIf you discover that you need custom software for your task then don't hesitate to contact Novatex Research for a quote.
e-mail:software@novatex.com.au
or http://www.novatex.com.auOne device driver that we have produced uses the parallel port to generate a serial bit stream that controls a SONY DAT recorder.
Installation.
The device driver file (NOVPP000.VXD or NOVPP000.SYS) and the DLL (NODPP000.DLL) should be in the same directory as any executables using it or somewhere in the search path. The directory "C:\WINDOWS\SYSTEM" is suitable for most Windows 95 and 98 users.
Functions in the DLL.
Port access is restricted to the standard parallel port hardware addresses (0x378, 0x278). Where a function parameter is a hardware port the parameter is a physical hardware address NOT a parallel port number.
All function calls that access hardware ports check to see that you are accessing ports 0x378 to 0x37f or 0x778 to 0x77a (for LPT1) or 0x278 to 0x27f or 0x678 to 0x67a (for LPT2).
The interrupts that can be hooked are IRQ 7 (for LPT1) and IRQ 5 (for LPT2)
These restrictions cause no problem for most simple hardware applications. If you find that you need some custom software for you project then please contact Novatex Research.
e-mail:software@noavtex.com.au or see our web site for further details: http://www.novatex.com.au. The exchange rates from the dollar and pound to the Australian dollar are very favourable...void NovPPOutECP(unsigned short hardwareport, unsigned char data)
Parameters:
unsigned short hardwareport The hardware port to write to.
unsigned char data The byte to write to the port.
This function writes a byte to the given hardware port. It is restricted to the port numbers described above.
unsigned char NovPPInECP(unsigned short hardwareport)
Parameters:
unsigned short hardwareport The hardware port to write to.
This function reads a byte from the given hardware port. It is restricted to the port numbers described above.
Return value:
The byte read from the port.
int NovPPHookIrq(int irqnumber, HANDLE handle, int message)
Parameters:
int irqnumber The irqnumber to hook
HANDLE handle The handle of a window to send a message to.
int message The message number to send the handle.
This function will hook the given IRQ. It is restricted to the IRQ numbers described above. When the IRQ is triggered a message will be posted to the handle. On entry to your WindowProc the parameters will be as follows:
HWND hwnd handle
UINT uMsg message
WPARAM wParam irqnumber
LPARAM lParam 0
The same interrupt can be hooked by multiple handles (windows) in multiple applications at the same time.
Return value:
The function returns non zero if the hook was successfully installed.
int NovPPUnhookIrq(int irqnumber, HANDLE handle)
Parameters:
int irqnumber The irqnumber to unhook.
HANDLE handle The handle of a window currently hooking the IRQ.
This function releases the hook on a given IRQ. You must specifiy the handle as the same IRQ can be hooked by multiple handles at the same time.
Return value:
The function returns non zero if the unhook was successful.
void NovPPSetECPIRQStatus(int irqnumber, int status)
Parameters:
int irqnumber The irqnumber to enable or disable
int status nonzero if you want to enable the IRQ logic on that parallel port.
This function is not required. It is provided merely as a shortcut.
int NovPPLoadDriver(void);
This function is not required - but it is useful. All of the functions will attempt to load the device driver if it has not been loaded. None of them can tell you if it failed except this one. Loading the device driver may take too long: Your first call will suffer from this. This function will preload the device driver before any calls hardware is accessed.
Return value:
The function returns non zero if the driver is now loader or was already loaded.
----
Copyright(c) 1999 Novatex Research.
All rights reserved.