Still ->
http://www.geekhideout.com/iodll.shtmlC/C++ Prototypes
void WINAPI PortOut(short int Port, char Data);
void WINAPI PortWordOut(short int Port, short int Data);
void WINAPI PortDWordOut(short int Port, int Data);
char WINAPI PortIn(short int Port);
short int WINAPI PortWordIn(short int Port);
int WINAPI PortDWordIn(short int Port);
void WINAPI SetPortBit(short int Port, char Bit);
void WINAPI ClrPortBit(short int Port, char Bit);
void WINAPI NotPortBit(short int Port, char Bit);
short int WINAPI GetPortBit(short int Port, char Bit);
short int WINAPI RightPortShift(short int Port, short int Val);
short int WINAPI LeftPortShift(short int Port, short int Val);
short int WINAPI IsDriverInstalled();
To use IO.DLL with Visual C++/ Borland C++, etc, you'll need to use LoadLibrary and GetProcAddress. Yes, it's more of a pain than using a .lib file, but because of name mangling, it's the only reliable way of calling the functions in IO.DLL. I've gone ahead and done the dirty work for you:
io.cpp
io.h
Just save these two files and include them in your project. For a Visual C++, you may need to add #include "StdAfx.h" at the top of io.cpp otherwise the compiler will whine at you.
These two files take care of calling LoadLibrary and all the neccessary calls to GetProcAddress, making your life happy once again.
The only step you are required to do is call LoadIODLL somewhere at the beginning of your program. Make sure you do this or you will find yourself faced with all sorts of interesting crashes.
Please let me know if you find any errors in the above two files. They are new and haven't been tested all that much.
Delphi Prototypes
procedure PortOut(Port : Word; Data : Byte);
procedure PortWordOut(Port : Word; Data : Word);
procedure PortDWordOut(Port : Word; Data : DWord);
function PortIn(Port : Word) : Byte;
function PortWordIn(Port : Word) : Word;
function PortDWordIn(Port : Word) : DWord;
procedure SetPortBit(Port : Word; Bit : Byte);
procedure ClrPortBit(Port : Word; Bit : Byte);
procedure NotPortBit(Port : Word; Bit : Byte);
function GetPortBit(Port : Word; Bit : Byte) : WordBool;
function RightPortShift(Port : Word; Val : WordBool) : WordBool;
function LeftPortShift(Port : Word; Val : WordBool) : WordBool;
function IsDriverInstalled : Boolean;
Important! To use these functions in your Delphi program, the correct calling convention of stdcall is required. For example:
procedure PortOut(Port : Word; Data : Byte); stdcall; external 'io.dll';
Visual Basic Prototypes
Private Declare Sub PortOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Byte)
Private Declare Sub PortWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Integer)
Private Declare Sub PortDWordOut Lib "IO.DLL" (ByVal Port As Integer, ByVal Data As Long)
Private Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As Byte
Private Declare Function PortWordIn Lib "IO.DLL" (ByVal Port As Integer) As Integer
Private Declare Function PortDWordIn Lib "IO.DLL" (ByVal Port As Integer) As Long
Private Declare Sub SetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Private Declare Sub ClrPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Private Declare Sub NotPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte)
Private Declare Function GetPortBit Lib "IO.DLL" (ByVal Port As Integer, ByVal Bit As Byte) As Boolean
Private Declare Function RightPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Private Declare Function LeftPortShift Lib "IO.DLL" (ByVal Port As Integer, ByVal Val As Boolean) As Boolean
Private Declare Function IsDriverInstalled Lib "IO.DLL" As Boolean
Function Descriptions
Please refer to the prototype for the particular language you are using.
PortOut
Outputs a byte to the specified port.
PortWordOut
Outputs a word (16-bits) to the specified port.
PortDWordOut
Outputs a double word (32-bits) to the specified port.
PortIn
Reads a byte from the specified port.
PortWordIn
Reads a word (16-bits) from the specified port.
PortDWordIn
Reads a double word (32-bits) from the specified port.
SetPortBit
Sets the bit of the specified port.
ClrPortBit
Clears the bit of the specified port.
NotPortBit
Nots (inverts) the bit of the specified port.
GetPortBit
Returns the state of the specified bit.
RightPortShift
Shifts the specified port to the right. The LSB is returned, and the value passed becomes the MSB.
LeftPortShift
Shifts the specified port to the left. The MSB is returned, and the value passed becomes the LSB.
IsDriverInstalled
Returns non-zero if io.dll is installed and functioning. The primary purpose of this function is to ensure that the kernel mode driver for NT/2000/XP has been installed and is accessible.
yours