Vbio.dll v1.3a for Windows 3.x/95/98/ME
Copyright (c) 1997-2003 Hai Li, Zeal SoftStudio
E-Mail: info@zealsoft.com
http://www.zealsoft.com (English)
http://zealsoft.nease.net/ (Chinese)
Release: August 24, 2003

Vbio.dll (16bit & 32bit) is intended to read and write PC I/O ports in Windows 3.x/95/98/ME applications. In old Quick Basic, there are two functions, INP and OUT, which enable users to access I/O ports, but they are missing in all versions of Visual Basic. There are lots of people in the newsgroup requesting similar feature, so I decide to release Vbio.dll as the replacement of INP and OUT. It also can be used to get the LPT ports address and BIOS information. This DLL is very useful especially when you develop a hardware device and want to interface it in your Windows applications. 16-bit and 32-bit Visual Basic samples and Visual dBASE 5.5 samples are included. You can also use it in other languages, such as FoxPro/Visual FoxPro, Power Builder and so on.

This is a CARDWARE. If you want to use this program, please send me a POSTCARD, not e-mail. My address is as follows,
	Hai Li
	No.1607 Unit 133
	Beijing Institute of Technology
	Beijing 100081
	PR. China

Windows NT Issue
-------------------
This version of Vbio32.dll is not applied to Windows NT/2000/XP/Server 20003. Attempting to use the port I/O (input/output) functions from within an application for Windows NT/2000/XP/Server 20003 running in user mode causes a privileged instruction exception to occur. If you need an NT/2000/XP/Server 20003 version, please visit http://www.zealsoftstudio.com/ntport/ to download NTPort Library.

How To Use
--------------
Vbio.dll is very easy to use. Two DLLs, Vbio16.dll and Vbio32.dll are installed into your Windows\System directory. Vbio16.dll is designed for 16-bit applications, while Vbio32.dll is 32-bit version.

Visual Basic 5.0/6.0 function declaration is in Samples\VB5\Vbiovb5.bas. If you want to call Vbio.dll functions in your Visual Basic project, please select Project | Add Module and add Vbiovb5.bas to project.

Visual Basic 4.0 function declaration is in Samples\VB4\Vbiovb4.bas.

Vbio.dll and Vbio32.dll provide following functions. Note: some functions are only applied to 32-bit version.

  1) Declare Sub Outport Lib "Vbio32.dll" (ByVal _
	portID As Integer, ByVal nByte As Integer)

  Write a byte to a port. The parameter portID is the specific I/O port address, and nByte is the value you want to output.

  2) Declare Sub OutportW Lib "Vbio32.dll" (ByVal _
	portID As Integer, ByVal nWord As Integer)

  Write a word to ports. The parameter portID is the specific I/O port address, and nWord is the value you want to output.

  3) Declare Sub OutportD Lib "Vbio32.dll" (ByVal _
	portID As Integer, ByVal DWord As Long)

  Write a double word to ports. The parameter portID is the specific I/O port address, and nWord is the value you want to output. This function is only applied to 32-bit version.

  4) Declare Function Inport Lib "Vbio32.dll" _
	(ByVal portID As Integer) As Integer

  Read a byte from a port. The parameter portID is the specific I/O port address.

  5) Declare Function InportW Lib "Vbio32.dll" _
	(ByVal portID As Integer) As Integer

  Read a word from ports. The parameter portID is the specific I/O port address.

  6) Declare Function InportD Lib "Vbio32.dll" _
	(ByVal portid As Integer) As Integer

  Read a double word from ports. The parameter portID is the specific I/O port address. This function is only applied to 32-bit version.

  7) Decalare Function IsWinNT Lib "Vbio32.dll" _
        () As Integer

  Determine whether the application is running under Windows NT. Because this version of Vbio.dll is not applied to Windows NT, we suggest you to use this function to detect the OS platform. Refer to the "Windows NT Issue" section in this document.

  8) Declare Function GetLPTPortAddress Lib "vbio32.dll" _
       (ByVal portID As Integer) As Integer

  Get the LPT port address. Parameter portID is the specific LPT port address. This function is only applied to 32-bit version. Please refer to LPTPort sample.

  9) Declare Function GetBiosName Lib "vbio32.dll" _
       (ByVal sName As String) As Integer

  Get the name of BIOS. Parameter sName is the buffer used to receive the null-terminated string containing the name of BIOS. If the function succeeds, the return value is the length of the string copied to the buffer, not including the terminating null character. If the function fails, the return value is zero. This function is only applied to 32-bit version. Please refer to BIOS sample.

  10) Declare Function GetBiosCopyright Lib "vbio32.dll" _
       (ByVal sCopyright As String) As Integer

  Get the copyright information of BIOS. Parameter sCopyright is the buffer used to receive the null-terminated string containing the copyright information. If the function succeeds, the return value is the length of the string copied to the buffer, not including the terminating null character. If the function fails, the return value is zero. This function is only applied to 32-bit version. Please refer to BIOS sample.

  11) Declare Function GetBiosSerialNumber Lib "vbio32.dll" _
       (ByVal sSerialNumber As String) As Integer

  Get the serial number of BIOS. Parameter sName is the buffer used to receive the null-terminated string containing the serial number of BIOS. If the function succeeds, the return value is the length of the string copied to the buffer, not including the terminating null character. If the function fails, the return value is zero. This function is only applied to 32-bit version. Please refer to BIOS sample.

  12) Declare Function GetBiosDate Lib "vbio32.dll" _
       (ByVal sDate As String) As Integer

  Get the date of BIOS. Parameter sName is the buffer used to receive the null-terminated string containing the date of BIOS. If the function succeeds, the return value is the length of the string copied to the buffer, not including the terminating null character. If the function fails, the return value is zero. This function is only applied to 32-bit version. Please refer to BIOS sample.

Samples
---------
Visual Basic 3.0, 4.0 and 5.0/6.0 samples and Visual dBASE 5.5 samples are included, which is located in the Samples directory.

Source Code
--------------
If you need to know the secret why the DLL works, please visit http://www.zealsoftstudio.com/vbio/ to buy the source code of the DLLs(US$10). 16-bit Vbio.dll is written in Visual C++ 1.52 and 32-bit is written in Visual C++ 6.0.

History
---------
1.3a Add Visual dBASE 5.5 samples.
1.3  Add GetBiosName function to 32-bit version.
     Add GetBiosDate function to 32-bit version.
     Add GetBiosSerialNumber function to 32-bit version.
     Add GetBiosCopyright function to 32-bit version.
     Add BIOS sample.
1.2  Add GetLPTPortAddress function.
     Add LPTPort sample.
1.1  Add InportD, OutportD and IsWinNT functions to 32-bit version.
     Add Visual Basic 3.0 sample.
     Rename 16-bit DLL to Vbio16.dll.
1.0  Initial Release