Vbio.dll v1.3 for Windows 3.x/95/98
Copyright (c) 1997-2000 Hai Li, Zeal SoftStudio
E-Mail: info@zealsoftstudio.com
http://www.zealsoftstudio.com (English)
http://www.nease.net/~zealsoft/ (Chinese)
Release: December 1, 2000

Vbio.dll (16bit & 32bit) is intended to read and write PC I/O ports in Windows 3.x/95/98 application. In old Quick Basic, there are two functions INP and OUT which enable users to access I/O ports, but they are missing in 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 hareware device and want to interface it in your Windows application. 16-bit and 32-bit Visual Basic 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

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.

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.

Visual Basic 4.0 function declaration is in Samples\VB4\Vbiovb4.bas.
Visual Basic 5.0/6.0 function declaration is in Samples\VB5\Vbiovb5.bas.

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

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

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.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