You might try this WinIO.dll from http://www.internals.com
rem winiotest.dba
Port as WORD
Port = 0x378
PortVal as DWORD
PortVal = 0
FormFeed = 12
#constant WINIODLL 1
load dll "winio.dll",WINIODLL
Ret = call dll(WINIODLL, "InitializeWinIo")
print "InitializeWinIo = ";Ret
rem RetPortVal was added to winio.dll to return the value
rem instead of passsing the address of a variable.
PortVal = call dll(WINIODLL, "RetPortVal", Port, 4)
print "RetPortVal = ";PortVal
Ret = call dll(WINIODLL, "SetPortVal", Port, FormFeed, 4)
print "SetPortVal = ";Ret
Ret = call dll(WINIODLL, "ShutdownWinIo")
print "ShutdownWinIo = ";Ret
delete dll WINIODLL
wait key
The RetPortVal function for winio.dll
//winio.def
RetPortVal
//winio.h in extern "c" section same order as the .def file
WINIO_API DWORD _stdcall RetPortVal(WORD wPortAddr, BYTE bSize);
//port32.cpp
DWORD _stdcall RetPortVal(WORD wPortAddr, BYTE bSize)
{
DWORD dwPortVal;
GetPortVal(wPortAddr, &dwPortVal, bSize);
return dwPortVal;
}